From 79a1789e158cff010fdf42e38a7a4facdcf1550d Mon Sep 17 00:00:00 2001 From: Amrita Shanbhag Date: Mon, 8 Mar 2021 17:37:15 +0530 Subject: [PATCH 1/3] Added the Codesigning extension --- src/codesigning/HISTORY.rst | 8 + src/codesigning/README.md | 53 ++ src/codesigning/azext_codesigning/__init__.py | 50 + src/codesigning/azext_codesigning/action.py | 17 + .../azext_codesigning/azext_metadata.json | 4 + src/codesigning/azext_codesigning/custom.py | 17 + .../azext_codesigning/generated/__init__.py | 12 + .../generated/_client_factory.py | 28 + .../azext_codesigning/generated/_help.py | 128 +++ .../azext_codesigning/generated/_params.py | 90 ++ .../generated/_validators.py | 9 + .../azext_codesigning/generated/action.py | 10 + .../azext_codesigning/generated/commands.py | 49 + .../azext_codesigning/generated/custom.py | 136 +++ .../azext_codesigning/manual/__init__.py | 12 + .../azext_codesigning/tests/__init__.py | 116 +++ .../tests/latest/__init__.py | 12 + .../tests/latest/example_steps.py | 126 +++ .../recordings/test_codesigning_Scenario.yaml | 884 ++++++++++++++++++ .../tests/latest/test_codesigning_scenario.py | 71 ++ .../test_codesigning_scenario_coverage.md | 10 + .../vendored_sdks/__init__.py | 12 + .../vendored_sdks/codesigning/__init__.py | 19 + .../_code_signing_management_client.py | 79 ++ .../codesigning/_configuration.py | 71 ++ .../vendored_sdks/codesigning/_version.py | 9 + .../vendored_sdks/codesigning/aio/__init__.py | 10 + .../aio/_code_signing_management_client.py | 73 ++ .../codesigning/aio/_configuration.py | 67 ++ .../codesigning/aio/operations/__init__.py | 17 + .../_certificate_profile_operations.py | 393 ++++++++ .../_code_sign_account_operations.py | 441 +++++++++ .../codesigning/aio/operations/_operations.py | 105 +++ .../codesigning/models/__init__.py | 77 ++ .../_code_signing_management_client_enums.py | 67 ++ .../codesigning/models/_models.py | 707 ++++++++++++++ .../codesigning/models/_models_py3.py | 757 +++++++++++++++ .../codesigning/operations/__init__.py | 17 + .../_certificate_profile_operations.py | 402 ++++++++ .../_code_sign_account_operations.py | 451 +++++++++ .../codesigning/operations/_operations.py | 110 +++ .../vendored_sdks/codesigning/py.typed | 1 + src/codesigning/report.md | 200 ++++ src/codesigning/setup.cfg | 1 + src/codesigning/setup.py | 58 ++ 45 files changed, 5986 insertions(+) create mode 100644 src/codesigning/HISTORY.rst create mode 100644 src/codesigning/README.md create mode 100644 src/codesigning/azext_codesigning/__init__.py create mode 100644 src/codesigning/azext_codesigning/action.py create mode 100644 src/codesigning/azext_codesigning/azext_metadata.json create mode 100644 src/codesigning/azext_codesigning/custom.py create mode 100644 src/codesigning/azext_codesigning/generated/__init__.py create mode 100644 src/codesigning/azext_codesigning/generated/_client_factory.py create mode 100644 src/codesigning/azext_codesigning/generated/_help.py create mode 100644 src/codesigning/azext_codesigning/generated/_params.py create mode 100644 src/codesigning/azext_codesigning/generated/_validators.py create mode 100644 src/codesigning/azext_codesigning/generated/action.py create mode 100644 src/codesigning/azext_codesigning/generated/commands.py create mode 100644 src/codesigning/azext_codesigning/generated/custom.py create mode 100644 src/codesigning/azext_codesigning/manual/__init__.py create mode 100644 src/codesigning/azext_codesigning/tests/__init__.py create mode 100644 src/codesigning/azext_codesigning/tests/latest/__init__.py create mode 100644 src/codesigning/azext_codesigning/tests/latest/example_steps.py create mode 100644 src/codesigning/azext_codesigning/tests/latest/recordings/test_codesigning_Scenario.yaml create mode 100644 src/codesigning/azext_codesigning/tests/latest/test_codesigning_scenario.py create mode 100644 src/codesigning/azext_codesigning/tests/latest/test_codesigning_scenario_coverage.md create mode 100644 src/codesigning/azext_codesigning/vendored_sdks/__init__.py create mode 100644 src/codesigning/azext_codesigning/vendored_sdks/codesigning/__init__.py create mode 100644 src/codesigning/azext_codesigning/vendored_sdks/codesigning/_code_signing_management_client.py create mode 100644 src/codesigning/azext_codesigning/vendored_sdks/codesigning/_configuration.py create mode 100644 src/codesigning/azext_codesigning/vendored_sdks/codesigning/_version.py create mode 100644 src/codesigning/azext_codesigning/vendored_sdks/codesigning/aio/__init__.py create mode 100644 src/codesigning/azext_codesigning/vendored_sdks/codesigning/aio/_code_signing_management_client.py create mode 100644 src/codesigning/azext_codesigning/vendored_sdks/codesigning/aio/_configuration.py create mode 100644 src/codesigning/azext_codesigning/vendored_sdks/codesigning/aio/operations/__init__.py create mode 100644 src/codesigning/azext_codesigning/vendored_sdks/codesigning/aio/operations/_certificate_profile_operations.py create mode 100644 src/codesigning/azext_codesigning/vendored_sdks/codesigning/aio/operations/_code_sign_account_operations.py create mode 100644 src/codesigning/azext_codesigning/vendored_sdks/codesigning/aio/operations/_operations.py create mode 100644 src/codesigning/azext_codesigning/vendored_sdks/codesigning/models/__init__.py create mode 100644 src/codesigning/azext_codesigning/vendored_sdks/codesigning/models/_code_signing_management_client_enums.py create mode 100644 src/codesigning/azext_codesigning/vendored_sdks/codesigning/models/_models.py create mode 100644 src/codesigning/azext_codesigning/vendored_sdks/codesigning/models/_models_py3.py create mode 100644 src/codesigning/azext_codesigning/vendored_sdks/codesigning/operations/__init__.py create mode 100644 src/codesigning/azext_codesigning/vendored_sdks/codesigning/operations/_certificate_profile_operations.py create mode 100644 src/codesigning/azext_codesigning/vendored_sdks/codesigning/operations/_code_sign_account_operations.py create mode 100644 src/codesigning/azext_codesigning/vendored_sdks/codesigning/operations/_operations.py create mode 100644 src/codesigning/azext_codesigning/vendored_sdks/codesigning/py.typed create mode 100644 src/codesigning/report.md create mode 100644 src/codesigning/setup.cfg create mode 100644 src/codesigning/setup.py diff --git a/src/codesigning/HISTORY.rst b/src/codesigning/HISTORY.rst new file mode 100644 index 00000000000..1c139576ba0 --- /dev/null +++ b/src/codesigning/HISTORY.rst @@ -0,0 +1,8 @@ +.. :changelog: + +Release History +=============== + +0.1.0 +++++++ +* Initial release. diff --git a/src/codesigning/README.md b/src/codesigning/README.md new file mode 100644 index 00000000000..4e704eabeaf --- /dev/null +++ b/src/codesigning/README.md @@ -0,0 +1,53 @@ +# Azure CLI codesigning Extension # +This is the extension for codesigning + +### How to use ### +Install this extension using the below CLI command +``` +az extension add --name codesigning +``` + +### Included Features ### +#### codesigning #### +##### Create ##### +``` +az codesigning create --account-name "MyAccount" --location "eastus" --tags key1="value1" \ + --resource-group "MyResourceGroup" +``` +##### Show ##### +``` +az codesigning show --account-name "MyAccount" --resource-group "MyResourceGroup" +``` +##### List ##### +``` +az codesigning list --resource-group "MyResourceGroup" +``` +##### Update ##### +``` +az codesigning update --account-name "MyAccount" --tags key1="value1" --resource-group "MyResourceGroup" +``` +##### Delete ##### +``` +az codesigning delete --account-name "MyAccount" --resource-group "MyResourceGroup" +``` +#### codesigning certificate-profile #### +##### Create ##### +``` +az codesigning certificate-profile create --account-name "MyAccount" --profile-name "profileA" \ + --resource-group "MyResourceGroup" +``` +##### Show ##### +``` +az codesigning certificate-profile show --account-name "MyAccount" --profile-name "profileA" \ + --resource-group "MyResourceGroup" +``` +##### List ##### +``` +az codesigning certificate-profile list --account-name "MyAccount" --resource-group "MyResourceGroup" +``` +##### Delete ##### +``` +az codesigning certificate-profile delete --account-name "MyAccount" --profile-name "profileA" \ + --resource-group "MyResourceGroup" +``` +#### codesigning operation #### \ No newline at end of file diff --git a/src/codesigning/azext_codesigning/__init__.py b/src/codesigning/azext_codesigning/__init__.py new file mode 100644 index 00000000000..5ea9994ec54 --- /dev/null +++ b/src/codesigning/azext_codesigning/__init__.py @@ -0,0 +1,50 @@ +# -------------------------------------------------------------------------- +# 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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from azure.cli.core import AzCommandsLoader +from azext_codesigning.generated._help import helps # pylint: disable=unused-import +try: + from azext_codesigning.manual._help import helps # pylint: disable=reimported +except ImportError: + pass + + +class CodeSigningManagementClientCommandsLoader(AzCommandsLoader): + + def __init__(self, cli_ctx=None): + from azure.cli.core.commands import CliCommandType + from azext_codesigning.generated._client_factory import cf_codesigning_cl + codesigning_custom = CliCommandType( + operations_tmpl='azext_codesigning.custom#{}', + client_factory=cf_codesigning_cl) + parent = super(CodeSigningManagementClientCommandsLoader, self) + parent.__init__(cli_ctx=cli_ctx, custom_command_type=codesigning_custom) + + def load_command_table(self, args): + from azext_codesigning.generated.commands import load_command_table + load_command_table(self, args) + try: + from azext_codesigning.manual.commands import load_command_table as load_command_table_manual + load_command_table_manual(self, args) + except ImportError: + pass + return self.command_table + + def load_arguments(self, command): + from azext_codesigning.generated._params import load_arguments + load_arguments(self, command) + try: + from azext_codesigning.manual._params import load_arguments as load_arguments_manual + load_arguments_manual(self, command) + except ImportError: + pass + + +COMMAND_LOADER_CLS = CodeSigningManagementClientCommandsLoader diff --git a/src/codesigning/azext_codesigning/action.py b/src/codesigning/azext_codesigning/action.py new file mode 100644 index 00000000000..d95d53bf711 --- /dev/null +++ b/src/codesigning/azext_codesigning/action.py @@ -0,0 +1,17 @@ +# -------------------------------------------------------------------------- +# 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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wildcard-import +# pylint: disable=unused-wildcard-import + +from .generated.action import * # noqa: F403 +try: + from .manual.action import * # noqa: F403 +except ImportError: + pass diff --git a/src/codesigning/azext_codesigning/azext_metadata.json b/src/codesigning/azext_codesigning/azext_metadata.json new file mode 100644 index 00000000000..cfc30c747c7 --- /dev/null +++ b/src/codesigning/azext_codesigning/azext_metadata.json @@ -0,0 +1,4 @@ +{ + "azext.isExperimental": true, + "azext.minCliCoreVersion": "2.15.0" +} \ No newline at end of file diff --git a/src/codesigning/azext_codesigning/custom.py b/src/codesigning/azext_codesigning/custom.py new file mode 100644 index 00000000000..dbe9d5f9742 --- /dev/null +++ b/src/codesigning/azext_codesigning/custom.py @@ -0,0 +1,17 @@ +# -------------------------------------------------------------------------- +# 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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wildcard-import +# pylint: disable=unused-wildcard-import + +from .generated.custom import * # noqa: F403 +try: + from .manual.custom import * # noqa: F403 +except ImportError: + pass diff --git a/src/codesigning/azext_codesigning/generated/__init__.py b/src/codesigning/azext_codesigning/generated/__init__.py new file mode 100644 index 00000000000..c9cfdc73e77 --- /dev/null +++ b/src/codesigning/azext_codesigning/generated/__init__.py @@ -0,0 +1,12 @@ +# 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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +__path__ = __import__('pkgutil').extend_path(__path__, __name__) diff --git a/src/codesigning/azext_codesigning/generated/_client_factory.py b/src/codesigning/azext_codesigning/generated/_client_factory.py new file mode 100644 index 00000000000..8a92587fa43 --- /dev/null +++ b/src/codesigning/azext_codesigning/generated/_client_factory.py @@ -0,0 +1,28 @@ +# -------------------------------------------------------------------------- +# 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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + + +def cf_codesigning_cl(cli_ctx, *_): + from azure.cli.core.commands.client_factory import get_mgmt_service_client + from azext_codesigning.vendored_sdks.codesigning import CodeSigningManagementClient + return get_mgmt_service_client(cli_ctx, + CodeSigningManagementClient) + + +def cf_code_sign_account(cli_ctx, *_): + return cf_codesigning_cl(cli_ctx).code_sign_account + + +def cf_certificate_profile(cli_ctx, *_): + return cf_codesigning_cl(cli_ctx).certificate_profile + + +def cf_operation(cli_ctx, *_): + return cf_codesigning_cl(cli_ctx).operations diff --git a/src/codesigning/azext_codesigning/generated/_help.py b/src/codesigning/azext_codesigning/generated/_help.py new file mode 100644 index 00000000000..1d33eb286ad --- /dev/null +++ b/src/codesigning/azext_codesigning/generated/_help.py @@ -0,0 +1,128 @@ +# -------------------------------------------------------------------------- +# 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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=too-many-lines + +from knack.help_files import helps + + +helps['codesigning'] = """ + type: group + short-summary: Manage code sign account with codesigning +""" + +helps['codesigning list'] = """ + type: command + short-summary: "List Code Sign Accounts within a resource group And Lists Code Sign Accounts within a \ +subscription." + examples: + - name: List Code Sign Accounts by Resource Group + text: |- + az codesigning list --resource-group "MyResourceGroup" + - name: List Code Sign Accounts by Subscription + text: |- + az codesigning list +""" + +helps['codesigning show'] = """ + type: command + short-summary: "Get Code Sign Account." + examples: + - name: Get Code Sign Account + text: |- + az codesigning show --account-name "MyAccount" --resource-group "MyResourceGroup" +""" + +helps['codesigning create'] = """ + type: command + short-summary: "Create Code Sign Account." + examples: + - name: Create Code Sign Account + text: |- + az codesigning create --account-name "MyAccount" --location "eastus" --tags key1="value1" \ +--resource-group "MyResourceGroup" +""" + +helps['codesigning update'] = """ + type: command + short-summary: "Update a code sign account." + examples: + - name: Update Code Sign Account + text: |- + az codesigning update --account-name "MyAccount" --tags key1="value1" --resource-group \ +"MyResourceGroup" +""" + +helps['codesigning delete'] = """ + type: command + short-summary: "Delete a Code Sign Account." + examples: + - name: Delete Code Sign Account + text: |- + az codesigning delete --account-name "MyAccount" --resource-group "MyResourceGroup" +""" + +helps['codesigning certificate-profile'] = """ + type: group + short-summary: Manage certificate profile with codesigning +""" + +helps['codesigning certificate-profile list'] = """ + type: command + short-summary: "List certificate profiles within a code sign account." + examples: + - name: List Certificate Profiles + text: |- + az codesigning certificate-profile list --account-name "MyAccount" --resource-group "MyResourceGroup" +""" + +helps['codesigning certificate-profile show'] = """ + type: command + short-summary: "Get details of particular certificate profile." + examples: + - name: Get Certificate Profile + text: |- + az codesigning certificate-profile show --account-name "MyAccount" --profile-name "profileA" \ +--resource-group "MyResourceGroup" +""" + +helps['codesigning certificate-profile create'] = """ + type: command + short-summary: "Create a certificate profile." + examples: + - name: Create Certificate Profile + text: |- + az codesigning certificate-profile create --account-name "MyAccount" --profile-name "profileA" \ +--resource-group "MyResourceGroup" +""" + +helps['codesigning certificate-profile update'] = """ + type: command + short-summary: "Update certificate profile." +""" + +helps['codesigning certificate-profile delete'] = """ + type: command + short-summary: "Delete certificate profile." + examples: + - name: Delete Certificate Profile + text: |- + az codesigning certificate-profile delete --account-name "MyAccount" --profile-name "profileA" \ +--resource-group "MyResourceGroup" +""" + +helps['codesigning operation'] = """ + type: group + short-summary: Manage operation with codesigning +""" + +helps['codesigning operation show'] = """ + type: command + short-summary: "Lists all of the available API operations for code signing resource." +""" diff --git a/src/codesigning/azext_codesigning/generated/_params.py b/src/codesigning/azext_codesigning/generated/_params.py new file mode 100644 index 00000000000..4e5c2c09197 --- /dev/null +++ b/src/codesigning/azext_codesigning/generated/_params.py @@ -0,0 +1,90 @@ +# -------------------------------------------------------------------------- +# 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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=too-many-lines +# pylint: disable=too-many-statements + +from azure.cli.core.commands.parameters import ( + tags_type, + get_enum_type, + resource_group_name_type, + get_location_type +) +from azure.cli.core.commands.validators import get_default_location_from_resource_group + + +def load_arguments(self, _): + + with self.argument_context('codesigning list') as c: + c.argument('resource_group_name', resource_group_name_type) + + with self.argument_context('codesigning show') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('account_name', type=str, help='Code Sign account name', id_part='name') + + with self.argument_context('codesigning create') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('account_name', type=str, help='Code Sign account name') + c.argument('tags', tags_type) + c.argument('location', arg_type=get_location_type(self.cli_ctx), required=False, + validator=get_default_location_from_resource_group) + c.argument('code_sign_account_properties_account_name', type=str, help='') + c.argument('account_url', type=str, help='') + c.argument('verification_status', arg_type=get_enum_type(['Completed', 'InProgress', 'NotCompleted']), + help='The vetting status of the code sign account') + c.argument('provisioning_state', arg_type=get_enum_type(['Succeeded', 'Failed', 'Canceled', 'Provisioning', + 'Updating', 'Deleting', 'Accepted']), help='The ' + 'current provisioning state') + + with self.argument_context('codesigning update') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('account_name', type=str, help='Code Sign account name', id_part='name') + c.argument('tags', tags_type) + + with self.argument_context('codesigning delete') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('account_name', type=str, help='Code Sign account name', id_part='name') + + with self.argument_context('codesigning certificate-profile list') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('account_name', type=str, help='Code Sign account name') + + with self.argument_context('codesigning certificate-profile show') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('account_name', type=str, help='Code Sign account name', id_part='name') + c.argument('profile_name', type=str, help='Certificate profile name', id_part='child_name_1') + + with self.argument_context('codesigning certificate-profile create') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('account_name', type=str, help='Code Sign account name') + c.argument('profile_name', type=str, help='Certificate profile name') + c.argument('certificate_profile_properties_profile_name', type=str, help='') + c.argument('profile_type', arg_type=get_enum_type(['Test', 'Trial', 'PrivateTrust', 'PublicTrust']), help='') + c.argument('common_name', type=str, help='') + c.argument('subject_alternative_name', type=str, help='') + c.argument('provisioning_state', arg_type=get_enum_type(['Succeeded', 'Failed', 'Canceled', 'Provisioning', + 'Updating', 'Deleting', 'Accepted']), help='The ' + 'current provisioning state') + + with self.argument_context('codesigning certificate-profile update') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('account_name', type=str, help='Code Sign account name', id_part='name') + c.argument('profile_name', type=str, help='Certificate profile name', id_part='child_name_1') + c.argument('certificate_profile_properties_profile_name', type=str, help='', id_part='child_name_1') + c.argument('profile_type', arg_type=get_enum_type(['Test', 'Trial', 'PrivateTrust', 'PublicTrust']), help='') + c.argument('common_name', type=str, help='') + c.argument('subject_alternative_name', type=str, help='') + c.argument('provisioning_state', arg_type=get_enum_type(['Succeeded', 'Failed', 'Canceled', 'Provisioning', + 'Updating', 'Deleting', 'Accepted']), help='The ' + 'current provisioning state') + + with self.argument_context('codesigning certificate-profile delete') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('account_name', type=str, help='Code Sign account name', id_part='name') + c.argument('profile_name', type=str, help='Certificate profile name', id_part='child_name_1') diff --git a/src/codesigning/azext_codesigning/generated/_validators.py b/src/codesigning/azext_codesigning/generated/_validators.py new file mode 100644 index 00000000000..b33a44c1ebf --- /dev/null +++ b/src/codesigning/azext_codesigning/generated/_validators.py @@ -0,0 +1,9 @@ +# -------------------------------------------------------------------------- +# 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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- diff --git a/src/codesigning/azext_codesigning/generated/action.py b/src/codesigning/azext_codesigning/generated/action.py new file mode 100644 index 00000000000..b49bfaeeefe --- /dev/null +++ b/src/codesigning/azext_codesigning/generated/action.py @@ -0,0 +1,10 @@ +# -------------------------------------------------------------------------- +# 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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=protected-access diff --git a/src/codesigning/azext_codesigning/generated/commands.py b/src/codesigning/azext_codesigning/generated/commands.py new file mode 100644 index 00000000000..11ab76aec98 --- /dev/null +++ b/src/codesigning/azext_codesigning/generated/commands.py @@ -0,0 +1,49 @@ +# -------------------------------------------------------------------------- +# 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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=too-many-statements +# pylint: disable=too-many-locals + +from azure.cli.core.commands import CliCommandType + + +def load_command_table(self, _): + + from azext_codesigning.generated._client_factory import cf_code_sign_account + codesigning_code_sign_account = CliCommandType( + operations_tmpl='azext_codesigning.vendored_sdks.codesigning.operations._code_sign_account_operations#CodeSignA' + 'ccountOperations.{}', + client_factory=cf_code_sign_account) + with self.command_group('codesigning', codesigning_code_sign_account, client_factory=cf_code_sign_account, + is_experimental=True) as g: + g.custom_command('list', 'codesigning_list') + g.custom_show_command('show', 'codesigning_show') + g.custom_command('create', 'codesigning_create') + g.custom_command('update', 'codesigning_update') + g.custom_command('delete', 'codesigning_delete', confirmation=True) + + from azext_codesigning.generated._client_factory import cf_certificate_profile + codesigning_certificate_profile = CliCommandType( + operations_tmpl='azext_codesigning.vendored_sdks.codesigning.operations._certificate_profile_operations#Certifi' + 'cateProfileOperations.{}', + client_factory=cf_certificate_profile) + with self.command_group('codesigning certificate-profile', codesigning_certificate_profile, + client_factory=cf_certificate_profile) as g: + g.custom_command('list', 'codesigning_certificate_profile_list') + g.custom_show_command('show', 'codesigning_certificate_profile_show') + g.custom_command('create', 'codesigning_certificate_profile_create') + g.custom_command('update', 'codesigning_certificate_profile_update') + g.custom_command('delete', 'codesigning_certificate_profile_delete', confirmation=True) + + from azext_codesigning.generated._client_factory import cf_operation + codesigning_operation = CliCommandType( + operations_tmpl='azext_codesigning.vendored_sdks.codesigning.operations._operations_operations#Operations.{}', + client_factory=cf_operation) + with self.command_group('codesigning operation', codesigning_operation, client_factory=cf_operation) as g: + g.custom_show_command('show', 'codesigning_operation_show') diff --git a/src/codesigning/azext_codesigning/generated/custom.py b/src/codesigning/azext_codesigning/generated/custom.py new file mode 100644 index 00000000000..ea8193eba0e --- /dev/null +++ b/src/codesigning/azext_codesigning/generated/custom.py @@ -0,0 +1,136 @@ +# -------------------------------------------------------------------------- +# 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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=too-many-lines + + +def codesigning_list(client, + resource_group_name=None): + if resource_group_name: + return client.list_by_resource_group(resource_group_name=resource_group_name) + return client.list_by_subscription() + + +def codesigning_show(client, + resource_group_name, + account_name): + return client.get(resource_group_name=resource_group_name, + account_name=account_name) + + +def codesigning_create(client, + resource_group_name, + account_name, + tags=None, + location=None, + code_sign_account_properties_account_name=None, + account_url=None, + verification_status=None, + provisioning_state=None): + code_sign_account = {} + code_sign_account['tags'] = tags + code_sign_account['location'] = location + code_sign_account['account_name'] = code_sign_account_properties_account_name + code_sign_account['account_url'] = account_url + code_sign_account['verification_status'] = verification_status + code_sign_account['provisioning_state'] = provisioning_state + return client.create(resource_group_name=resource_group_name, + account_name=account_name, + code_sign_account=code_sign_account) + + +def codesigning_update(client, + resource_group_name, + account_name, + tags=None): + code_sign_account_patch = {} + code_sign_account_patch['tags'] = tags + return client.update(resource_group_name=resource_group_name, + account_name=account_name, + code_sign_account_patch=code_sign_account_patch) + + +def codesigning_delete(client, + resource_group_name, + account_name): + return client.delete(resource_group_name=resource_group_name, + account_name=account_name) + + +def codesigning_certificate_profile_list(client, + resource_group_name, + account_name): + return client.list_by_code_sign_account(resource_group_name=resource_group_name, + account_name=account_name) + + +def codesigning_certificate_profile_show(client, + resource_group_name, + account_name, + profile_name): + return client.get(resource_group_name=resource_group_name, + account_name=account_name, + profile_name=profile_name) + + +def codesigning_certificate_profile_create(client, + resource_group_name, + account_name, + profile_name, + certificate_profile_properties_profile_name=None, + profile_type=None, + common_name=None, + subject_alternative_name=None, + provisioning_state=None): + certificate_profile = {} + certificate_profile['profile_name'] = certificate_profile_properties_profile_name + certificate_profile['profile_type'] = profile_type + certificate_profile['rotation_policy'] = "Monthly" + certificate_profile['common_name'] = common_name + certificate_profile['subject_alternative_name'] = subject_alternative_name + certificate_profile['provisioning_state'] = provisioning_state + return client.create(resource_group_name=resource_group_name, + account_name=account_name, + profile_name=profile_name, + certificate_profile=certificate_profile) + + +def codesigning_certificate_profile_update(client, + resource_group_name, + account_name, + profile_name, + certificate_profile_properties_profile_name=None, + profile_type=None, + common_name=None, + subject_alternative_name=None, + provisioning_state=None): + certificate_profile = {} + certificate_profile['profile_name'] = certificate_profile_properties_profile_name + certificate_profile['profile_type'] = profile_type + certificate_profile['rotation_policy'] = "Monthly" + certificate_profile['common_name'] = common_name + certificate_profile['subject_alternative_name'] = subject_alternative_name + certificate_profile['provisioning_state'] = provisioning_state + return client.update(resource_group_name=resource_group_name, + account_name=account_name, + profile_name=profile_name, + certificate_profile=certificate_profile) + + +def codesigning_certificate_profile_delete(client, + resource_group_name, + account_name, + profile_name): + return client.delete(resource_group_name=resource_group_name, + account_name=account_name, + profile_name=profile_name) + + +def codesigning_operation_show(client): + return client.get() diff --git a/src/codesigning/azext_codesigning/manual/__init__.py b/src/codesigning/azext_codesigning/manual/__init__.py new file mode 100644 index 00000000000..c9cfdc73e77 --- /dev/null +++ b/src/codesigning/azext_codesigning/manual/__init__.py @@ -0,0 +1,12 @@ +# 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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +__path__ = __import__('pkgutil').extend_path(__path__, __name__) diff --git a/src/codesigning/azext_codesigning/tests/__init__.py b/src/codesigning/azext_codesigning/tests/__init__.py new file mode 100644 index 00000000000..70488e93851 --- /dev/null +++ b/src/codesigning/azext_codesigning/tests/__init__.py @@ -0,0 +1,116 @@ +# 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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- +import inspect +import logging +import os +import sys +import traceback +import datetime as dt + +from azure.core.exceptions import AzureError +from azure.cli.testsdk.exceptions import CliTestError, CliExecutionError, JMESPathCheckAssertionError + + +logger = logging.getLogger('azure.cli.testsdk') +logger.addHandler(logging.StreamHandler()) +__path__ = __import__('pkgutil').extend_path(__path__, __name__) +exceptions = [] +test_map = dict() +SUCCESSED = "successed" +FAILED = "failed" + + +def try_manual(func): + def import_manual_function(origin_func): + from importlib import import_module + decorated_path = inspect.getfile(origin_func).lower() + module_path = __path__[0].lower() + if not decorated_path.startswith(module_path): + raise Exception("Decorator can only be used in submodules!") + manual_path = os.path.join( + decorated_path[module_path.rfind(os.path.sep) + 1:]) + manual_file_path, manual_file_name = os.path.split(manual_path) + module_name, _ = os.path.splitext(manual_file_name) + manual_module = "..manual." + \ + ".".join(manual_file_path.split(os.path.sep) + [module_name, ]) + return getattr(import_module(manual_module, package=__name__), origin_func.__name__) + + def get_func_to_call(): + func_to_call = func + try: + func_to_call = import_manual_function(func) + logger.info("Found manual override for %s(...)", func.__name__) + except (ImportError, AttributeError): + pass + return func_to_call + + def wrapper(*args, **kwargs): + func_to_call = get_func_to_call() + logger.info("running %s()...", func.__name__) + try: + test_map[func.__name__] = dict() + test_map[func.__name__]["result"] = SUCCESSED + test_map[func.__name__]["error_message"] = "" + test_map[func.__name__]["error_stack"] = "" + test_map[func.__name__]["error_normalized"] = "" + test_map[func.__name__]["start_dt"] = dt.datetime.utcnow() + ret = func_to_call(*args, **kwargs) + except (AssertionError, AzureError, CliTestError, CliExecutionError, SystemExit, + JMESPathCheckAssertionError) as e: + use_exception_cache = os.getenv("TEST_EXCEPTION_CACHE") + if use_exception_cache is None or use_exception_cache.lower() != "true": + raise + test_map[func.__name__]["end_dt"] = dt.datetime.utcnow() + test_map[func.__name__]["result"] = FAILED + test_map[func.__name__]["error_message"] = str(e).replace("\r\n", " ").replace("\n", " ")[:500] + test_map[func.__name__]["error_stack"] = traceback.format_exc().replace( + "\r\n", " ").replace("\n", " ")[:500] + logger.info("--------------------------------------") + logger.info("step exception: %s", e) + logger.error("--------------------------------------") + logger.error("step exception in %s: %s", func.__name__, e) + logger.info(traceback.format_exc()) + exceptions.append((func.__name__, sys.exc_info())) + else: + test_map[func.__name__]["end_dt"] = dt.datetime.utcnow() + return ret + + if inspect.isclass(func): + return get_func_to_call() + return wrapper + + +def calc_coverage(filename): + filename = filename.split(".")[0] + coverage_name = filename + "_coverage.md" + with open(coverage_name, "w") as f: + f.write("|Scenario|Result|ErrorMessage|ErrorStack|ErrorNormalized|StartDt|EndDt|\n") + total = len(test_map) + covered = 0 + for k, v in test_map.items(): + if not k.startswith("step_"): + total -= 1 + continue + if v["result"] == SUCCESSED: + covered += 1 + f.write("|{step_name}|{result}|{error_message}|{error_stack}|{error_normalized}|{start_dt}|" + "{end_dt}|\n".format(step_name=k, **v)) + f.write("Coverage: {}/{}\n".format(covered, total)) + print("Create coverage\n", file=sys.stderr) + + +def raise_if(): + if exceptions: + if len(exceptions) <= 1: + raise exceptions[0][1][1] + message = "{}\nFollowed with exceptions in other steps:\n".format(str(exceptions[0][1][1])) + message += "\n".join(["{}: {}".format(h[0], h[1][1]) for h in exceptions[1:]]) + raise exceptions[0][1][0](message).with_traceback(exceptions[0][1][2]) diff --git a/src/codesigning/azext_codesigning/tests/latest/__init__.py b/src/codesigning/azext_codesigning/tests/latest/__init__.py new file mode 100644 index 00000000000..c9cfdc73e77 --- /dev/null +++ b/src/codesigning/azext_codesigning/tests/latest/__init__.py @@ -0,0 +1,12 @@ +# 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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +__path__ = __import__('pkgutil').extend_path(__path__, __name__) diff --git a/src/codesigning/azext_codesigning/tests/latest/example_steps.py b/src/codesigning/azext_codesigning/tests/latest/example_steps.py new file mode 100644 index 00000000000..4cb3b09eb3c --- /dev/null +++ b/src/codesigning/azext_codesigning/tests/latest/example_steps.py @@ -0,0 +1,126 @@ +# -------------------------------------------------------------------------- +# 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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + + +from .. import try_manual + + +# EXAMPLE: /CertificateProfile/put/Create Certificate Profile +@try_manual +def step_certificate_profile_create(test, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az codesigning certificate-profile create ' + '--account-name "MyAccount" ' + '--profile-name "profileA" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /CertificateProfile/get/Get Certificate Profile +@try_manual +def step_certificate_profile_show(test, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az codesigning certificate-profile show ' + '--account-name "MyAccount" ' + '--profile-name "profileA" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /CertificateProfile/get/List Certificate Profiles +@try_manual +def step_certificate_profile_list(test, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az codesigning certificate-profile list ' + '--account-name "MyAccount" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /CertificateProfile/delete/Delete Certificate Profile +@try_manual +def step_certificate_profile_delete(test, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az codesigning certificate-profile delete -y ' + '--account-name "MyAccount" ' + '--profile-name "profileA" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /CodeSignAccount/put/Create Code Sign Account +@try_manual +def step_create(test, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az codesigning create ' + '--account-name "MyAccount" ' + '--location "eastus" ' + '--tags key1="value1" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /CodeSignAccount/get/Get Code Sign Account +@try_manual +def step_show(test, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az codesigning show ' + '--account-name "MyAccount" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /CodeSignAccount/get/List Code Sign Accounts by Resource Group +@try_manual +def step_list(test, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az codesigning list ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /CodeSignAccount/get/List Code Sign Accounts by Subscription +@try_manual +def step_list2(test, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az codesigning list ' + '-g ""', + checks=checks) + + +# EXAMPLE: /CodeSignAccount/patch/Update Code Sign Account +@try_manual +def step_update(test, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az codesigning update ' + '--account-name "MyAccount" ' + '--tags key1="value1" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /CodeSignAccount/delete/Delete Code Sign Account +@try_manual +def step_delete(test, rg, checks=None): + if checks is None: + checks = [] + test.cmd('az codesigning delete -y ' + '--account-name "MyAccount" ' + '--resource-group "{rg}"', + checks=checks) diff --git a/src/codesigning/azext_codesigning/tests/latest/recordings/test_codesigning_Scenario.yaml b/src/codesigning/azext_codesigning/tests/latest/recordings/test_codesigning_Scenario.yaml new file mode 100644 index 00000000000..6ed860832c2 --- /dev/null +++ b/src/codesigning/azext_codesigning/tests/latest/recordings/test_codesigning_Scenario.yaml @@ -0,0 +1,884 @@ +interactions: +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Charset: + - utf-8 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python-requests/2.22.0 + return-client-request-id: + - 'true' + x-client-CPU: + - x64 + x-client-OS: + - win32 + x-client-SKU: + - Python + x-client-Ver: + - 1.2.3 + method: GET + uri: https://login.microsoftonline.com/common/discovery/instance?authorization_endpoint=https%3A%2F%2Flogin.windows-ppe.net%2F8c0f0bff-5806-4d21-8802-ebe21a1afa4f%2Foauth2%2Fauthorize&api-version=1.0 + response: + body: + string: '{"tenant_discovery_endpoint":"https://login.windows-ppe.net/8c0f0bff-5806-4d21-8802-ebe21a1afa4f/.well-known/openid-configuration"}' + headers: + access-control-allow-methods: + - GET, OPTIONS + access-control-allow-origin: + - '*' + cache-control: + - max-age=86400, private + content-length: + - '131' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 05 Mar 2021 15:03:20 GMT + p3p: + - CP="DSP CUR OTPi IND OTRi ONL FIN" + set-cookie: + - fpc=AgJKcLNYhlhIls8c1QxHDIs; expires=Sun, 04-Apr-2021 15:03:20 GMT; path=/; + secure; HttpOnly; SameSite=None + - esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrgEOuOTGAZ7QopelHweDkky0OOq1mgsLXeahrjTq1Oeu4dc1Z8uWDTMAszUnT_CkZ58zWF9gbPeweVYDVt55L6apLDSCClfaW5c-T-cJHzZf5ltM7WmvTLfhASJoPQvAZf9FNwLZqOxcdN8D2-GsSYJaszzS19UlqoEIQsdqy9m4gAA; + domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None + - x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly + - stsservicecookie=estsfd; path=/; secure; samesite=none; httponly + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ests-server: + - 2.1.11530.15 - KRSLR2 ProdSlices + status: + code: 200 + message: OK +- request: + body: '{"tags": {"key1": "value1"}, "location": "eastus"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - codesigning create + Connection: + - keep-alive + Content-Length: + - '50' + Content-Type: + - application/json + ParameterSetName: + - --account-name --location --tags --resource-group + User-Agent: + - AZURECLI/2.17.1 azsdk-python-mgmt-codesigning/0.1.0 Python/3.7.9 (Windows-10-10.0.19041-SP0) + method: PUT + uri: https://api-dogfood.resources.windows-int.net/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.CodeSigning/codeSignAccounts/MyAccount?api-version=2020-12-14-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.CodeSigning/codeSignAccounts/MyAccount","name":"MyAccount","type":"Microsoft.CodeSigning/codeSignAccounts","location":"eastus","tags":{"key1":"value1"},"systemData":{"createdBy":"billtest124476@outlook.com","createdByType":"User","createdAt":"2021-03-05T15:03:25.0197596Z","lastModifiedBy":"billtest124476@outlook.com","lastModifiedByType":"User","lastModifiedAt":"2021-03-05T15:03:25.0197596Z"},"properties":{"accountName":"MyAccount","accountUrl":null,"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '657' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 05 Mar 2021 15:03:27 GMT + etag: + - '"df00765e-0000-0700-0000-6042483f0000"' + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:c73a5c90-b6dd-400a-b5e1-6c06fd162b47 + server: + - Kestrel + set-cookie: + - ARRAffinity=684b4944ceab4636e2b792fe6045b6c7d40594baa8d10298f020586a9d3181da;Path=/;HttpOnly;Secure;Domain=codesigning-userrp-ppe.azurewebsites.net + - ARRAffinitySameSite=684b4944ceab4636e2b792fe6045b6c7d40594baa8d10298f020586a9d3181da;Path=/;HttpOnly;SameSite=None;Secure;Domain=codesigning-userrp-ppe.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Charset: + - utf-8 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python-requests/2.22.0 + return-client-request-id: + - 'true' + x-client-CPU: + - x64 + x-client-OS: + - win32 + x-client-SKU: + - Python + x-client-Ver: + - 1.2.3 + method: GET + uri: https://login.microsoftonline.com/common/discovery/instance?authorization_endpoint=https%3A%2F%2Flogin.windows-ppe.net%2F8c0f0bff-5806-4d21-8802-ebe21a1afa4f%2Foauth2%2Fauthorize&api-version=1.0 + response: + body: + string: '{"tenant_discovery_endpoint":"https://login.windows-ppe.net/8c0f0bff-5806-4d21-8802-ebe21a1afa4f/.well-known/openid-configuration"}' + headers: + access-control-allow-methods: + - GET, OPTIONS + access-control-allow-origin: + - '*' + cache-control: + - max-age=86400, private + content-length: + - '131' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 05 Mar 2021 15:03:28 GMT + p3p: + - CP="DSP CUR OTPi IND OTRi ONL FIN" + set-cookie: + - fpc=As5niDM-ZX5IpgUawFtIdZg; expires=Sun, 04-Apr-2021 15:03:28 GMT; path=/; + secure; HttpOnly; SameSite=None + - esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevroG9Bdz4ZtOtAh7ROqWEYuMG3dZwJvpvQMmkY-i3tHL0gWbGXpkGilNpaR7Zgm91QG70-gZBqes6UthL0wtC5_97obSm12JPTGO3mDkEAHKJHmDJr4t4emkWKDoLSOUM4BNRaBm62PLhjuF0C2NcxGiOvv2Dt-dLGpTkyo94Mdr4gAA; + domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None + - x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly + - stsservicecookie=estsfd; path=/; secure; samesite=none; httponly + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ests-server: + - 2.1.11530.15 - SEASLR2 ProdSlices + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - codesigning show + Connection: + - keep-alive + ParameterSetName: + - --account-name --resource-group + User-Agent: + - AZURECLI/2.17.1 azsdk-python-mgmt-codesigning/0.1.0 Python/3.7.9 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://api-dogfood.resources.windows-int.net/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.CodeSigning/codeSignAccounts/MyAccount?api-version=2020-12-14-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.CodeSigning/codeSignAccounts/MyAccount","name":"MyAccount","type":"Microsoft.CodeSigning/codeSignAccounts","location":"eastus","tags":{"key1":"value1"},"systemData":{"createdBy":"billtest124476@outlook.com","createdByType":"User","createdAt":"2021-03-05T15:03:25.0197596Z","lastModifiedBy":"billtest124476@outlook.com","lastModifiedByType":"User","lastModifiedAt":"2021-03-05T15:03:25.0197596Z"},"properties":{"accountName":"MyAccount","accountUrl":null,"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '657' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 05 Mar 2021 15:03:29 GMT + etag: + - '"df00765e-0000-0700-0000-6042483f0000"' + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Charset: + - utf-8 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python-requests/2.22.0 + return-client-request-id: + - 'true' + x-client-CPU: + - x64 + x-client-OS: + - win32 + x-client-SKU: + - Python + x-client-Ver: + - 1.2.3 + method: GET + uri: https://login.microsoftonline.com/common/discovery/instance?authorization_endpoint=https%3A%2F%2Flogin.windows-ppe.net%2F8c0f0bff-5806-4d21-8802-ebe21a1afa4f%2Foauth2%2Fauthorize&api-version=1.0 + response: + body: + string: '{"tenant_discovery_endpoint":"https://login.windows-ppe.net/8c0f0bff-5806-4d21-8802-ebe21a1afa4f/.well-known/openid-configuration"}' + headers: + access-control-allow-methods: + - GET, OPTIONS + access-control-allow-origin: + - '*' + cache-control: + - max-age=86400, private + content-length: + - '131' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 05 Mar 2021 15:03:29 GMT + p3p: + - CP="DSP CUR OTPi IND OTRi ONL FIN" + set-cookie: + - fpc=AvyKw9IswodElM6YI_X-Oo4; expires=Sun, 04-Apr-2021 15:03:30 GMT; path=/; + secure; HttpOnly; SameSite=None + - esctx=AQABAAAAAAD--DLA3VO7QrddgJg7Wevrrj3W5uYNdjZbIEXuRv5wZoe0k6r84lZ-Gpv8vdq6Mk962_a5WBpPuEXkZflBLKlWAebERTUrEBZg4RQuoX0HeSLiLfY1AKSJzNr6_0NYA6Kp-oIAIlhqFU8VmJ_EiTMpsmlf-yHRneItXhaMD0LAtuJQ4fqtPp0Jt6-CQs_153cgAA; + domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None + - x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly + - stsservicecookie=estsfd; path=/; secure; samesite=none; httponly + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ests-server: + - 2.1.11530.15 - KRSLR2 ProdSlices + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - codesigning list + Connection: + - keep-alive + ParameterSetName: + - --resource-group + User-Agent: + - AZURECLI/2.17.1 azsdk-python-mgmt-codesigning/0.1.0 Python/3.7.9 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://api-dogfood.resources.windows-int.net/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.CodeSigning/codeSignAccounts?api-version=2020-12-14-preview + response: + body: + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.CodeSigning/codeSignAccounts/MyAccount","name":"MyAccount","type":"Microsoft.CodeSigning/codeSignAccounts","location":"eastus","tags":{"key1":"value1"},"systemData":{"createdBy":"billtest124476@outlook.com","createdByType":"User","createdAt":"2021-03-05T15:03:25.0197596Z","lastModifiedBy":"billtest124476@outlook.com","lastModifiedByType":"User","lastModifiedAt":"2021-03-05T15:03:25.0197596Z"},"properties":{"accountName":"MyAccount","accountUrl":null,"provisioningState":"Succeeded"}}]}' + headers: + cache-control: + - no-cache + content-length: + - '669' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 05 Mar 2021 15:03:31 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-original-request-ids: + - d649d12a-adec-4a10-b2c0-d7459ed6484f + - 89b58c4f-1e33-4f5f-b204-11c360797d73 + - b87a8c69-2cdf-4b4b-a946-f686cf85286b + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Charset: + - utf-8 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python-requests/2.22.0 + return-client-request-id: + - 'true' + x-client-CPU: + - x64 + x-client-OS: + - win32 + x-client-SKU: + - Python + x-client-Ver: + - 1.2.3 + method: GET + uri: https://login.microsoftonline.com/common/discovery/instance?authorization_endpoint=https%3A%2F%2Flogin.windows-ppe.net%2F8c0f0bff-5806-4d21-8802-ebe21a1afa4f%2Foauth2%2Fauthorize&api-version=1.0 + response: + body: + string: '{"tenant_discovery_endpoint":"https://login.windows-ppe.net/8c0f0bff-5806-4d21-8802-ebe21a1afa4f/.well-known/openid-configuration"}' + headers: + access-control-allow-methods: + - GET, OPTIONS + access-control-allow-origin: + - '*' + cache-control: + - max-age=86400, private + content-length: + - '131' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 05 Mar 2021 15:03:31 GMT + p3p: + - CP="DSP CUR OTPi IND OTRi ONL FIN" + set-cookie: + - fpc=AjY2Qge5GbBBq414Lk6-c3g; expires=Sun, 04-Apr-2021 15:03:31 GMT; path=/; + secure; HttpOnly; SameSite=None + - esctx=AQABAAAAAAD--DLA3VO7QrddgJg7Wevrdr8sz5orvWOM3VvWofB_0z6OK5Tyrep0jZBY-s5D6Mok9G-7FDiBn-YACioxWepSfvlNQWKurQqzdgeevlWeuFcYt9VSCjH5qwxQF_QvzAh-696rO6i79yShBYQz-V34IaRM5O7EAz9XwzhiW6tfprtRdpq00QfYjVQOSV1ycwYgAA; + domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None + - x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly + - stsservicecookie=estsfd; path=/; secure; samesite=none; httponly + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ests-server: + - 2.1.11513.17 - KRSLR1 ProdSlices + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - codesigning list + Connection: + - keep-alive + ParameterSetName: + - -g + User-Agent: + - AZURECLI/2.17.1 azsdk-python-mgmt-codesigning/0.1.0 Python/3.7.9 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://api-dogfood.resources.windows-int.net/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CodeSigning/codeSignAccounts?api-version=2020-12-14-preview + response: + body: + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/dogfoodRG/providers/Microsoft.CodeSigning/codeSignAccounts/Test1","name":"Test1","type":"Microsoft.CodeSigning/codeSignAccounts","location":"eastus","systemData":{"createdBy":"billtest124476@outlook.com","createdByType":"User","createdAt":"2021-01-05T12:24:35.1626638Z","lastModifiedBy":"billtest124476@outlook.com","lastModifiedByType":"User","lastModifiedAt":"2021-01-05T12:37:29.1978003Z"},"properties":{"provisioningState":"Succeeded"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/dogfoodRG/providers/Microsoft.CodeSigning/codeSignAccounts/Vishi1","name":"Vishi1","type":"Microsoft.CodeSigning/codeSignAccounts","location":"eastus","systemData":{"createdBy":"billtest124476@outlook.com","createdByType":"User","createdAt":"2021-01-12T11:27:13.5985295Z","lastModifiedBy":"billtest124476@outlook.com","lastModifiedByType":"User","lastModifiedAt":"2021-01-12T11:27:13.5985295Z"},"properties":{"accountName":"Vishi1","provisioningState":"Succeeded"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/dogfoodRG/providers/Microsoft.CodeSigning/codeSignAccounts/csaCli2","name":"csaCli2","type":"Microsoft.CodeSigning/codeSignAccounts","location":"eastus","systemData":{"createdBy":"billtest124476@outlook.com","createdByType":"User","createdAt":"2021-01-19T07:08:10.6124865Z","lastModifiedBy":"billtest124476@outlook.com","lastModifiedByType":"User","lastModifiedAt":"2021-01-19T07:08:10.6124865Z"},"properties":{"accountName":null,"provisioningState":"Succeeded"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/amritaRG/providers/Microsoft.CodeSigning/codeSignAccounts/acc100","name":"acc100","type":"Microsoft.CodeSigning/codeSignAccounts","location":"eastus","systemData":{"createdBy":"billtest124476@outlook.com","createdByType":"User","createdAt":"2021-03-04T06:11:47.0605817Z","lastModifiedBy":"billtest124476@outlook.com","lastModifiedByType":"User","lastModifiedAt":"2021-03-04T06:11:47.0605817Z"},"properties":{"accountName":"acc100","accountUrl":null,"provisioningState":"Succeeded"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/demo2/providers/Microsoft.CodeSigning/codeSignAccounts/account1","name":"account1","type":"Microsoft.CodeSigning/codeSignAccounts","location":"eastus","systemData":{"createdBy":"Test1@billtest124476outlook.ccsctp.net","createdByType":"User","createdAt":"2021-03-04T07:54:17.9029536Z","lastModifiedBy":"Test1@billtest124476outlook.ccsctp.net","lastModifiedByType":"User","lastModifiedAt":"2021-03-04T07:54:17.9029536Z"},"properties":{"accountName":"account1","accountUrl":null,"provisioningState":"Succeeded"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/demo1/providers/Microsoft.CodeSigning/codeSignAccounts/account1","name":"account1","type":"Microsoft.CodeSigning/codeSignAccounts","location":"eastus","systemData":{"createdBy":"billtest124476@outlook.com","createdByType":"User","createdAt":"2021-03-04T09:20:03.1101648Z","lastModifiedBy":"billtest124476@outlook.com","lastModifiedByType":"User","lastModifiedAt":"2021-03-04T09:20:03.1101648Z"},"properties":{"accountName":"account1","accountUrl":null,"provisioningState":"Succeeded"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/amritaRG/providers/Microsoft.CodeSigning/codeSignAccounts/account1","name":"account1","type":"Microsoft.CodeSigning/codeSignAccounts","location":"eastus","systemData":{"createdBy":"billtest124476@outlook.com","createdByType":"User","createdAt":"2021-03-04T09:57:17.4666379Z","lastModifiedBy":"billtest124476@outlook.com","lastModifiedByType":"User","lastModifiedAt":"2021-03-04T09:57:17.4666379Z"},"properties":{"accountName":"account1","accountUrl":null,"provisioningState":"Succeeded"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/amritaRG/providers/Microsoft.CodeSigning/codeSignAccounts/acc101","name":"acc101","type":"Microsoft.CodeSigning/codeSignAccounts","location":"eastus","systemData":{"createdBy":"billtest124476@outlook.com","createdByType":"User","createdAt":"2021-03-05T04:01:20.0447626Z","lastModifiedBy":"billtest124476@outlook.com","lastModifiedByType":"User","lastModifiedAt":"2021-03-05T04:01:20.0447626Z"},"properties":{"accountName":"acc101","accountUrl":null,"provisioningState":"Succeeded"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.CodeSigning/codeSignAccounts/MyAccount","name":"MyAccount","type":"Microsoft.CodeSigning/codeSignAccounts","location":"eastus","tags":{"key1":"value1"},"systemData":{"createdBy":"billtest124476@outlook.com","createdByType":"User","createdAt":"2021-03-05T15:03:25.0197596Z","lastModifiedBy":"billtest124476@outlook.com","lastModifiedByType":"User","lastModifiedAt":"2021-03-05T15:03:25.0197596Z"},"properties":{"accountName":"MyAccount","accountUrl":null,"provisioningState":"Succeeded"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/dogfoodRG/providers/Microsoft.CodeSigning/codeSignAccounts/Vishi2","name":"Vishi2","type":"Microsoft.CodeSigning/codeSignAccounts","location":"westus","systemData":{"createdBy":"billtest124476@outlook.com","createdByType":"User","createdAt":"2021-01-13T07:48:17.6792347Z","lastModifiedBy":"billtest124476@outlook.com","lastModifiedByType":"User","lastModifiedAt":"2021-01-13T07:48:17.6792347Z"},"properties":{"accountName":"Vishi2","provisioningState":"Succeeded"}}]}' + headers: + cache-control: + - no-cache + content-length: + - '5623' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 05 Mar 2021 15:03:32 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-original-request-ids: + - fc06db8b-2551-4f6f-be6d-d90f824e03f1 + - 667fa782-c043-47e6-a04f-ce90e4303e42 + - 0e688acd-baeb-46a8-a0af-4c72317f9778 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Charset: + - utf-8 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python-requests/2.22.0 + return-client-request-id: + - 'true' + x-client-CPU: + - x64 + x-client-OS: + - win32 + x-client-SKU: + - Python + x-client-Ver: + - 1.2.3 + method: GET + uri: https://login.microsoftonline.com/common/discovery/instance?authorization_endpoint=https%3A%2F%2Flogin.windows-ppe.net%2F8c0f0bff-5806-4d21-8802-ebe21a1afa4f%2Foauth2%2Fauthorize&api-version=1.0 + response: + body: + string: '{"tenant_discovery_endpoint":"https://login.windows-ppe.net/8c0f0bff-5806-4d21-8802-ebe21a1afa4f/.well-known/openid-configuration"}' + headers: + access-control-allow-methods: + - GET, OPTIONS + access-control-allow-origin: + - '*' + cache-control: + - max-age=86400, private + content-length: + - '131' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 05 Mar 2021 15:03:31 GMT + p3p: + - CP="DSP CUR OTPi IND OTRi ONL FIN" + set-cookie: + - fpc=AjXLYIuie5pGs0Ipp_awvJ4; expires=Sun, 04-Apr-2021 15:03:32 GMT; path=/; + secure; HttpOnly; SameSite=None + - esctx=AQABAAAAAAD--DLA3VO7QrddgJg7Wevrfj7DEt0aqgB1s2TGpHXLG_r4D8TJVWkMdXGUhzo_-7zl2SkLy_ZkrxhxK7TNRf_qb1Y30CbxseUQCqDjNaXgZhG8LugeuAbTe9AfONyeT3lVyiKi37HFub789uOjopDQP5VUn-6FWN8_EoKA5C3Credd3Te7p24gDd93-XlaxQIgAA; + domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None + - x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly + - stsservicecookie=estsfd; path=/; secure; samesite=none; httponly + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ests-server: + - 2.1.11530.15 - SEASLR2 ProdSlices + status: + code: 200 + message: OK +- request: + body: '{"tags": {"key1": "value1"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - codesigning update + Connection: + - keep-alive + Content-Length: + - '28' + Content-Type: + - application/json + ParameterSetName: + - --account-name --tags --resource-group + User-Agent: + - AZURECLI/2.17.1 azsdk-python-mgmt-codesigning/0.1.0 Python/3.7.9 (Windows-10-10.0.19041-SP0) + method: PATCH + uri: https://api-dogfood.resources.windows-int.net/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.CodeSigning/codeSignAccounts/MyAccount?api-version=2020-12-14-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.CodeSigning/codeSignAccounts/MyAccount","name":"MyAccount","type":"Microsoft.CodeSigning/codeSignAccounts","location":"eastus","tags":{"key1":"value1"},"systemData":{"createdBy":"billtest124476@outlook.com","createdByType":"User","createdAt":"2021-03-05T15:03:25.0197596Z","lastModifiedBy":"billtest124476@outlook.com","lastModifiedByType":"User","lastModifiedAt":"2021-03-05T15:03:34.4481263Z"},"properties":{"accountName":"MyAccount","accountUrl":null,"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '657' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 05 Mar 2021 15:03:36 GMT + etag: + - '"df00985e-0000-0700-0000-604248460000"' + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Charset: + - utf-8 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python-requests/2.22.0 + return-client-request-id: + - 'true' + x-client-CPU: + - x64 + x-client-OS: + - win32 + x-client-SKU: + - Python + x-client-Ver: + - 1.2.3 + method: GET + uri: https://login.microsoftonline.com/common/discovery/instance?authorization_endpoint=https%3A%2F%2Flogin.windows-ppe.net%2F8c0f0bff-5806-4d21-8802-ebe21a1afa4f%2Foauth2%2Fauthorize&api-version=1.0 + response: + body: + string: '{"tenant_discovery_endpoint":"https://login.windows-ppe.net/8c0f0bff-5806-4d21-8802-ebe21a1afa4f/.well-known/openid-configuration"}' + headers: + access-control-allow-methods: + - GET, OPTIONS + access-control-allow-origin: + - '*' + cache-control: + - max-age=86400, private + content-length: + - '131' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 05 Mar 2021 15:03:36 GMT + p3p: + - CP="DSP CUR OTPi IND OTRi ONL FIN" + set-cookie: + - fpc=AudgpuKODTtOuR51UimVoP8; expires=Sun, 04-Apr-2021 15:03:36 GMT; path=/; + secure; HttpOnly; SameSite=None + - esctx=AQABAAAAAAD--DLA3VO7QrddgJg7Wevr86Nse4kCXMu3OV07AyAFTYVRDzAzrxUOgswkyj4yL4vtGSPOh5DckNId54BSxG7L8gVYQXnzSSkTStml5-Up_EqMz-3IGNTJ_a-33jkBKQXB1Sq-iXT3V4rzdodka94QZgQKH-vnWBSxwTikbCNsYd7PM8Gy4DcAwrg5an4cwQMgAA; + domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None + - x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly + - stsservicecookie=estsfd; path=/; secure; samesite=none; httponly + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ests-server: + - 2.1.11530.15 - KRSLR2 ProdSlices + status: + code: 200 + message: OK +- request: + body: '{"properties": {"rotationPolicy": "Monthly"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - codesigning certificate-profile create + Connection: + - keep-alive + Content-Length: + - '45' + Content-Type: + - application/json + ParameterSetName: + - --account-name --profile-name --resource-group + User-Agent: + - AZURECLI/2.17.1 azsdk-python-mgmt-codesigning/0.1.0 Python/3.7.9 (Windows-10-10.0.19041-SP0) + method: PUT + uri: https://api-dogfood.resources.windows-int.net/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.CodeSigning/codeSignAccounts/MyAccount/certificateProfiles/profileA?api-version=2020-12-14-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.CodeSigning/codeSignAccounts/MyAccount/certificateProfiles/profileA","name":"profileA","type":"Microsoft.CodeSigning/codeSignAccounts/certificateProfiles","systemData":{"createdBy":"billtest124476@outlook.com","createdByType":"User","createdAt":"2021-03-05T15:03:37.8791151Z","lastModifiedBy":"billtest124476@outlook.com","lastModifiedByType":"User","lastModifiedAt":"2021-03-05T15:03:37.8791151Z"},"properties":{"profileName":"profileA","authority":null,"commonName":null,"organization":null,"subjectAlternativeName":null,"streetAddress":null,"country":null,"state":null,"city":null,"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '787' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 05 Mar 2021 15:03:38 GMT + etag: + - '"20022f42-0000-0700-0000-6042484a0000"' + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:c73a5c90-b6dd-400a-b5e1-6c06fd162b47 + server: + - Kestrel + set-cookie: + - ARRAffinity=684b4944ceab4636e2b792fe6045b6c7d40594baa8d10298f020586a9d3181da;Path=/;HttpOnly;Secure;Domain=codesigning-userrp-ppe.azurewebsites.net + - ARRAffinitySameSite=684b4944ceab4636e2b792fe6045b6c7d40594baa8d10298f020586a9d3181da;Path=/;HttpOnly;SameSite=None;Secure;Domain=codesigning-userrp-ppe.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Charset: + - utf-8 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python-requests/2.22.0 + return-client-request-id: + - 'true' + x-client-CPU: + - x64 + x-client-OS: + - win32 + x-client-SKU: + - Python + x-client-Ver: + - 1.2.3 + method: GET + uri: https://login.microsoftonline.com/common/discovery/instance?authorization_endpoint=https%3A%2F%2Flogin.windows-ppe.net%2F8c0f0bff-5806-4d21-8802-ebe21a1afa4f%2Foauth2%2Fauthorize&api-version=1.0 + response: + body: + string: '{"tenant_discovery_endpoint":"https://login.windows-ppe.net/8c0f0bff-5806-4d21-8802-ebe21a1afa4f/.well-known/openid-configuration"}' + headers: + access-control-allow-methods: + - GET, OPTIONS + access-control-allow-origin: + - '*' + cache-control: + - max-age=86400, private + content-length: + - '131' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 05 Mar 2021 15:03:39 GMT + p3p: + - CP="DSP CUR OTPi IND OTRi ONL FIN" + set-cookie: + - fpc=ArykUEVLcpxEhWMwe9DaYxs; expires=Sun, 04-Apr-2021 15:03:39 GMT; path=/; + secure; HttpOnly; SameSite=None + - esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrsA5bRmNwlzL9o0MS4T5P95Uv0_inYYm8VSJj4sWvEiYHVWugA6I2RZfWH61KmUJjXOQKRc2jQ4So7atF1M-NEv4hIqeTzZ4iT_Y6jr2aHDKOMPwxGVxM47E-KsM2QuL8QHIkq0YD1dBaD5sIjvT8YHoPo0jRYHEyNQItoPqQDscgAA; + domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None + - x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly + - stsservicecookie=estsfd; path=/; secure; samesite=none; httponly + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ests-server: + - 2.1.11530.15 - KRSLR1 ProdSlices + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - codesigning certificate-profile show + Connection: + - keep-alive + ParameterSetName: + - --account-name --profile-name --resource-group + User-Agent: + - AZURECLI/2.17.1 azsdk-python-mgmt-codesigning/0.1.0 Python/3.7.9 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://api-dogfood.resources.windows-int.net/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.CodeSigning/codeSignAccounts/MyAccount/certificateProfiles/profileA?api-version=2020-12-14-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.CodeSigning/codeSignAccounts/MyAccount/certificateProfiles/profileA","name":"profileA","type":"Microsoft.CodeSigning/codeSignAccounts/certificateProfiles","systemData":{"createdBy":"billtest124476@outlook.com","createdByType":"User","createdAt":"2021-03-05T15:03:37.8791151Z","lastModifiedBy":"billtest124476@outlook.com","lastModifiedByType":"User","lastModifiedAt":"2021-03-05T15:03:37.8791151Z"},"properties":{"profileName":"profileA","authority":null,"commonName":null,"organization":null,"subjectAlternativeName":null,"streetAddress":null,"country":null,"state":null,"city":null,"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '787' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 05 Mar 2021 15:03:40 GMT + etag: + - '"20022f42-0000-0700-0000-6042484a0000"' + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Charset: + - utf-8 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python-requests/2.22.0 + return-client-request-id: + - 'true' + x-client-CPU: + - x64 + x-client-OS: + - win32 + x-client-SKU: + - Python + x-client-Ver: + - 1.2.3 + method: GET + uri: https://login.microsoftonline.com/common/discovery/instance?authorization_endpoint=https%3A%2F%2Flogin.windows-ppe.net%2F8c0f0bff-5806-4d21-8802-ebe21a1afa4f%2Foauth2%2Fauthorize&api-version=1.0 + response: + body: + string: '{"tenant_discovery_endpoint":"https://login.windows-ppe.net/8c0f0bff-5806-4d21-8802-ebe21a1afa4f/.well-known/openid-configuration"}' + headers: + access-control-allow-methods: + - GET, OPTIONS + access-control-allow-origin: + - '*' + cache-control: + - max-age=86400, private + content-length: + - '131' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 05 Mar 2021 15:03:40 GMT + p3p: + - CP="DSP CUR OTPi IND OTRi ONL FIN" + set-cookie: + - fpc=Atyocg2IVZdHiT46s8Y9RM0; expires=Sun, 04-Apr-2021 15:03:41 GMT; path=/; + secure; HttpOnly; SameSite=None + - esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrT9juzNXZwb7gAoghd03NWxQ4RTgz17BZ_ysVy8fNBbzTZwv3YNtGaCoIKqzFbSuYH85vW3NFAyftivMX-aoBsr_HrkR0r9bufWMz8jilc7VMKyjPRv8Egv-ixBBj0zYLnJnD_a75xn_Vp9lfaoTIAiC32gd1-BcfkYzuNT6_I0AgAA; + domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None + - x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly + - stsservicecookie=estsfd; path=/; secure; samesite=none; httponly + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ests-server: + - 2.1.11530.15 - SEASLR2 ProdSlices + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - codesigning certificate-profile list + Connection: + - keep-alive + ParameterSetName: + - --account-name --resource-group + User-Agent: + - AZURECLI/2.17.1 azsdk-python-mgmt-codesigning/0.1.0 Python/3.7.9 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://api-dogfood.resources.windows-int.net/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.CodeSigning/codeSignAccounts/MyAccount/certificateProfiles?api-version=2020-12-14-preview + response: + body: + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.CodeSigning/codeSignAccounts/MyAccount/certificateProfiles/profileA","name":"profileA","type":"Microsoft.CodeSigning/codeSignAccounts/certificateProfiles","systemData":{"createdBy":"billtest124476@outlook.com","createdByType":"User","createdAt":"2021-03-05T15:03:37.8791151Z","lastModifiedBy":"billtest124476@outlook.com","lastModifiedByType":"User","lastModifiedAt":"2021-03-05T15:03:37.8791151Z"},"properties":{"profileName":"profileA","authority":null,"commonName":null,"organization":null,"subjectAlternativeName":null,"streetAddress":null,"country":null,"state":null,"city":null,"provisioningState":"Succeeded"}}]}' + headers: + cache-control: + - no-cache + content-length: + - '799' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 05 Mar 2021 15:03:41 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +version: 1 diff --git a/src/codesigning/azext_codesigning/tests/latest/test_codesigning_scenario.py b/src/codesigning/azext_codesigning/tests/latest/test_codesigning_scenario.py new file mode 100644 index 00000000000..d71628a7021 --- /dev/null +++ b/src/codesigning/azext_codesigning/tests/latest/test_codesigning_scenario.py @@ -0,0 +1,71 @@ +# -------------------------------------------------------------------------- +# 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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import os +from azure.cli.testsdk import ScenarioTest +from azure.cli.testsdk import ResourceGroupPreparer +from .example_steps import step_create +from .example_steps import step_show +from .example_steps import step_list +from .example_steps import step_list2 +from .example_steps import step_update +from .example_steps import step_certificate_profile_create +from .example_steps import step_certificate_profile_show +from .example_steps import step_certificate_profile_list +from .. import ( + try_manual, + raise_if, + calc_coverage +) + + +TEST_DIR = os.path.abspath(os.path.join(os.path.abspath(__file__), '..')) + + +# Env setup_scenario +@try_manual +def setup_scenario(test, rg): + pass + + +# Env cleanup_scenario +@try_manual +def cleanup_scenario(test, rg): + pass + + +# Testcase: Scenario +@try_manual +def call_scenario(test, rg): + setup_scenario(test, rg) + step_create(test, rg, checks=[]) + step_show(test, rg, checks=[]) + step_list(test, rg, checks=[]) + step_list2(test, rg, checks=[]) + step_update(test, rg, checks=[]) + step_certificate_profile_create(test, rg, checks=[]) + step_certificate_profile_show(test, rg, checks=[]) + step_certificate_profile_list(test, rg, checks=[]) + cleanup_scenario(test, rg) + + +# Test class for Scenario +@try_manual +class CodesigningScenarioTest(ScenarioTest): + + def __init__(self, *args, **kwargs): + super(CodesigningScenarioTest, self).__init__(*args, **kwargs) + + +@ResourceGroupPreparer(name_prefix='clitestcodesigning_MyResourceGroup'[:7], key='rg', parameter_name='rg') +def test_codesigning_Scenario(self, rg): + call_scenario(self, rg) + calc_coverage(__file__) + raise_if() diff --git a/src/codesigning/azext_codesigning/tests/latest/test_codesigning_scenario_coverage.md b/src/codesigning/azext_codesigning/tests/latest/test_codesigning_scenario_coverage.md new file mode 100644 index 00000000000..d2ac25f77ae --- /dev/null +++ b/src/codesigning/azext_codesigning/tests/latest/test_codesigning_scenario_coverage.md @@ -0,0 +1,10 @@ +|Scenario|Result|ErrorMessage|ErrorStack|ErrorNormalized|StartDt|EndDt| +|step_create|successed||||2021-03-05 15:03:20.335232|2021-03-05 15:03:28.686646| +|step_show|successed||||2021-03-05 15:03:28.687115|2021-03-05 15:03:29.862280| +|step_list|successed||||2021-03-05 15:03:29.862280|2021-03-05 15:03:31.436550| +|step_list2|successed||||2021-03-05 15:03:31.436550|2021-03-05 15:03:32.569104| +|step_update|successed||||2021-03-05 15:03:32.570060|2021-03-05 15:03:36.611778| +|step_certificate_profile_create|successed||||2021-03-05 15:03:36.612833|2021-03-05 15:03:39.180930| +|step_certificate_profile_show|successed||||2021-03-05 15:03:39.181644|2021-03-05 15:03:41.009973| +|step_certificate_profile_list|successed||||2021-03-05 15:03:41.009973|2021-03-05 15:03:42.127071| +Coverage: 8/8 diff --git a/src/codesigning/azext_codesigning/vendored_sdks/__init__.py b/src/codesigning/azext_codesigning/vendored_sdks/__init__.py new file mode 100644 index 00000000000..c9cfdc73e77 --- /dev/null +++ b/src/codesigning/azext_codesigning/vendored_sdks/__init__.py @@ -0,0 +1,12 @@ +# 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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +__path__ = __import__('pkgutil').extend_path(__path__, __name__) diff --git a/src/codesigning/azext_codesigning/vendored_sdks/codesigning/__init__.py b/src/codesigning/azext_codesigning/vendored_sdks/codesigning/__init__.py new file mode 100644 index 00000000000..0bad1040fb8 --- /dev/null +++ b/src/codesigning/azext_codesigning/vendored_sdks/codesigning/__init__.py @@ -0,0 +1,19 @@ +# 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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._code_signing_management_client import CodeSigningManagementClient +from ._version import VERSION + +__version__ = VERSION +__all__ = ['CodeSigningManagementClient'] + +try: + from ._patch import patch_sdk # type: ignore + patch_sdk() +except ImportError: + pass diff --git a/src/codesigning/azext_codesigning/vendored_sdks/codesigning/_code_signing_management_client.py b/src/codesigning/azext_codesigning/vendored_sdks/codesigning/_code_signing_management_client.py new file mode 100644 index 00000000000..42ab80922ff --- /dev/null +++ b/src/codesigning/azext_codesigning/vendored_sdks/codesigning/_code_signing_management_client.py @@ -0,0 +1,79 @@ +# 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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import TYPE_CHECKING + +from azure.mgmt.core import ARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Optional + + from azure.core.credentials import TokenCredential + +from ._configuration import CodeSigningManagementClientConfiguration +from .operations import CodeSignAccountOperations +from .operations import CertificateProfileOperations +from .operations import Operations +from . import models + + +class CodeSigningManagementClient(object): + """Code Sign Resource Provider Account and CertificateProfile management API. + + :ivar code_sign_account: CodeSignAccountOperations operations + :vartype code_sign_account: azure.mgmt.codesigning.operations.CodeSignAccountOperations + :ivar certificate_profile: CertificateProfileOperations operations + :vartype certificate_profile: azure.mgmt.codesigning.operations.CertificateProfileOperations + :ivar operations: Operations operations + :vartype operations: azure.mgmt.codesigning.operations.Operations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: The ID of the subscription to which the CodeSign account is registered. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + base_url=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> None + if not base_url: + base_url = 'https://management.azure.com' + self._config = CodeSigningManagementClientConfiguration(credential, 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._serialize.client_side_validation = False + self._deserialize = Deserializer(client_models) + + self.code_sign_account = CodeSignAccountOperations( + self._client, self._config, self._serialize, self._deserialize) + self.certificate_profile = CertificateProfileOperations( + self._client, self._config, self._serialize, self._deserialize) + self.operations = Operations( + self._client, self._config, self._serialize, self._deserialize) + + def close(self): + # type: () -> None + self._client.close() + + def __enter__(self): + # type: () -> CodeSigningManagementClient + self._client.__enter__() + return self + + def __exit__(self, *exc_details): + # type: (Any) -> None + self._client.__exit__(*exc_details) diff --git a/src/codesigning/azext_codesigning/vendored_sdks/codesigning/_configuration.py b/src/codesigning/azext_codesigning/vendored_sdks/codesigning/_configuration.py new file mode 100644 index 00000000000..6ddc7bde15b --- /dev/null +++ b/src/codesigning/azext_codesigning/vendored_sdks/codesigning/_configuration.py @@ -0,0 +1,71 @@ +# 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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +from ._version import VERSION + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any + + from azure.core.credentials import TokenCredential + + +class CodeSigningManagementClientConfiguration(Configuration): + """Configuration for CodeSigningManagementClient. + + 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. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: The ID of the subscription to which the CodeSign account is registered. + :type subscription_id: str + """ + + def __init__( + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + super(CodeSigningManagementClientConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = "2020-12-14-preview" + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'mgmt-codesigning/{}'.format(VERSION)) + self._configure(**kwargs) + + def _configure( + 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') + if self.credential and not self.authentication_policy: + self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/src/codesigning/azext_codesigning/vendored_sdks/codesigning/_version.py b/src/codesigning/azext_codesigning/vendored_sdks/codesigning/_version.py new file mode 100644 index 00000000000..eae7c95b6fb --- /dev/null +++ b/src/codesigning/azext_codesigning/vendored_sdks/codesigning/_version.py @@ -0,0 +1,9 @@ +# 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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +VERSION = "0.1.0" diff --git a/src/codesigning/azext_codesigning/vendored_sdks/codesigning/aio/__init__.py b/src/codesigning/azext_codesigning/vendored_sdks/codesigning/aio/__init__.py new file mode 100644 index 00000000000..8c7bd4e02df --- /dev/null +++ b/src/codesigning/azext_codesigning/vendored_sdks/codesigning/aio/__init__.py @@ -0,0 +1,10 @@ +# 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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._code_signing_management_client import CodeSigningManagementClient +__all__ = ['CodeSigningManagementClient'] diff --git a/src/codesigning/azext_codesigning/vendored_sdks/codesigning/aio/_code_signing_management_client.py b/src/codesigning/azext_codesigning/vendored_sdks/codesigning/aio/_code_signing_management_client.py new file mode 100644 index 00000000000..ce6d7779147 --- /dev/null +++ b/src/codesigning/azext_codesigning/vendored_sdks/codesigning/aio/_code_signing_management_client.py @@ -0,0 +1,73 @@ +# 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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, Optional, TYPE_CHECKING + +from azure.mgmt.core import AsyncARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +from ._configuration import CodeSigningManagementClientConfiguration +from .operations import CodeSignAccountOperations +from .operations import CertificateProfileOperations +from .operations import Operations +from .. import models + + +class CodeSigningManagementClient(object): + """Code Sign Resource Provider Account and CertificateProfile management API. + + :ivar code_sign_account: CodeSignAccountOperations operations + :vartype code_sign_account: azure.mgmt.codesigning.aio.operations.CodeSignAccountOperations + :ivar certificate_profile: CertificateProfileOperations operations + :vartype certificate_profile: azure.mgmt.codesigning.aio.operations.CertificateProfileOperations + :ivar operations: Operations operations + :vartype operations: azure.mgmt.codesigning.aio.operations.Operations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: The ID of the subscription to which the CodeSign account is registered. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + base_url: Optional[str] = None, + **kwargs: Any + ) -> None: + if not base_url: + base_url = 'https://management.azure.com' + self._config = CodeSigningManagementClientConfiguration(credential, subscription_id, **kwargs) + self._client = AsyncARMPipelineClient(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._serialize.client_side_validation = False + self._deserialize = Deserializer(client_models) + + self.code_sign_account = CodeSignAccountOperations( + self._client, self._config, self._serialize, self._deserialize) + self.certificate_profile = CertificateProfileOperations( + self._client, self._config, self._serialize, self._deserialize) + self.operations = Operations( + self._client, self._config, self._serialize, self._deserialize) + + async def close(self) -> None: + await self._client.close() + + async def __aenter__(self) -> "CodeSigningManagementClient": + await self._client.__aenter__() + return self + + async def __aexit__(self, *exc_details) -> None: + await self._client.__aexit__(*exc_details) diff --git a/src/codesigning/azext_codesigning/vendored_sdks/codesigning/aio/_configuration.py b/src/codesigning/azext_codesigning/vendored_sdks/codesigning/aio/_configuration.py new file mode 100644 index 00000000000..187bb63b2db --- /dev/null +++ b/src/codesigning/azext_codesigning/vendored_sdks/codesigning/aio/_configuration.py @@ -0,0 +1,67 @@ +# 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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +from .._version import VERSION + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + + +class CodeSigningManagementClientConfiguration(Configuration): + """Configuration for CodeSigningManagementClient. + + 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. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: The ID of the subscription to which the CodeSign account is registered. + :type subscription_id: str + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + **kwargs: Any + ) -> None: + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + super(CodeSigningManagementClientConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = "2020-12-14-preview" + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'mgmt-codesigning/{}'.format(VERSION)) + self._configure(**kwargs) + + def _configure( + self, + **kwargs: Any + ) -> 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.AsyncRetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get('authentication_policy') + if self.credential and not self.authentication_policy: + self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/src/codesigning/azext_codesigning/vendored_sdks/codesigning/aio/operations/__init__.py b/src/codesigning/azext_codesigning/vendored_sdks/codesigning/aio/operations/__init__.py new file mode 100644 index 00000000000..b4b2e783f7d --- /dev/null +++ b/src/codesigning/azext_codesigning/vendored_sdks/codesigning/aio/operations/__init__.py @@ -0,0 +1,17 @@ +# 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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._code_sign_account_operations import CodeSignAccountOperations +from ._certificate_profile_operations import CertificateProfileOperations +from ._operations import Operations + +__all__ = [ + 'CodeSignAccountOperations', + 'CertificateProfileOperations', + 'Operations', +] diff --git a/src/codesigning/azext_codesigning/vendored_sdks/codesigning/aio/operations/_certificate_profile_operations.py b/src/codesigning/azext_codesigning/vendored_sdks/codesigning/aio/operations/_certificate_profile_operations.py new file mode 100644 index 00000000000..89f3df523d4 --- /dev/null +++ b/src/codesigning/azext_codesigning/vendored_sdks/codesigning/aio/operations/_certificate_profile_operations.py @@ -0,0 +1,393 @@ +# 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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class CertificateProfileOperations: + """CertificateProfileOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.codesigning.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_code_sign_account( + self, + resource_group_name: str, + account_name: str, + **kwargs + ) -> AsyncIterable["models.CertificateProfiles"]: + """List certificate profiles within a code sign account. + + :param resource_group_name: The name of the resource group under which Code Sign Account is + registered. + :type resource_group_name: str + :param account_name: Code Sign account name. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either CertificateProfiles or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.codesigning.models.CertificateProfiles] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.CertificateProfiles"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-14-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_code_sign_account.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('CertificateProfiles', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_code_sign_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSignAccounts/{accountName}/certificateProfiles'} # type: ignore + + async def get( + self, + resource_group_name: str, + account_name: str, + profile_name: str, + **kwargs + ) -> "models.CertificateProfile": + """Get details of particular certificate profile. + + :param resource_group_name: The name of the resource group under which Code Sign Account is + registered. + :type resource_group_name: str + :param account_name: Code Sign account name. + :type account_name: str + :param profile_name: Certificate profile name. + :type profile_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CertificateProfile, or the result of cls(response) + :rtype: ~azure.mgmt.codesigning.models.CertificateProfile + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.CertificateProfile"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-14-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CertificateProfile', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSignAccounts/{accountName}/certificateProfiles/{profileName}'} # type: ignore + + async def create( + self, + resource_group_name: str, + account_name: str, + profile_name: str, + certificate_profile: Optional["models.CertificateProfile"] = None, + **kwargs + ) -> "models.CertificateProfile": + """Create a certificate profile. + + :param resource_group_name: The name of the resource group under which Code Sign Account is + registered. + :type resource_group_name: str + :param account_name: Code Sign account name. + :type account_name: str + :param profile_name: Certificate profile name. + :type profile_name: str + :param certificate_profile: + :type certificate_profile: ~azure.mgmt.codesigning.models.CertificateProfile + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CertificateProfile, or the result of cls(response) + :rtype: ~azure.mgmt.codesigning.models.CertificateProfile + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.CertificateProfile"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-14-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + if certificate_profile is not None: + body_content = self._serialize.body(certificate_profile, 'CertificateProfile') + else: + body_content = None + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CertificateProfile', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSignAccounts/{accountName}/certificateProfiles/{profileName}'} # type: ignore + + async def update( + self, + resource_group_name: str, + account_name: str, + profile_name: str, + certificate_profile: Optional["models.CertificateProfile"] = None, + **kwargs + ) -> "models.CertificateProfile": + """Update certificate profile. + + :param resource_group_name: The name of the resource group under which Code Sign Account is + registered. + :type resource_group_name: str + :param account_name: Code Sign account name. + :type account_name: str + :param profile_name: Certificate profile name. + :type profile_name: str + :param certificate_profile: + :type certificate_profile: ~azure.mgmt.codesigning.models.CertificateProfile + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CertificateProfile, or the result of cls(response) + :rtype: ~azure.mgmt.codesigning.models.CertificateProfile + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.CertificateProfile"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-14-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + if certificate_profile is not None: + body_content = self._serialize.body(certificate_profile, 'CertificateProfile') + else: + body_content = None + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CertificateProfile', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSignAccounts/{accountName}/certificateProfiles/{profileName}'} # type: ignore + + async def delete( + self, + resource_group_name: str, + account_name: str, + profile_name: str, + **kwargs + ) -> None: + """Delete certificate profile. + + :param resource_group_name: The name of the resource group under which Code Sign Account is + registered. + :type resource_group_name: str + :param account_name: Code Sign account name. + :type account_name: str + :param profile_name: Certificate profile name. + :type profile_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-14-preview" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSignAccounts/{accountName}/certificateProfiles/{profileName}'} # type: ignore diff --git a/src/codesigning/azext_codesigning/vendored_sdks/codesigning/aio/operations/_code_sign_account_operations.py b/src/codesigning/azext_codesigning/vendored_sdks/codesigning/aio/operations/_code_sign_account_operations.py new file mode 100644 index 00000000000..5d536d89e0a --- /dev/null +++ b/src/codesigning/azext_codesigning/vendored_sdks/codesigning/aio/operations/_code_sign_account_operations.py @@ -0,0 +1,441 @@ +# 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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class CodeSignAccountOperations: + """CodeSignAccountOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.codesigning.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_subscription( + self, + **kwargs + ) -> AsyncIterable["models.CodeSignAccounts"]: + """Lists Code Sign Accounts within a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either CodeSignAccounts or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.codesigning.models.CodeSignAccounts] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.CodeSignAccounts"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-14-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_subscription.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('CodeSignAccounts', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.CodeSigning/codeSignAccounts'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["models.CodeSignAccounts"]: + """List Code Sign Accounts within a resource group. + + :param resource_group_name: The name of the resource group under which Code Sign Account is + registered. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either CodeSignAccounts or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.codesigning.models.CodeSignAccounts] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.CodeSignAccounts"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-14-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('CodeSignAccounts', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSignAccounts'} # type: ignore + + async def get( + self, + resource_group_name: str, + account_name: str, + **kwargs + ) -> "models.CodeSignAccount": + """Get Code Sign Account. + + :param resource_group_name: The name of the resource group under which Code Sign Account is + registered. + :type resource_group_name: str + :param account_name: Code Sign account name. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CodeSignAccount, or the result of cls(response) + :rtype: ~azure.mgmt.codesigning.models.CodeSignAccount + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.CodeSignAccount"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-14-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CodeSignAccount', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSignAccounts/{accountName}'} # type: ignore + + async def create( + self, + resource_group_name: str, + account_name: str, + code_sign_account: Optional["models.CodeSignAccount"] = None, + **kwargs + ) -> "models.CodeSignAccount": + """Create Code Sign Account. + + :param resource_group_name: The name of the resource group under which Code Sign Account is + registered. + :type resource_group_name: str + :param account_name: Code Sign account name. + :type account_name: str + :param code_sign_account: + :type code_sign_account: ~azure.mgmt.codesigning.models.CodeSignAccount + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CodeSignAccount, or the result of cls(response) + :rtype: ~azure.mgmt.codesigning.models.CodeSignAccount + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.CodeSignAccount"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-14-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + if code_sign_account is not None: + body_content = self._serialize.body(code_sign_account, 'CodeSignAccount') + else: + body_content = None + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('CodeSignAccount', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('CodeSignAccount', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSignAccounts/{accountName}'} # type: ignore + + async def update( + self, + resource_group_name: str, + account_name: str, + code_sign_account_patch: "models.CodeSignAccountPatch", + **kwargs + ) -> "models.CodeSignAccount": + """Update a code sign account. + + :param resource_group_name: The name of the resource group under which Code Sign Account is + registered. + :type resource_group_name: str + :param account_name: Code Sign account name. + :type account_name: str + :param code_sign_account_patch: + :type code_sign_account_patch: ~azure.mgmt.codesigning.models.CodeSignAccountPatch + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CodeSignAccount, or the result of cls(response) + :rtype: ~azure.mgmt.codesigning.models.CodeSignAccount + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.CodeSignAccount"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-14-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(code_sign_account_patch, 'CodeSignAccountPatch') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CodeSignAccount', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSignAccounts/{accountName}'} # type: ignore + + async def delete( + self, + resource_group_name: str, + account_name: str, + **kwargs + ) -> None: + """Delete a Code Sign Account. + + :param resource_group_name: The name of the resource group under which Code Sign Account is + registered. + :type resource_group_name: str + :param account_name: Code Sign account name. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-14-preview" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSignAccounts/{accountName}'} # type: ignore diff --git a/src/codesigning/azext_codesigning/vendored_sdks/codesigning/aio/operations/_operations.py b/src/codesigning/azext_codesigning/vendored_sdks/codesigning/aio/operations/_operations.py new file mode 100644 index 00000000000..17d51edc7de --- /dev/null +++ b/src/codesigning/azext_codesigning/vendored_sdks/codesigning/aio/operations/_operations.py @@ -0,0 +1,105 @@ +# 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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class Operations: + """Operations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.codesigning.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def get( + self, + **kwargs + ) -> AsyncIterable["models.OperationList"]: + """Lists all of the available API operations for code signing resource. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either OperationList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.codesigning.models.OperationList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.OperationList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-14-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.get.metadata['url'] # type: ignore + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('OperationList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + get.metadata = {'url': '/providers/Microsoft.CodeSigning/operations'} # type: ignore diff --git a/src/codesigning/azext_codesigning/vendored_sdks/codesigning/models/__init__.py b/src/codesigning/azext_codesigning/vendored_sdks/codesigning/models/__init__.py new file mode 100644 index 00000000000..d98c3535e19 --- /dev/null +++ b/src/codesigning/azext_codesigning/vendored_sdks/codesigning/models/__init__.py @@ -0,0 +1,77 @@ +# 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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +try: + from ._models_py3 import Certificate + from ._models_py3 import CertificateProfile + from ._models_py3 import CertificateProfiles + from ._models_py3 import CertificateProperties + from ._models_py3 import CodeSignAccount + from ._models_py3 import CodeSignAccountPatch + from ._models_py3 import CodeSignAccounts + from ._models_py3 import ErrorAdditionalInfo + from ._models_py3 import ErrorDetail + from ._models_py3 import ErrorResponse + from ._models_py3 import Operation + from ._models_py3 import OperationDisplay + from ._models_py3 import OperationList + from ._models_py3 import ProxyResource + from ._models_py3 import Resource + from ._models_py3 import SystemData + from ._models_py3 import TrackedResource +except (SyntaxError, ImportError): + from ._models import Certificate # type: ignore + from ._models import CertificateProfile # type: ignore + from ._models import CertificateProfiles # type: ignore + from ._models import CertificateProperties # type: ignore + from ._models import CodeSignAccount # type: ignore + from ._models import CodeSignAccountPatch # type: ignore + from ._models import CodeSignAccounts # type: ignore + from ._models import ErrorAdditionalInfo # type: ignore + from ._models import ErrorDetail # type: ignore + from ._models import ErrorResponse # type: ignore + from ._models import Operation # type: ignore + from ._models import OperationDisplay # type: ignore + from ._models import OperationList # type: ignore + from ._models import ProxyResource # type: ignore + from ._models import Resource # type: ignore + from ._models import SystemData # type: ignore + from ._models import TrackedResource # type: ignore + +from ._code_signing_management_client_enums import ( + CreatedByType, + ProfileType, + ProvisioningState, + RotationPolicy, + VerificationStatus, +) + +__all__ = [ + 'Certificate', + 'CertificateProfile', + 'CertificateProfiles', + 'CertificateProperties', + 'CodeSignAccount', + 'CodeSignAccountPatch', + 'CodeSignAccounts', + 'ErrorAdditionalInfo', + 'ErrorDetail', + 'ErrorResponse', + 'Operation', + 'OperationDisplay', + 'OperationList', + 'ProxyResource', + 'Resource', + 'SystemData', + 'TrackedResource', + 'CreatedByType', + 'ProfileType', + 'ProvisioningState', + 'RotationPolicy', + 'VerificationStatus', +] diff --git a/src/codesigning/azext_codesigning/vendored_sdks/codesigning/models/_code_signing_management_client_enums.py b/src/codesigning/azext_codesigning/vendored_sdks/codesigning/models/_code_signing_management_client_enums.py new file mode 100644 index 00000000000..407de056460 --- /dev/null +++ b/src/codesigning/azext_codesigning/vendored_sdks/codesigning/models/_code_signing_management_client_enums.py @@ -0,0 +1,67 @@ +# 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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from enum import Enum, EnumMeta +from six import with_metaclass + +class _CaseInsensitiveEnumMeta(EnumMeta): + def __getitem__(self, name): + return super().__getitem__(name.upper()) + + def __getattr__(cls, name): + """Return the enum member matching `name` + We use __getattr__ instead of descriptors or inserting into the enum + class' __dict__ in order to support `name` and `value` being both + properties for enum members (which live in the class' __dict__) and + enum members themselves. + """ + try: + return cls._member_map_[name.upper()] + except KeyError: + raise AttributeError(name) + + +class CreatedByType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The type of identity that created the resource. + """ + + USER = "User" + APPLICATION = "Application" + MANAGED_IDENTITY = "ManagedIdentity" + KEY = "Key" + +class ProfileType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + TEST = "Test" + TRIAL = "Trial" + PRIVATE_TRUST = "PrivateTrust" + PUBLIC_TRUST = "PublicTrust" + +class ProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The current provisioning state + """ + + SUCCEEDED = "Succeeded" + FAILED = "Failed" + CANCELED = "Canceled" + PROVISIONING = "Provisioning" + UPDATING = "Updating" + DELETING = "Deleting" + ACCEPTED = "Accepted" + +class RotationPolicy(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + MONTHLY = "Monthly" + +class VerificationStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The vetting status of the code sign account + """ + + COMPLETED = "Completed" + IN_PROGRESS = "InProgress" + NOT_COMPLETED = "NotCompleted" diff --git a/src/codesigning/azext_codesigning/vendored_sdks/codesigning/models/_models.py b/src/codesigning/azext_codesigning/vendored_sdks/codesigning/models/_models.py new file mode 100644 index 00000000000..b9eb50e7e64 --- /dev/null +++ b/src/codesigning/azext_codesigning/vendored_sdks/codesigning/models/_models.py @@ -0,0 +1,707 @@ +# 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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.core.exceptions import HttpResponseError +import msrest.serialization + + +class CertificateProperties(msrest.serialization.Model): + """Certificate properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: + :vartype id: str + :ivar subject_name: + :vartype subject_name: str + :ivar subject_alternative_name: + :vartype subject_alternative_name: str + :ivar thumbprint: + :vartype thumbprint: str + :ivar created_date: + :vartype created_date: str + :ivar expiry_date: + :vartype expiry_date: str + """ + + _validation = { + 'id': {'readonly': True}, + 'subject_name': {'readonly': True}, + 'subject_alternative_name': {'readonly': True}, + 'thumbprint': {'readonly': True}, + 'created_date': {'readonly': True}, + 'expiry_date': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'subject_name': {'key': 'subjectName', 'type': 'str'}, + 'subject_alternative_name': {'key': 'subjectAlternativeName', 'type': 'str'}, + 'thumbprint': {'key': 'thumbprint', 'type': 'str'}, + 'created_date': {'key': 'createdDate', 'type': 'str'}, + 'expiry_date': {'key': 'expiryDate', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CertificateProperties, self).__init__(**kwargs) + self.id = None + self.subject_name = None + self.subject_alternative_name = None + self.thumbprint = None + self.created_date = None + self.expiry_date = None + + +class Certificate(CertificateProperties): + """Certificate. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: + :vartype id: str + :ivar subject_name: + :vartype subject_name: str + :ivar subject_alternative_name: + :vartype subject_alternative_name: str + :ivar thumbprint: + :vartype thumbprint: str + :ivar created_date: + :vartype created_date: str + :ivar expiry_date: + :vartype expiry_date: str + :ivar id_properties_id: + :vartype id_properties_id: str + :ivar subject_name_properties_subject_name: + :vartype subject_name_properties_subject_name: str + :ivar subject_alternative_name_properties_subject_alternative_name: + :vartype subject_alternative_name_properties_subject_alternative_name: str + :ivar thumbprint_properties_thumbprint: + :vartype thumbprint_properties_thumbprint: str + :ivar created_date_properties_created_date: + :vartype created_date_properties_created_date: str + :ivar expiry_date_properties_expiry_date: + :vartype expiry_date_properties_expiry_date: str + """ + + _validation = { + 'id': {'readonly': True}, + 'subject_name': {'readonly': True}, + 'subject_alternative_name': {'readonly': True}, + 'thumbprint': {'readonly': True}, + 'created_date': {'readonly': True}, + 'expiry_date': {'readonly': True}, + 'id_properties_id': {'readonly': True}, + 'subject_name_properties_subject_name': {'readonly': True}, + 'subject_alternative_name_properties_subject_alternative_name': {'readonly': True}, + 'thumbprint_properties_thumbprint': {'readonly': True}, + 'created_date_properties_created_date': {'readonly': True}, + 'expiry_date_properties_expiry_date': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'subject_name': {'key': 'subjectName', 'type': 'str'}, + 'subject_alternative_name': {'key': 'subjectAlternativeName', 'type': 'str'}, + 'thumbprint': {'key': 'thumbprint', 'type': 'str'}, + 'created_date': {'key': 'createdDate', 'type': 'str'}, + 'expiry_date': {'key': 'expiryDate', 'type': 'str'}, + 'id_properties_id': {'key': 'properties.id', 'type': 'str'}, + 'subject_name_properties_subject_name': {'key': 'properties.subjectName', 'type': 'str'}, + 'subject_alternative_name_properties_subject_alternative_name': {'key': 'properties.subjectAlternativeName', 'type': 'str'}, + 'thumbprint_properties_thumbprint': {'key': 'properties.thumbprint', 'type': 'str'}, + 'created_date_properties_created_date': {'key': 'properties.createdDate', 'type': 'str'}, + 'expiry_date_properties_expiry_date': {'key': 'properties.expiryDate', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Certificate, self).__init__(**kwargs) + self.id_properties_id = None + self.subject_name_properties_subject_name = None + self.subject_alternative_name_properties_subject_alternative_name = None + self.thumbprint_properties_thumbprint = None + self.created_date_properties_created_date = None + self.expiry_date_properties_expiry_date = None + + +class Resource(msrest.serialization.Model): + """Common fields that are returned in the response for all Azure Resource Manager resources. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class CertificateProfile(Resource): + """CertificateProfile. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.codesigning.models.SystemData + :param profile_name: + :type profile_name: str + :param profile_type: Possible values include: "Test", "Trial", "PrivateTrust", "PublicTrust". + :type profile_type: str or ~azure.mgmt.codesigning.models.ProfileType + :param rotation_policy: Possible values include: "Monthly". + :type rotation_policy: str or ~azure.mgmt.codesigning.models.RotationPolicy + :ivar authority: + :vartype authority: str + :param common_name: + :type common_name: str + :param subject_alternative_name: + :type subject_alternative_name: str + :ivar organization: + :vartype organization: str + :ivar street_address: + :vartype street_address: str + :ivar country: + :vartype country: str + :ivar state: + :vartype state: str + :ivar city: + :vartype city: str + :param certificates: + :type certificates: ~azure.mgmt.codesigning.models.Certificate + :param provisioning_state: The current provisioning state. Possible values include: + "Succeeded", "Failed", "Canceled", "Provisioning", "Updating", "Deleting", "Accepted". + :type provisioning_state: str or ~azure.mgmt.codesigning.models.ProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'authority': {'readonly': True}, + 'organization': {'readonly': True}, + 'street_address': {'readonly': True}, + 'country': {'readonly': True}, + 'state': {'readonly': True}, + 'city': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'profile_name': {'key': 'properties.profileName', 'type': 'str'}, + 'profile_type': {'key': 'properties.profileType', 'type': 'str'}, + 'rotation_policy': {'key': 'properties.rotationPolicy', 'type': 'str'}, + 'authority': {'key': 'properties.authority', 'type': 'str'}, + 'common_name': {'key': 'properties.commonName', 'type': 'str'}, + 'subject_alternative_name': {'key': 'properties.subjectAlternativeName', 'type': 'str'}, + 'organization': {'key': 'properties.organization', 'type': 'str'}, + 'street_address': {'key': 'properties.streetAddress', 'type': 'str'}, + 'country': {'key': 'properties.country', 'type': 'str'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'city': {'key': 'properties.city', 'type': 'str'}, + 'certificates': {'key': 'properties.certificates', 'type': 'Certificate'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CertificateProfile, self).__init__(**kwargs) + self.system_data = None + self.profile_name = kwargs.get('profile_name', None) + self.profile_type = kwargs.get('profile_type', None) + self.rotation_policy = kwargs.get('rotation_policy', None) + self.authority = None + self.common_name = kwargs.get('common_name', None) + self.subject_alternative_name = kwargs.get('subject_alternative_name', None) + self.organization = None + self.street_address = None + self.country = None + self.state = None + self.city = None + self.certificates = kwargs.get('certificates', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + + +class CertificateProfiles(msrest.serialization.Model): + """The paginated list of certifcate profiles. + + :param value: The list of certifcate profiless. + :type value: list[~azure.mgmt.codesigning.models.CertificateProfile] + :param next_link: The link to fetch the next page of certifcate profile. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[CertificateProfile]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CertificateProfiles, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class TrackedResource(Resource): + """The resource model definition for an Azure Resource Manager tracked top level resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives. + :type location: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(TrackedResource, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + self.location = kwargs['location'] + + +class CodeSignAccount(TrackedResource): + """CodeSignAccount. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives. + :type location: str + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.codesigning.models.SystemData + :param account_name: + :type account_name: str + :param account_url: + :type account_url: str + :param verification_status: The vetting status of the code sign account. Possible values + include: "Completed", "InProgress", "NotCompleted". + :type verification_status: str or ~azure.mgmt.codesigning.models.VerificationStatus + :param provisioning_state: The current provisioning state. Possible values include: + "Succeeded", "Failed", "Canceled", "Provisioning", "Updating", "Deleting", "Accepted". + :type provisioning_state: str or ~azure.mgmt.codesigning.models.ProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'account_name': {'key': 'properties.accountName', 'type': 'str'}, + 'account_url': {'key': 'properties.accountUrl', 'type': 'str'}, + 'verification_status': {'key': 'properties.verificationStatus', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CodeSignAccount, self).__init__(**kwargs) + self.system_data = None + self.account_name = kwargs.get('account_name', None) + self.account_url = kwargs.get('account_url', None) + self.verification_status = kwargs.get('verification_status', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + + +class CodeSignAccountPatch(msrest.serialization.Model): + """Object containing updates for patch operations. + + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__( + self, + **kwargs + ): + super(CodeSignAccountPatch, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + + +class CodeSignAccounts(msrest.serialization.Model): + """The paginated list of code sign accounts. + + :param value: The list of code sign accounts. + :type value: list[~azure.mgmt.codesigning.models.CodeSignAccount] + :param next_link: The link to fetch the next page of code sign account. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[CodeSignAccount]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CodeSignAccounts, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class ErrorAdditionalInfo(msrest.serialization.Model): + """The resource management error additional info. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar type: The additional info type. + :vartype type: str + :ivar info: The additional info. + :vartype info: object + """ + + _validation = { + 'type': {'readonly': True}, + 'info': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'info': {'key': 'info', 'type': 'object'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorAdditionalInfo, self).__init__(**kwargs) + self.type = None + self.info = None + + +class ErrorDetail(msrest.serialization.Model): + """The error detail. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + :ivar target: The error target. + :vartype target: str + :ivar details: The error details. + :vartype details: list[~azure.mgmt.codesigning.models.ErrorDetail] + :ivar additional_info: The error additional info. + :vartype additional_info: list[~azure.mgmt.codesigning.models.ErrorAdditionalInfo] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + 'additional_info': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorDetail]'}, + 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorDetail, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = None + self.additional_info = None + + +class ErrorResponse(msrest.serialization.Model): + """Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). + + :param error: The error object. + :type error: ~azure.mgmt.codesigning.models.ErrorDetail + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorDetail'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorResponse, self).__init__(**kwargs) + self.error = kwargs.get('error', None) + + +class Operation(msrest.serialization.Model): + """The code signing API operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Operation name: {Microsoft.CodeSigning}/{resource}/{operation}. + :vartype name: str + :param is_data_action: Indicates whether the operation is a data action. + :type is_data_action: bool + :param display: Display of the operation. + :type display: ~azure.mgmt.codesigning.models.OperationDisplay + """ + + _validation = { + 'name': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + } + + def __init__( + self, + **kwargs + ): + super(Operation, self).__init__(**kwargs) + self.name = None + self.is_data_action = kwargs.get('is_data_action', None) + self.display = kwargs.get('display', None) + + +class OperationDisplay(msrest.serialization.Model): + """Operation display payload. + + :param provider: Resource provider of the operation. + :type provider: str + :param resource: Code sign resource on which the operation is performed. + :type resource: str + :param operation: Localized friendly name for the operation read, write, etc. + :type operation: str + :param description: Localized friendly description for the operation. + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) + self.operation = kwargs.get('operation', None) + self.description = kwargs.get('description', None) + + +class OperationList(msrest.serialization.Model): + """The paginated list of code signing API operations. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of code signing API operations. + :vartype value: list[~azure.mgmt.codesigning.models.Operation] + :param next_link: The link to fetch the next page of code signing API operations. + :type next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Operation]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationList, self).__init__(**kwargs) + self.value = None + self.next_link = kwargs.get('next_link', None) + + +class ProxyResource(Resource): + """The resource model definition for an Azure Resource Manager proxy resource. It will have everything other than required location and tags. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ProxyResource, self).__init__(**kwargs) + + +class SystemData(msrest.serialization.Model): + """Metadata pertaining to creation and last modification of the resource. + + :param created_by: The identity that created the resource. + :type created_by: str + :param created_by_type: The type of identity that created the resource. Possible values + include: "User", "Application", "ManagedIdentity", "Key". + :type created_by_type: str or ~azure.mgmt.codesigning.models.CreatedByType + :param created_at: The timestamp of resource creation (UTC). + :type created_at: ~datetime.datetime + :param last_modified_by: The identity that last modified the resource. + :type last_modified_by: str + :param last_modified_by_type: The type of identity that last modified the resource. Possible + values include: "User", "Application", "ManagedIdentity", "Key". + :type last_modified_by_type: str or ~azure.mgmt.codesigning.models.CreatedByType + :param last_modified_at: The type of identity that last modified the resource. + :type last_modified_at: ~datetime.datetime + """ + + _attribute_map = { + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(SystemData, self).__init__(**kwargs) + self.created_by = kwargs.get('created_by', None) + self.created_by_type = kwargs.get('created_by_type', None) + self.created_at = kwargs.get('created_at', None) + self.last_modified_by = kwargs.get('last_modified_by', None) + self.last_modified_by_type = kwargs.get('last_modified_by_type', None) + self.last_modified_at = kwargs.get('last_modified_at', None) diff --git a/src/codesigning/azext_codesigning/vendored_sdks/codesigning/models/_models_py3.py b/src/codesigning/azext_codesigning/vendored_sdks/codesigning/models/_models_py3.py new file mode 100644 index 00000000000..168a0978941 --- /dev/null +++ b/src/codesigning/azext_codesigning/vendored_sdks/codesigning/models/_models_py3.py @@ -0,0 +1,757 @@ +# 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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +import datetime +from typing import Dict, List, Optional, Union + +from azure.core.exceptions import HttpResponseError +import msrest.serialization + +from ._code_signing_management_client_enums import * + + +class CertificateProperties(msrest.serialization.Model): + """Certificate properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: + :vartype id: str + :ivar subject_name: + :vartype subject_name: str + :ivar subject_alternative_name: + :vartype subject_alternative_name: str + :ivar thumbprint: + :vartype thumbprint: str + :ivar created_date: + :vartype created_date: str + :ivar expiry_date: + :vartype expiry_date: str + """ + + _validation = { + 'id': {'readonly': True}, + 'subject_name': {'readonly': True}, + 'subject_alternative_name': {'readonly': True}, + 'thumbprint': {'readonly': True}, + 'created_date': {'readonly': True}, + 'expiry_date': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'subject_name': {'key': 'subjectName', 'type': 'str'}, + 'subject_alternative_name': {'key': 'subjectAlternativeName', 'type': 'str'}, + 'thumbprint': {'key': 'thumbprint', 'type': 'str'}, + 'created_date': {'key': 'createdDate', 'type': 'str'}, + 'expiry_date': {'key': 'expiryDate', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CertificateProperties, self).__init__(**kwargs) + self.id = None + self.subject_name = None + self.subject_alternative_name = None + self.thumbprint = None + self.created_date = None + self.expiry_date = None + + +class Certificate(CertificateProperties): + """Certificate. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: + :vartype id: str + :ivar subject_name: + :vartype subject_name: str + :ivar subject_alternative_name: + :vartype subject_alternative_name: str + :ivar thumbprint: + :vartype thumbprint: str + :ivar created_date: + :vartype created_date: str + :ivar expiry_date: + :vartype expiry_date: str + :ivar id_properties_id: + :vartype id_properties_id: str + :ivar subject_name_properties_subject_name: + :vartype subject_name_properties_subject_name: str + :ivar subject_alternative_name_properties_subject_alternative_name: + :vartype subject_alternative_name_properties_subject_alternative_name: str + :ivar thumbprint_properties_thumbprint: + :vartype thumbprint_properties_thumbprint: str + :ivar created_date_properties_created_date: + :vartype created_date_properties_created_date: str + :ivar expiry_date_properties_expiry_date: + :vartype expiry_date_properties_expiry_date: str + """ + + _validation = { + 'id': {'readonly': True}, + 'subject_name': {'readonly': True}, + 'subject_alternative_name': {'readonly': True}, + 'thumbprint': {'readonly': True}, + 'created_date': {'readonly': True}, + 'expiry_date': {'readonly': True}, + 'id_properties_id': {'readonly': True}, + 'subject_name_properties_subject_name': {'readonly': True}, + 'subject_alternative_name_properties_subject_alternative_name': {'readonly': True}, + 'thumbprint_properties_thumbprint': {'readonly': True}, + 'created_date_properties_created_date': {'readonly': True}, + 'expiry_date_properties_expiry_date': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'subject_name': {'key': 'subjectName', 'type': 'str'}, + 'subject_alternative_name': {'key': 'subjectAlternativeName', 'type': 'str'}, + 'thumbprint': {'key': 'thumbprint', 'type': 'str'}, + 'created_date': {'key': 'createdDate', 'type': 'str'}, + 'expiry_date': {'key': 'expiryDate', 'type': 'str'}, + 'id_properties_id': {'key': 'properties.id', 'type': 'str'}, + 'subject_name_properties_subject_name': {'key': 'properties.subjectName', 'type': 'str'}, + 'subject_alternative_name_properties_subject_alternative_name': {'key': 'properties.subjectAlternativeName', 'type': 'str'}, + 'thumbprint_properties_thumbprint': {'key': 'properties.thumbprint', 'type': 'str'}, + 'created_date_properties_created_date': {'key': 'properties.createdDate', 'type': 'str'}, + 'expiry_date_properties_expiry_date': {'key': 'properties.expiryDate', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Certificate, self).__init__(**kwargs) + self.id_properties_id = None + self.subject_name_properties_subject_name = None + self.subject_alternative_name_properties_subject_alternative_name = None + self.thumbprint_properties_thumbprint = None + self.created_date_properties_created_date = None + self.expiry_date_properties_expiry_date = None + + +class Resource(msrest.serialization.Model): + """Common fields that are returned in the response for all Azure Resource Manager resources. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class CertificateProfile(Resource): + """CertificateProfile. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.codesigning.models.SystemData + :param profile_name: + :type profile_name: str + :param profile_type: Possible values include: "Test", "Trial", "PrivateTrust", "PublicTrust". + :type profile_type: str or ~azure.mgmt.codesigning.models.ProfileType + :param rotation_policy: Possible values include: "Monthly". + :type rotation_policy: str or ~azure.mgmt.codesigning.models.RotationPolicy + :ivar authority: + :vartype authority: str + :param common_name: + :type common_name: str + :param subject_alternative_name: + :type subject_alternative_name: str + :ivar organization: + :vartype organization: str + :ivar street_address: + :vartype street_address: str + :ivar country: + :vartype country: str + :ivar state: + :vartype state: str + :ivar city: + :vartype city: str + :param certificates: + :type certificates: ~azure.mgmt.codesigning.models.Certificate + :param provisioning_state: The current provisioning state. Possible values include: + "Succeeded", "Failed", "Canceled", "Provisioning", "Updating", "Deleting", "Accepted". + :type provisioning_state: str or ~azure.mgmt.codesigning.models.ProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'authority': {'readonly': True}, + 'organization': {'readonly': True}, + 'street_address': {'readonly': True}, + 'country': {'readonly': True}, + 'state': {'readonly': True}, + 'city': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'profile_name': {'key': 'properties.profileName', 'type': 'str'}, + 'profile_type': {'key': 'properties.profileType', 'type': 'str'}, + 'rotation_policy': {'key': 'properties.rotationPolicy', 'type': 'str'}, + 'authority': {'key': 'properties.authority', 'type': 'str'}, + 'common_name': {'key': 'properties.commonName', 'type': 'str'}, + 'subject_alternative_name': {'key': 'properties.subjectAlternativeName', 'type': 'str'}, + 'organization': {'key': 'properties.organization', 'type': 'str'}, + 'street_address': {'key': 'properties.streetAddress', 'type': 'str'}, + 'country': {'key': 'properties.country', 'type': 'str'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'city': {'key': 'properties.city', 'type': 'str'}, + 'certificates': {'key': 'properties.certificates', 'type': 'Certificate'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + profile_name: Optional[str] = None, + profile_type: Optional[Union[str, "ProfileType"]] = None, + rotation_policy: Optional[Union[str, "RotationPolicy"]] = None, + common_name: Optional[str] = None, + subject_alternative_name: Optional[str] = None, + certificates: Optional["Certificate"] = None, + provisioning_state: Optional[Union[str, "ProvisioningState"]] = None, + **kwargs + ): + super(CertificateProfile, self).__init__(**kwargs) + self.system_data = None + self.profile_name = profile_name + self.profile_type = profile_type + self.rotation_policy = rotation_policy + self.authority = None + self.common_name = common_name + self.subject_alternative_name = subject_alternative_name + self.organization = None + self.street_address = None + self.country = None + self.state = None + self.city = None + self.certificates = certificates + self.provisioning_state = provisioning_state + + +class CertificateProfiles(msrest.serialization.Model): + """The paginated list of certifcate profiles. + + :param value: The list of certifcate profiless. + :type value: list[~azure.mgmt.codesigning.models.CertificateProfile] + :param next_link: The link to fetch the next page of certifcate profile. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[CertificateProfile]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["CertificateProfile"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(CertificateProfiles, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class TrackedResource(Resource): + """The resource model definition for an Azure Resource Manager tracked top level resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives. + :type location: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): + super(TrackedResource, self).__init__(**kwargs) + self.tags = tags + self.location = location + + +class CodeSignAccount(TrackedResource): + """CodeSignAccount. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives. + :type location: str + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.codesigning.models.SystemData + :param account_name: + :type account_name: str + :param account_url: + :type account_url: str + :param verification_status: The vetting status of the code sign account. Possible values + include: "Completed", "InProgress", "NotCompleted". + :type verification_status: str or ~azure.mgmt.codesigning.models.VerificationStatus + :param provisioning_state: The current provisioning state. Possible values include: + "Succeeded", "Failed", "Canceled", "Provisioning", "Updating", "Deleting", "Accepted". + :type provisioning_state: str or ~azure.mgmt.codesigning.models.ProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'account_name': {'key': 'properties.accountName', 'type': 'str'}, + 'account_url': {'key': 'properties.accountUrl', 'type': 'str'}, + 'verification_status': {'key': 'properties.verificationStatus', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + account_name: Optional[str] = None, + account_url: Optional[str] = None, + verification_status: Optional[Union[str, "VerificationStatus"]] = None, + provisioning_state: Optional[Union[str, "ProvisioningState"]] = None, + **kwargs + ): + super(CodeSignAccount, self).__init__(tags=tags, location=location, **kwargs) + self.system_data = None + self.account_name = account_name + self.account_url = account_url + self.verification_status = verification_status + self.provisioning_state = provisioning_state + + +class CodeSignAccountPatch(msrest.serialization.Model): + """Object containing updates for patch operations. + + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): + super(CodeSignAccountPatch, self).__init__(**kwargs) + self.tags = tags + + +class CodeSignAccounts(msrest.serialization.Model): + """The paginated list of code sign accounts. + + :param value: The list of code sign accounts. + :type value: list[~azure.mgmt.codesigning.models.CodeSignAccount] + :param next_link: The link to fetch the next page of code sign account. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[CodeSignAccount]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["CodeSignAccount"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(CodeSignAccounts, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class ErrorAdditionalInfo(msrest.serialization.Model): + """The resource management error additional info. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar type: The additional info type. + :vartype type: str + :ivar info: The additional info. + :vartype info: object + """ + + _validation = { + 'type': {'readonly': True}, + 'info': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'info': {'key': 'info', 'type': 'object'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorAdditionalInfo, self).__init__(**kwargs) + self.type = None + self.info = None + + +class ErrorDetail(msrest.serialization.Model): + """The error detail. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + :ivar target: The error target. + :vartype target: str + :ivar details: The error details. + :vartype details: list[~azure.mgmt.codesigning.models.ErrorDetail] + :ivar additional_info: The error additional info. + :vartype additional_info: list[~azure.mgmt.codesigning.models.ErrorAdditionalInfo] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + 'additional_info': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorDetail]'}, + 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorDetail, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = None + self.additional_info = None + + +class ErrorResponse(msrest.serialization.Model): + """Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). + + :param error: The error object. + :type error: ~azure.mgmt.codesigning.models.ErrorDetail + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorDetail'}, + } + + def __init__( + self, + *, + error: Optional["ErrorDetail"] = None, + **kwargs + ): + super(ErrorResponse, self).__init__(**kwargs) + self.error = error + + +class Operation(msrest.serialization.Model): + """The code signing API operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Operation name: {Microsoft.CodeSigning}/{resource}/{operation}. + :vartype name: str + :param is_data_action: Indicates whether the operation is a data action. + :type is_data_action: bool + :param display: Display of the operation. + :type display: ~azure.mgmt.codesigning.models.OperationDisplay + """ + + _validation = { + 'name': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + } + + def __init__( + self, + *, + is_data_action: Optional[bool] = None, + display: Optional["OperationDisplay"] = None, + **kwargs + ): + super(Operation, self).__init__(**kwargs) + self.name = None + self.is_data_action = is_data_action + self.display = display + + +class OperationDisplay(msrest.serialization.Model): + """Operation display payload. + + :param provider: Resource provider of the operation. + :type provider: str + :param resource: Code sign resource on which the operation is performed. + :type resource: str + :param operation: Localized friendly name for the operation read, write, etc. + :type operation: str + :param description: Localized friendly description for the operation. + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__( + self, + *, + provider: Optional[str] = None, + resource: Optional[str] = None, + operation: Optional[str] = None, + description: Optional[str] = None, + **kwargs + ): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation + self.description = description + + +class OperationList(msrest.serialization.Model): + """The paginated list of code signing API operations. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of code signing API operations. + :vartype value: list[~azure.mgmt.codesigning.models.Operation] + :param next_link: The link to fetch the next page of code signing API operations. + :type next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Operation]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + next_link: Optional[str] = None, + **kwargs + ): + super(OperationList, self).__init__(**kwargs) + self.value = None + self.next_link = next_link + + +class ProxyResource(Resource): + """The resource model definition for an Azure Resource Manager proxy resource. It will have everything other than required location and tags. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ProxyResource, self).__init__(**kwargs) + + +class SystemData(msrest.serialization.Model): + """Metadata pertaining to creation and last modification of the resource. + + :param created_by: The identity that created the resource. + :type created_by: str + :param created_by_type: The type of identity that created the resource. Possible values + include: "User", "Application", "ManagedIdentity", "Key". + :type created_by_type: str or ~azure.mgmt.codesigning.models.CreatedByType + :param created_at: The timestamp of resource creation (UTC). + :type created_at: ~datetime.datetime + :param last_modified_by: The identity that last modified the resource. + :type last_modified_by: str + :param last_modified_by_type: The type of identity that last modified the resource. Possible + values include: "User", "Application", "ManagedIdentity", "Key". + :type last_modified_by_type: str or ~azure.mgmt.codesigning.models.CreatedByType + :param last_modified_at: The type of identity that last modified the resource. + :type last_modified_at: ~datetime.datetime + """ + + _attribute_map = { + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + created_by: Optional[str] = None, + created_by_type: Optional[Union[str, "CreatedByType"]] = None, + created_at: Optional[datetime.datetime] = None, + last_modified_by: Optional[str] = None, + last_modified_by_type: Optional[Union[str, "CreatedByType"]] = None, + last_modified_at: Optional[datetime.datetime] = None, + **kwargs + ): + super(SystemData, self).__init__(**kwargs) + self.created_by = created_by + self.created_by_type = created_by_type + self.created_at = created_at + self.last_modified_by = last_modified_by + self.last_modified_by_type = last_modified_by_type + self.last_modified_at = last_modified_at diff --git a/src/codesigning/azext_codesigning/vendored_sdks/codesigning/operations/__init__.py b/src/codesigning/azext_codesigning/vendored_sdks/codesigning/operations/__init__.py new file mode 100644 index 00000000000..b4b2e783f7d --- /dev/null +++ b/src/codesigning/azext_codesigning/vendored_sdks/codesigning/operations/__init__.py @@ -0,0 +1,17 @@ +# 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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._code_sign_account_operations import CodeSignAccountOperations +from ._certificate_profile_operations import CertificateProfileOperations +from ._operations import Operations + +__all__ = [ + 'CodeSignAccountOperations', + 'CertificateProfileOperations', + 'Operations', +] diff --git a/src/codesigning/azext_codesigning/vendored_sdks/codesigning/operations/_certificate_profile_operations.py b/src/codesigning/azext_codesigning/vendored_sdks/codesigning/operations/_certificate_profile_operations.py new file mode 100644 index 00000000000..e2dc899d570 --- /dev/null +++ b/src/codesigning/azext_codesigning/vendored_sdks/codesigning/operations/_certificate_profile_operations.py @@ -0,0 +1,402 @@ +# 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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class CertificateProfileOperations(object): + """CertificateProfileOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.codesigning.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_code_sign_account( + self, + resource_group_name, # type: str + account_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.CertificateProfiles"] + """List certificate profiles within a code sign account. + + :param resource_group_name: The name of the resource group under which Code Sign Account is + registered. + :type resource_group_name: str + :param account_name: Code Sign account name. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either CertificateProfiles or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.codesigning.models.CertificateProfiles] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.CertificateProfiles"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-14-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_code_sign_account.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('CertificateProfiles', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_code_sign_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSignAccounts/{accountName}/certificateProfiles'} # type: ignore + + def get( + self, + resource_group_name, # type: str + account_name, # type: str + profile_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.CertificateProfile" + """Get details of particular certificate profile. + + :param resource_group_name: The name of the resource group under which Code Sign Account is + registered. + :type resource_group_name: str + :param account_name: Code Sign account name. + :type account_name: str + :param profile_name: Certificate profile name. + :type profile_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CertificateProfile, or the result of cls(response) + :rtype: ~azure.mgmt.codesigning.models.CertificateProfile + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.CertificateProfile"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-14-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CertificateProfile', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSignAccounts/{accountName}/certificateProfiles/{profileName}'} # type: ignore + + def create( + self, + resource_group_name, # type: str + account_name, # type: str + profile_name, # type: str + certificate_profile=None, # type: Optional["models.CertificateProfile"] + **kwargs # type: Any + ): + # type: (...) -> "models.CertificateProfile" + """Create a certificate profile. + + :param resource_group_name: The name of the resource group under which Code Sign Account is + registered. + :type resource_group_name: str + :param account_name: Code Sign account name. + :type account_name: str + :param profile_name: Certificate profile name. + :type profile_name: str + :param certificate_profile: + :type certificate_profile: ~azure.mgmt.codesigning.models.CertificateProfile + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CertificateProfile, or the result of cls(response) + :rtype: ~azure.mgmt.codesigning.models.CertificateProfile + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.CertificateProfile"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-14-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + if certificate_profile is not None: + body_content = self._serialize.body(certificate_profile, 'CertificateProfile') + else: + body_content = None + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CertificateProfile', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSignAccounts/{accountName}/certificateProfiles/{profileName}'} # type: ignore + + def update( + self, + resource_group_name, # type: str + account_name, # type: str + profile_name, # type: str + certificate_profile=None, # type: Optional["models.CertificateProfile"] + **kwargs # type: Any + ): + # type: (...) -> "models.CertificateProfile" + """Update certificate profile. + + :param resource_group_name: The name of the resource group under which Code Sign Account is + registered. + :type resource_group_name: str + :param account_name: Code Sign account name. + :type account_name: str + :param profile_name: Certificate profile name. + :type profile_name: str + :param certificate_profile: + :type certificate_profile: ~azure.mgmt.codesigning.models.CertificateProfile + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CertificateProfile, or the result of cls(response) + :rtype: ~azure.mgmt.codesigning.models.CertificateProfile + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.CertificateProfile"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-14-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + if certificate_profile is not None: + body_content = self._serialize.body(certificate_profile, 'CertificateProfile') + else: + body_content = None + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CertificateProfile', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSignAccounts/{accountName}/certificateProfiles/{profileName}'} # type: ignore + + def delete( + self, + resource_group_name, # type: str + account_name, # type: str + profile_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Delete certificate profile. + + :param resource_group_name: The name of the resource group under which Code Sign Account is + registered. + :type resource_group_name: str + :param account_name: Code Sign account name. + :type account_name: str + :param profile_name: Certificate profile name. + :type profile_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-14-preview" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSignAccounts/{accountName}/certificateProfiles/{profileName}'} # type: ignore diff --git a/src/codesigning/azext_codesigning/vendored_sdks/codesigning/operations/_code_sign_account_operations.py b/src/codesigning/azext_codesigning/vendored_sdks/codesigning/operations/_code_sign_account_operations.py new file mode 100644 index 00000000000..19ad9256d1a --- /dev/null +++ b/src/codesigning/azext_codesigning/vendored_sdks/codesigning/operations/_code_sign_account_operations.py @@ -0,0 +1,451 @@ +# 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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class CodeSignAccountOperations(object): + """CodeSignAccountOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.codesigning.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_subscription( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.CodeSignAccounts"] + """Lists Code Sign Accounts within a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either CodeSignAccounts or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.codesigning.models.CodeSignAccounts] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.CodeSignAccounts"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-14-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_subscription.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('CodeSignAccounts', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.CodeSigning/codeSignAccounts'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.CodeSignAccounts"] + """List Code Sign Accounts within a resource group. + + :param resource_group_name: The name of the resource group under which Code Sign Account is + registered. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either CodeSignAccounts or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.codesigning.models.CodeSignAccounts] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.CodeSignAccounts"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-14-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('CodeSignAccounts', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSignAccounts'} # type: ignore + + def get( + self, + resource_group_name, # type: str + account_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.CodeSignAccount" + """Get Code Sign Account. + + :param resource_group_name: The name of the resource group under which Code Sign Account is + registered. + :type resource_group_name: str + :param account_name: Code Sign account name. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CodeSignAccount, or the result of cls(response) + :rtype: ~azure.mgmt.codesigning.models.CodeSignAccount + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.CodeSignAccount"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-14-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CodeSignAccount', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSignAccounts/{accountName}'} # type: ignore + + def create( + self, + resource_group_name, # type: str + account_name, # type: str + code_sign_account=None, # type: Optional["models.CodeSignAccount"] + **kwargs # type: Any + ): + # type: (...) -> "models.CodeSignAccount" + """Create Code Sign Account. + + :param resource_group_name: The name of the resource group under which Code Sign Account is + registered. + :type resource_group_name: str + :param account_name: Code Sign account name. + :type account_name: str + :param code_sign_account: + :type code_sign_account: ~azure.mgmt.codesigning.models.CodeSignAccount + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CodeSignAccount, or the result of cls(response) + :rtype: ~azure.mgmt.codesigning.models.CodeSignAccount + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.CodeSignAccount"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-14-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + if code_sign_account is not None: + body_content = self._serialize.body(code_sign_account, 'CodeSignAccount') + else: + body_content = None + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('CodeSignAccount', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('CodeSignAccount', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSignAccounts/{accountName}'} # type: ignore + + def update( + self, + resource_group_name, # type: str + account_name, # type: str + code_sign_account_patch, # type: "models.CodeSignAccountPatch" + **kwargs # type: Any + ): + # type: (...) -> "models.CodeSignAccount" + """Update a code sign account. + + :param resource_group_name: The name of the resource group under which Code Sign Account is + registered. + :type resource_group_name: str + :param account_name: Code Sign account name. + :type account_name: str + :param code_sign_account_patch: + :type code_sign_account_patch: ~azure.mgmt.codesigning.models.CodeSignAccountPatch + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CodeSignAccount, or the result of cls(response) + :rtype: ~azure.mgmt.codesigning.models.CodeSignAccount + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.CodeSignAccount"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-14-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(code_sign_account_patch, 'CodeSignAccountPatch') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CodeSignAccount', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSignAccounts/{accountName}'} # type: ignore + + def delete( + self, + resource_group_name, # type: str + account_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Delete a Code Sign Account. + + :param resource_group_name: The name of the resource group under which Code Sign Account is + registered. + :type resource_group_name: str + :param account_name: Code Sign account name. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-14-preview" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSignAccounts/{accountName}'} # type: ignore diff --git a/src/codesigning/azext_codesigning/vendored_sdks/codesigning/operations/_operations.py b/src/codesigning/azext_codesigning/vendored_sdks/codesigning/operations/_operations.py new file mode 100644 index 00000000000..b90baf816fe --- /dev/null +++ b/src/codesigning/azext_codesigning/vendored_sdks/codesigning/operations/_operations.py @@ -0,0 +1,110 @@ +# 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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class Operations(object): + """Operations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.codesigning.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def get( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.OperationList"] + """Lists all of the available API operations for code signing resource. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either OperationList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.codesigning.models.OperationList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.OperationList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-14-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.get.metadata['url'] # type: ignore + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('OperationList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + get.metadata = {'url': '/providers/Microsoft.CodeSigning/operations'} # type: ignore diff --git a/src/codesigning/azext_codesigning/vendored_sdks/codesigning/py.typed b/src/codesigning/azext_codesigning/vendored_sdks/codesigning/py.typed new file mode 100644 index 00000000000..e5aff4f83af --- /dev/null +++ b/src/codesigning/azext_codesigning/vendored_sdks/codesigning/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file diff --git a/src/codesigning/report.md b/src/codesigning/report.md new file mode 100644 index 00000000000..65ea7d53f6b --- /dev/null +++ b/src/codesigning/report.md @@ -0,0 +1,200 @@ +# Azure CLI Module Creation Report + +## EXTENSION +|CLI Extension|Command Groups| +|---------|------------| +|az codesigning|[groups](#CommandGroups) + +## GROUPS +### Command groups in `az codesigning` extension +|CLI Command Group|Group Swagger name|Commands| +|---------|------------|--------| +|az codesigning|CodeSignAccount|[commands](#CommandsInCodeSignAccount)| +|az codesigning certificate-profile|CertificateProfile|[commands](#CommandsInCertificateProfile)| +|az codesigning operation|Operations|[commands](#CommandsInOperations)| + +## COMMANDS +### Commands in `az codesigning` group +|CLI Command|Operation Swagger name|Parameters|Examples| +|---------|------------|--------|-----------| +|[az codesigning list](#CodeSignAccountListByResourceGroup)|ListByResourceGroup|[Parameters](#ParametersCodeSignAccountListByResourceGroup)|[Example](#ExamplesCodeSignAccountListByResourceGroup)| +|[az codesigning list](#CodeSignAccountListBySubscription)|ListBySubscription|[Parameters](#ParametersCodeSignAccountListBySubscription)|[Example](#ExamplesCodeSignAccountListBySubscription)| +|[az codesigning show](#CodeSignAccountGet)|Get|[Parameters](#ParametersCodeSignAccountGet)|[Example](#ExamplesCodeSignAccountGet)| +|[az codesigning create](#CodeSignAccountCreate)|Create|[Parameters](#ParametersCodeSignAccountCreate)|[Example](#ExamplesCodeSignAccountCreate)| +|[az codesigning update](#CodeSignAccountUpdate)|Update|[Parameters](#ParametersCodeSignAccountUpdate)|[Example](#ExamplesCodeSignAccountUpdate)| +|[az codesigning delete](#CodeSignAccountDelete)|Delete|[Parameters](#ParametersCodeSignAccountDelete)|[Example](#ExamplesCodeSignAccountDelete)| + +### Commands in `az codesigning certificate-profile` group +|CLI Command|Operation Swagger name|Parameters|Examples| +|---------|------------|--------|-----------| +|[az codesigning certificate-profile list](#CertificateProfileListByCodeSignAccount)|ListByCodeSignAccount|[Parameters](#ParametersCertificateProfileListByCodeSignAccount)|[Example](#ExamplesCertificateProfileListByCodeSignAccount)| +|[az codesigning certificate-profile show](#CertificateProfileGet)|Get|[Parameters](#ParametersCertificateProfileGet)|[Example](#ExamplesCertificateProfileGet)| +|[az codesigning certificate-profile create](#CertificateProfileCreate)|Create|[Parameters](#ParametersCertificateProfileCreate)|[Example](#ExamplesCertificateProfileCreate)| +|[az codesigning certificate-profile update](#CertificateProfileUpdate)|Update|[Parameters](#ParametersCertificateProfileUpdate)|Not Found| +|[az codesigning certificate-profile delete](#CertificateProfileDelete)|Delete|[Parameters](#ParametersCertificateProfileDelete)|[Example](#ExamplesCertificateProfileDelete)| + +### Commands in `az codesigning operation` group +|CLI Command|Operation Swagger name|Parameters|Examples| +|---------|------------|--------|-----------| +|[az codesigning operation show](#OperationsGet)|Get|[Parameters](#ParametersOperationsGet)|Not Found| + + +## COMMAND DETAILS + +### group `az codesigning` +#### Command `az codesigning list` + +##### Example +``` +az codesigning list --resource-group "MyResourceGroup" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group under which Code Sign Account is registered|resource_group_name|resourceGroupName| + +#### Command `az codesigning list` + +##### Example +``` +az codesigning list +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +#### Command `az codesigning show` + +##### Example +``` +az codesigning show --account-name "MyAccount" --resource-group "MyResourceGroup" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group under which Code Sign Account is registered|resource_group_name|resourceGroupName| +|**--account-name**|string|Code Sign account name|account_name|accountName| + +#### Command `az codesigning create` + +##### Example +``` +az codesigning create --account-name "MyAccount" --location "eastus" --tags key1="value1" --resource-group \ +"MyResourceGroup" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group under which Code Sign Account is registered|resource_group_name|resourceGroupName| +|**--account-name**|string|Code Sign account name|account_name|accountName| +|**--tags**|dictionary|Resource tags.|tags|tags| +|**--location**|string|The geo-location where the resource lives|location|location| +|**--code-sign-account-properties-account-name**|string||code_sign_account_properties_account_name|accountName| +|**--account-url**|string||account_url|accountUrl| +|**--verification-status**|choice|The vetting status of the code sign account|verification_status|verificationStatus| +|**--provisioning-state**|choice|The current provisioning state|provisioning_state|provisioningState| + +#### Command `az codesigning update` + +##### Example +``` +az codesigning update --account-name "MyAccount" --tags key1="value1" --resource-group "MyResourceGroup" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group under which Code Sign Account is registered|resource_group_name|resourceGroupName| +|**--account-name**|string|Code Sign account name|account_name|accountName| +|**--tags**|dictionary|Resource tags.|tags|tags| + +#### Command `az codesigning delete` + +##### Example +``` +az codesigning delete --account-name "MyAccount" --resource-group "MyResourceGroup" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group under which Code Sign Account is registered|resource_group_name|resourceGroupName| +|**--account-name**|string|Code Sign account name|account_name|accountName| + +### group `az codesigning certificate-profile` +#### Command `az codesigning certificate-profile list` + +##### Example +``` +az codesigning certificate-profile list --account-name "MyAccount" --resource-group "MyResourceGroup" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group under which Code Sign Account is registered|resource_group_name|resourceGroupName| +|**--account-name**|string|Code Sign account name|account_name|accountName| + +#### Command `az codesigning certificate-profile show` + +##### Example +``` +az codesigning certificate-profile show --account-name "MyAccount" --profile-name "profileA" --resource-group \ +"MyResourceGroup" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group under which Code Sign Account is registered|resource_group_name|resourceGroupName| +|**--account-name**|string|Code Sign account name|account_name|accountName| +|**--profile-name**|string|Certificate profile name|profile_name|profileName| + +#### Command `az codesigning certificate-profile create` + +##### Example +``` +az codesigning certificate-profile create --account-name "MyAccount" --profile-name "profileA" --resource-group \ +"MyResourceGroup" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group under which Code Sign Account is registered|resource_group_name|resourceGroupName| +|**--account-name**|string|Code Sign account name|account_name|accountName| +|**--profile-name**|string|Certificate profile name|profile_name|profileName| +|**--certificate-profile-properties-profile-name**|string||certificate_profile_properties_profile_name|profileName| +|**--profile-type**|choice||profile_type|profileType| +|**--common-name**|string||common_name|commonName| +|**--subject-alternative-name**|string||subject_alternative_name|subjectAlternativeName| +|**--provisioning-state**|choice|The current provisioning state|provisioning_state|provisioningState| + +#### Command `az codesigning certificate-profile update` + +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group under which Code Sign Account is registered|resource_group_name|resourceGroupName| +|**--account-name**|string|Code Sign account name|account_name|accountName| +|**--profile-name**|string|Certificate profile name|profile_name|profileName| +|**--certificate-profile-properties-profile-name**|string||certificate_profile_properties_profile_name|profileName| +|**--profile-type**|choice||profile_type|profileType| +|**--common-name**|string||common_name|commonName| +|**--subject-alternative-name**|string||subject_alternative_name|subjectAlternativeName| +|**--provisioning-state**|choice|The current provisioning state|provisioning_state|provisioningState| + +#### Command `az codesigning certificate-profile delete` + +##### Example +``` +az codesigning certificate-profile delete --account-name "MyAccount" --profile-name "profileA" --resource-group \ +"MyResourceGroup" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group under which Code Sign Account is registered|resource_group_name|resourceGroupName| +|**--account-name**|string|Code Sign account name|account_name|accountName| +|**--profile-name**|string|Certificate profile name|profile_name|profileName| + +### group `az codesigning operation` +#### Command `az codesigning operation show` + +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| \ No newline at end of file diff --git a/src/codesigning/setup.cfg b/src/codesigning/setup.cfg new file mode 100644 index 00000000000..2fdd96e5d39 --- /dev/null +++ b/src/codesigning/setup.cfg @@ -0,0 +1 @@ +#setup.cfg \ No newline at end of file diff --git a/src/codesigning/setup.py b/src/codesigning/setup.py new file mode 100644 index 00000000000..747a3c43295 --- /dev/null +++ b/src/codesigning/setup.py @@ -0,0 +1,58 @@ +#!/usr/bin/env python + +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + + +from codecs import open +from setuptools import setup, find_packages + +# HISTORY.rst entry. +VERSION = '0.1.0' +try: + from azext_codesigning.manual.version import VERSION +except ImportError: + pass + +# The full list of classifiers is available at +# https://pypi.python.org/pypi?%3Aaction=list_classifiers +CLASSIFIERS = [ + 'Development Status :: 4 - Beta', + 'Intended Audience :: Developers', + 'Intended Audience :: System Administrators', + 'Programming Language :: Python', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', + 'License :: OSI Approved :: MIT License', +] + +DEPENDENCIES = [] + +try: + from azext_codesigning.manual.dependency import DEPENDENCIES +except ImportError: + pass + +with open('README.md', 'r', encoding='utf-8') as f: + README = f.read() +with open('HISTORY.rst', 'r', encoding='utf-8') as f: + HISTORY = f.read() + +setup( + name='codesigning', + version=VERSION, + description='Microsoft Azure Command-Line Tools CodeSigningManagementClient Extension', + author='Microsoft Corporation', + author_email='azpycli@microsoft.com', + url='https://github.com/Azure/azure-cli-extensions/tree/master/src/codesigning', + long_description=README + '\n\n' + HISTORY, + license='MIT', + classifiers=CLASSIFIERS, + packages=find_packages(), + install_requires=DEPENDENCIES, + package_data={'azext_codesigning': ['azext_metadata.json']}, +) From 294898861a2380df763ec72a4f68259a36a348a8 Mon Sep 17 00:00:00 2001 From: Amrita Shanbhag Date: Fri, 12 Mar 2021 17:07:25 +0530 Subject: [PATCH 2/3] Updated the Codesigning extension --- src/codesigning/README.md | 20 +- .../azext_codesigning/generated/_help.py | 26 +- .../azext_codesigning/generated/_params.py | 47 +- .../azext_codesigning/generated/custom.py | 22 +- .../tests/latest/example_steps.py | 50 ++- .../recordings/test_codesigning_Scenario.yaml | 415 ++++++++++++++---- .../tests/latest/test_codesigning_scenario.py | 6 + .../test_codesigning_scenario_coverage.md | 20 +- .../_code_signing_management_client.py | 4 +- .../codesigning/_configuration.py | 2 +- .../aio/_code_signing_management_client.py | 4 +- .../codesigning/aio/_configuration.py | 2 +- .../_certificate_profile_operations.py | 117 +++-- .../_code_sign_account_operations.py | 397 +++++++++-------- .../codesigning/models/__init__.py | 3 - .../_code_signing_management_client_enums.py | 8 +- .../codesigning/models/_models.py | 161 ++----- .../codesigning/models/_models_py3.py | 168 ++----- .../_certificate_profile_operations.py | 117 +++-- .../_code_sign_account_operations.py | 401 +++++++++-------- src/codesigning/report.md | 80 ++-- 21 files changed, 1077 insertions(+), 993 deletions(-) diff --git a/src/codesigning/README.md b/src/codesigning/README.md index 4e704eabeaf..c92f15db196 100644 --- a/src/codesigning/README.md +++ b/src/codesigning/README.md @@ -11,8 +11,7 @@ az extension add --name codesigning #### codesigning #### ##### Create ##### ``` -az codesigning create --account-name "MyAccount" --location "eastus" --tags key1="value1" \ - --resource-group "MyResourceGroup" +az codesigning create --account-name "MyAccount" --location "eastus" --resource-group "MyResourceGroup" ``` ##### Show ##### ``` @@ -24,7 +23,7 @@ az codesigning list --resource-group "MyResourceGroup" ``` ##### Update ##### ``` -az codesigning update --account-name "MyAccount" --tags key1="value1" --resource-group "MyResourceGroup" +az codesigning update --tags key1="value1" --account-name "MyAccount" --resource-group "MyResourceGroup" ``` ##### Delete ##### ``` @@ -33,7 +32,8 @@ az codesigning delete --account-name "MyAccount" --resource-group "MyResourceGro #### codesigning certificate-profile #### ##### Create ##### ``` -az codesigning certificate-profile create --account-name "MyAccount" --profile-name "profileA" \ +az codesigning certificate-profile create --account-name "MyAccount" --profile-name "profileA" --common-name "Contoso" \ + --profile-type "PublicTrust" --subject-alternative-name "Contoso Corporate Engineering" \ --resource-group "MyResourceGroup" ``` ##### Show ##### @@ -45,9 +45,19 @@ az codesigning certificate-profile show --account-name "MyAccount" --profile-nam ``` az codesigning certificate-profile list --account-name "MyAccount" --resource-group "MyResourceGroup" ``` +##### Update ##### +``` +az codesigning certificate-profile update --common-name "Contoso" --profile-type "Test" \ + --subject-alternative-name "Contoso Corporate Engineering" --account-name "MyAccount" --profile-name "profileA" \ + --resource-group "MyResourceGroup" +``` ##### Delete ##### ``` az codesigning certificate-profile delete --account-name "MyAccount" --profile-name "profileA" \ --resource-group "MyResourceGroup" ``` -#### codesigning operation #### \ No newline at end of file +#### codesigning operation #### +##### Show ##### +``` +az codesigning operation show +``` \ No newline at end of file diff --git a/src/codesigning/azext_codesigning/generated/_help.py b/src/codesigning/azext_codesigning/generated/_help.py index 1d33eb286ad..6ea8937b734 100644 --- a/src/codesigning/azext_codesigning/generated/_help.py +++ b/src/codesigning/azext_codesigning/generated/_help.py @@ -32,7 +32,7 @@ helps['codesigning show'] = """ type: command - short-summary: "Get Code Sign Account." + short-summary: "Get a Code Sign Account." examples: - name: Get Code Sign Account text: |- @@ -41,12 +41,11 @@ helps['codesigning create'] = """ type: command - short-summary: "Create Code Sign Account." + short-summary: "Create a Code Sign Account." examples: - name: Create Code Sign Account text: |- - az codesigning create --account-name "MyAccount" --location "eastus" --tags key1="value1" \ ---resource-group "MyResourceGroup" + az codesigning create --account-name "MyAccount" --location "eastus" --resource-group "MyResourceGroup" """ helps['codesigning update'] = """ @@ -55,7 +54,7 @@ examples: - name: Update Code Sign Account text: |- - az codesigning update --account-name "MyAccount" --tags key1="value1" --resource-group \ + az codesigning update --tags key1="value1" --account-name "MyAccount" --resource-group \ "MyResourceGroup" """ @@ -84,7 +83,7 @@ helps['codesigning certificate-profile show'] = """ type: command - short-summary: "Get details of particular certificate profile." + short-summary: "Get details of a certificate profile." examples: - name: Get Certificate Profile text: |- @@ -99,17 +98,24 @@ - name: Create Certificate Profile text: |- az codesigning certificate-profile create --account-name "MyAccount" --profile-name "profileA" \ +--common-name "Contoso" --profile-type "PublicTrust" --subject-alternative-name "Contoso Corporate Engineering" \ --resource-group "MyResourceGroup" """ helps['codesigning certificate-profile update'] = """ type: command - short-summary: "Update certificate profile." + short-summary: "Update a certificate profile." + examples: + - name: Update Certificate Profile + text: |- + az codesigning certificate-profile update --common-name "Contoso" --profile-type "Test" \ +--subject-alternative-name "Contoso Corporate Engineering" --account-name "MyAccount" --profile-name "profileA" \ +--resource-group "MyResourceGroup" """ helps['codesigning certificate-profile delete'] = """ type: command - short-summary: "Delete certificate profile." + short-summary: "Delete a Certificate Profile." examples: - name: Delete Certificate Profile text: |- @@ -125,4 +131,8 @@ helps['codesigning operation show'] = """ type: command short-summary: "Lists all of the available API operations for code signing resource." + examples: + - name: List Code Sign Account operations + text: |- + az codesigning operation show """ diff --git a/src/codesigning/azext_codesigning/generated/_params.py b/src/codesigning/azext_codesigning/generated/_params.py index 4e5c2c09197..60107b48a05 100644 --- a/src/codesigning/azext_codesigning/generated/_params.py +++ b/src/codesigning/azext_codesigning/generated/_params.py @@ -26,65 +26,52 @@ def load_arguments(self, _): with self.argument_context('codesigning show') as c: c.argument('resource_group_name', resource_group_name_type) - c.argument('account_name', type=str, help='Code Sign account name', id_part='name') + c.argument('account_name', type=str, help='Code Signing account name', id_part='name') with self.argument_context('codesigning create') as c: c.argument('resource_group_name', resource_group_name_type) - c.argument('account_name', type=str, help='Code Sign account name') + c.argument('account_name', type=str, help='Code Signing account name') c.argument('tags', tags_type) c.argument('location', arg_type=get_location_type(self.cli_ctx), required=False, validator=get_default_location_from_resource_group) - c.argument('code_sign_account_properties_account_name', type=str, help='') - c.argument('account_url', type=str, help='') - c.argument('verification_status', arg_type=get_enum_type(['Completed', 'InProgress', 'NotCompleted']), - help='The vetting status of the code sign account') - c.argument('provisioning_state', arg_type=get_enum_type(['Succeeded', 'Failed', 'Canceled', 'Provisioning', - 'Updating', 'Deleting', 'Accepted']), help='The ' - 'current provisioning state') with self.argument_context('codesigning update') as c: c.argument('resource_group_name', resource_group_name_type) - c.argument('account_name', type=str, help='Code Sign account name', id_part='name') + c.argument('account_name', type=str, help='Code Signing account name', id_part='name') c.argument('tags', tags_type) with self.argument_context('codesigning delete') as c: c.argument('resource_group_name', resource_group_name_type) - c.argument('account_name', type=str, help='Code Sign account name', id_part='name') + c.argument('account_name', type=str, help='Code Signing account name', id_part='name') with self.argument_context('codesigning certificate-profile list') as c: c.argument('resource_group_name', resource_group_name_type) - c.argument('account_name', type=str, help='Code Sign account name') + c.argument('account_name', type=str, help='Code Signing account name') with self.argument_context('codesigning certificate-profile show') as c: c.argument('resource_group_name', resource_group_name_type) - c.argument('account_name', type=str, help='Code Sign account name', id_part='name') + c.argument('account_name', type=str, help='Code Signing account name', id_part='name') c.argument('profile_name', type=str, help='Certificate profile name', id_part='child_name_1') with self.argument_context('codesigning certificate-profile create') as c: c.argument('resource_group_name', resource_group_name_type) - c.argument('account_name', type=str, help='Code Sign account name') + c.argument('account_name', type=str, help='Code Signing account name') c.argument('profile_name', type=str, help='Certificate profile name') - c.argument('certificate_profile_properties_profile_name', type=str, help='') - c.argument('profile_type', arg_type=get_enum_type(['Test', 'Trial', 'PrivateTrust', 'PublicTrust']), help='') - c.argument('common_name', type=str, help='') - c.argument('subject_alternative_name', type=str, help='') - c.argument('provisioning_state', arg_type=get_enum_type(['Succeeded', 'Failed', 'Canceled', 'Provisioning', - 'Updating', 'Deleting', 'Accepted']), help='The ' - 'current provisioning state') + c.argument('profile_type', arg_type=get_enum_type(['Test', 'Trial', 'PrivateTrust', 'PublicTrust']), + help='Profile type of the certificate') + c.argument('common_name', type=str, help='Name of the certificate') + c.argument('subject_alternative_name', type=str, help='Subject Alternative Name of the certificate') with self.argument_context('codesigning certificate-profile update') as c: c.argument('resource_group_name', resource_group_name_type) - c.argument('account_name', type=str, help='Code Sign account name', id_part='name') + c.argument('account_name', type=str, help='Code Signing account name', id_part='name') c.argument('profile_name', type=str, help='Certificate profile name', id_part='child_name_1') - c.argument('certificate_profile_properties_profile_name', type=str, help='', id_part='child_name_1') - c.argument('profile_type', arg_type=get_enum_type(['Test', 'Trial', 'PrivateTrust', 'PublicTrust']), help='') - c.argument('common_name', type=str, help='') - c.argument('subject_alternative_name', type=str, help='') - c.argument('provisioning_state', arg_type=get_enum_type(['Succeeded', 'Failed', 'Canceled', 'Provisioning', - 'Updating', 'Deleting', 'Accepted']), help='The ' - 'current provisioning state') + c.argument('profile_type', arg_type=get_enum_type(['Test', 'Trial', 'PrivateTrust', 'PublicTrust']), + help='Profile type of the certificate') + c.argument('common_name', type=str, help='Name of the certificate') + c.argument('subject_alternative_name', type=str, help='Subject Alternative Name of the certificate') with self.argument_context('codesigning certificate-profile delete') as c: c.argument('resource_group_name', resource_group_name_type) - c.argument('account_name', type=str, help='Code Sign account name', id_part='name') + c.argument('account_name', type=str, help='Code Signing account name', id_part='name') c.argument('profile_name', type=str, help='Certificate profile name', id_part='child_name_1') diff --git a/src/codesigning/azext_codesigning/generated/custom.py b/src/codesigning/azext_codesigning/generated/custom.py index ea8193eba0e..ab9df5b7280 100644 --- a/src/codesigning/azext_codesigning/generated/custom.py +++ b/src/codesigning/azext_codesigning/generated/custom.py @@ -28,18 +28,10 @@ def codesigning_create(client, resource_group_name, account_name, tags=None, - location=None, - code_sign_account_properties_account_name=None, - account_url=None, - verification_status=None, - provisioning_state=None): + location=None): code_sign_account = {} code_sign_account['tags'] = tags code_sign_account['location'] = location - code_sign_account['account_name'] = code_sign_account_properties_account_name - code_sign_account['account_url'] = account_url - code_sign_account['verification_status'] = verification_status - code_sign_account['provisioning_state'] = provisioning_state return client.create(resource_group_name=resource_group_name, account_name=account_name, code_sign_account=code_sign_account) @@ -83,18 +75,14 @@ def codesigning_certificate_profile_create(client, resource_group_name, account_name, profile_name, - certificate_profile_properties_profile_name=None, profile_type=None, common_name=None, - subject_alternative_name=None, - provisioning_state=None): + subject_alternative_name=None): certificate_profile = {} - certificate_profile['profile_name'] = certificate_profile_properties_profile_name certificate_profile['profile_type'] = profile_type certificate_profile['rotation_policy'] = "Monthly" certificate_profile['common_name'] = common_name certificate_profile['subject_alternative_name'] = subject_alternative_name - certificate_profile['provisioning_state'] = provisioning_state return client.create(resource_group_name=resource_group_name, account_name=account_name, profile_name=profile_name, @@ -105,18 +93,14 @@ def codesigning_certificate_profile_update(client, resource_group_name, account_name, profile_name, - certificate_profile_properties_profile_name=None, profile_type=None, common_name=None, - subject_alternative_name=None, - provisioning_state=None): + subject_alternative_name=None): certificate_profile = {} - certificate_profile['profile_name'] = certificate_profile_properties_profile_name certificate_profile['profile_type'] = profile_type certificate_profile['rotation_policy'] = "Monthly" certificate_profile['common_name'] = common_name certificate_profile['subject_alternative_name'] = subject_alternative_name - certificate_profile['provisioning_state'] = provisioning_state return client.update(resource_group_name=resource_group_name, account_name=account_name, profile_name=profile_name, diff --git a/src/codesigning/azext_codesigning/tests/latest/example_steps.py b/src/codesigning/azext_codesigning/tests/latest/example_steps.py index 4cb3b09eb3c..a3456a871df 100644 --- a/src/codesigning/azext_codesigning/tests/latest/example_steps.py +++ b/src/codesigning/azext_codesigning/tests/latest/example_steps.py @@ -14,19 +14,22 @@ # EXAMPLE: /CertificateProfile/put/Create Certificate Profile @try_manual -def step_certificate_profile_create(test, rg, checks=None): +def step_certificate_profile_create(test, rg, checks=None): # pylint: disable=unused-argument if checks is None: checks = [] test.cmd('az codesigning certificate-profile create ' '--account-name "MyAccount" ' '--profile-name "profileA" ' + '--common-name "Contoso" ' + '--profile-type "PublicTrust" ' + '--subject-alternative-name "Contoso Corporate Engineering" ' '--resource-group "{rg}"', checks=checks) # EXAMPLE: /CertificateProfile/get/Get Certificate Profile @try_manual -def step_certificate_profile_show(test, rg, checks=None): +def step_certificate_profile_show(test, rg, checks=None): # pylint: disable=unused-argument if checks is None: checks = [] test.cmd('az codesigning certificate-profile show ' @@ -38,7 +41,7 @@ def step_certificate_profile_show(test, rg, checks=None): # EXAMPLE: /CertificateProfile/get/List Certificate Profiles @try_manual -def step_certificate_profile_list(test, rg, checks=None): +def step_certificate_profile_list(test, rg, checks=None): # pylint: disable=unused-argument if checks is None: checks = [] test.cmd('az codesigning certificate-profile list ' @@ -47,9 +50,24 @@ def step_certificate_profile_list(test, rg, checks=None): checks=checks) +# EXAMPLE: /CertificateProfile/patch/Update Certificate Profile +@try_manual +def step_certificate_profile_update(test, rg, checks=None): # pylint: disable=unused-argument + if checks is None: + checks = [] + test.cmd('az codesigning certificate-profile update ' + '--common-name "Contoso" ' + '--profile-type "Test" ' + '--subject-alternative-name "Contoso Corporate Engineering" ' + '--account-name "MyAccount" ' + '--profile-name "profileA" ' + '--resource-group "{rg}"', + checks=checks) + + # EXAMPLE: /CertificateProfile/delete/Delete Certificate Profile @try_manual -def step_certificate_profile_delete(test, rg, checks=None): +def step_certificate_profile_delete(test, rg, checks=None): # pylint: disable=unused-argument if checks is None: checks = [] test.cmd('az codesigning certificate-profile delete -y ' @@ -61,20 +79,19 @@ def step_certificate_profile_delete(test, rg, checks=None): # EXAMPLE: /CodeSignAccount/put/Create Code Sign Account @try_manual -def step_create(test, rg, checks=None): +def step_create(test, rg, checks=None): # pylint: disable=unused-argument if checks is None: checks = [] test.cmd('az codesigning create ' '--account-name "MyAccount" ' '--location "eastus" ' - '--tags key1="value1" ' '--resource-group "{rg}"', checks=checks) # EXAMPLE: /CodeSignAccount/get/Get Code Sign Account @try_manual -def step_show(test, rg, checks=None): +def step_show(test, rg, checks=None): # pylint: disable=unused-argument if checks is None: checks = [] test.cmd('az codesigning show ' @@ -85,7 +102,7 @@ def step_show(test, rg, checks=None): # EXAMPLE: /CodeSignAccount/get/List Code Sign Accounts by Resource Group @try_manual -def step_list(test, rg, checks=None): +def step_list(test, rg, checks=None): # pylint: disable=unused-argument if checks is None: checks = [] test.cmd('az codesigning list ' @@ -95,7 +112,7 @@ def step_list(test, rg, checks=None): # EXAMPLE: /CodeSignAccount/get/List Code Sign Accounts by Subscription @try_manual -def step_list2(test, rg, checks=None): +def step_list2(test, rg, checks=None): # pylint: disable=unused-argument if checks is None: checks = [] test.cmd('az codesigning list ' @@ -105,22 +122,31 @@ def step_list2(test, rg, checks=None): # EXAMPLE: /CodeSignAccount/patch/Update Code Sign Account @try_manual -def step_update(test, rg, checks=None): +def step_update(test, rg, checks=None): # pylint: disable=unused-argument if checks is None: checks = [] test.cmd('az codesigning update ' - '--account-name "MyAccount" ' '--tags key1="value1" ' + '--account-name "MyAccount" ' '--resource-group "{rg}"', checks=checks) # EXAMPLE: /CodeSignAccount/delete/Delete Code Sign Account @try_manual -def step_delete(test, rg, checks=None): +def step_delete(test, rg, checks=None): # pylint: disable=unused-argument if checks is None: checks = [] test.cmd('az codesigning delete -y ' '--account-name "MyAccount" ' '--resource-group "{rg}"', checks=checks) + + +# EXAMPLE: /Operations/get/List Code Sign Account operations +@try_manual +def step_operation_show(test, rg, checks=None): # pylint: disable=unused-argument + if checks is None: + checks = [] + test.cmd('az codesigning operation show', + checks=checks) diff --git a/src/codesigning/azext_codesigning/tests/latest/recordings/test_codesigning_Scenario.yaml b/src/codesigning/azext_codesigning/tests/latest/recordings/test_codesigning_Scenario.yaml index 6ed860832c2..55335dd8fdd 100644 --- a/src/codesigning/azext_codesigning/tests/latest/recordings/test_codesigning_Scenario.yaml +++ b/src/codesigning/azext_codesigning/tests/latest/recordings/test_codesigning_Scenario.yaml @@ -39,13 +39,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 05 Mar 2021 15:03:20 GMT + - Fri, 12 Mar 2021 11:22:26 GMT p3p: - CP="DSP CUR OTPi IND OTRi ONL FIN" set-cookie: - - fpc=AgJKcLNYhlhIls8c1QxHDIs; expires=Sun, 04-Apr-2021 15:03:20 GMT; path=/; + - fpc=Ap37vIXv_rROrKy8fE5RCQQ; expires=Sun, 11-Apr-2021 11:22:26 GMT; path=/; secure; HttpOnly; SameSite=None - - esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrgEOuOTGAZ7QopelHweDkky0OOq1mgsLXeahrjTq1Oeu4dc1Z8uWDTMAszUnT_CkZ58zWF9gbPeweVYDVt55L6apLDSCClfaW5c-T-cJHzZf5ltM7WmvTLfhASJoPQvAZf9FNwLZqOxcdN8D2-GsSYJaszzS19UlqoEIQsdqy9m4gAA; + - esctx=AQABAAAAAAD--DLA3VO7QrddgJg7Wevr6t3f-QdW1HJIPY1d1V1oE46nKlvwOjcC6ys-MuPTAfoMGkBdvC83Rnn2FztpSU8uGrvAeciQh8v0G9_N683rhJiFVSCglDMK-3PPtWCf0b9lWDL1gh98rAwgQfbQj6RMzaA4cxlb5x_i1f_GzN_t4TRueCG-Az8GOvTo2oOlLoEgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None - x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly - stsservicecookie=estsfd; path=/; secure; samesite=none; httponly @@ -54,12 +54,12 @@ interactions: x-content-type-options: - nosniff x-ms-ests-server: - - 2.1.11530.15 - KRSLR2 ProdSlices + - 2.1.11562.6 - SEASLR2 ProdSlices status: code: 200 message: OK - request: - body: '{"tags": {"key1": "value1"}, "location": "eastus"}' + body: '{"location": "eastus"}' headers: Accept: - application/json @@ -70,40 +70,38 @@ interactions: Connection: - keep-alive Content-Length: - - '50' + - '22' Content-Type: - application/json ParameterSetName: - - --account-name --location --tags --resource-group + - --account-name --location --resource-group User-Agent: - AZURECLI/2.17.1 azsdk-python-mgmt-codesigning/0.1.0 Python/3.7.9 (Windows-10-10.0.19041-SP0) method: PUT uri: https://api-dogfood.resources.windows-int.net/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.CodeSigning/codeSignAccounts/MyAccount?api-version=2020-12-14-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.CodeSigning/codeSignAccounts/MyAccount","name":"MyAccount","type":"Microsoft.CodeSigning/codeSignAccounts","location":"eastus","tags":{"key1":"value1"},"systemData":{"createdBy":"billtest124476@outlook.com","createdByType":"User","createdAt":"2021-03-05T15:03:25.0197596Z","lastModifiedBy":"billtest124476@outlook.com","lastModifiedByType":"User","lastModifiedAt":"2021-03-05T15:03:25.0197596Z"},"properties":{"accountName":"MyAccount","accountUrl":null,"provisioningState":"Succeeded"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.CodeSigning/codeSignAccounts/MyAccount","name":"MyAccount","type":"Microsoft.CodeSigning/codeSignAccounts","location":"eastus","systemData":{"createdBy":"billtest124476@outlook.com","createdByType":"User","createdAt":"2021-03-12T11:22:30.4322131Z","lastModifiedBy":"billtest124476@outlook.com","lastModifiedByType":"User","lastModifiedAt":"2021-03-12T11:22:30.4322131Z"},"properties":{"accountUri":null,"provisioningState":"Succeeded","verificationStatus":"NotCompleted"}}' headers: cache-control: - no-cache content-length: - - '657' + - '642' content-type: - application/json; charset=utf-8 date: - - Fri, 05 Mar 2021 15:03:27 GMT + - Fri, 12 Mar 2021 11:22:35 GMT etag: - - '"df00765e-0000-0700-0000-6042483f0000"' + - '"2900f273-0000-0700-0000-604b4efb0000"' expires: - '-1' pragma: - no-cache request-context: - appId=cid-v1:c73a5c90-b6dd-400a-b5e1-6c06fd162b47 - server: - - Kestrel set-cookie: - - ARRAffinity=684b4944ceab4636e2b792fe6045b6c7d40594baa8d10298f020586a9d3181da;Path=/;HttpOnly;Secure;Domain=codesigning-userrp-ppe.azurewebsites.net - - ARRAffinitySameSite=684b4944ceab4636e2b792fe6045b6c7d40594baa8d10298f020586a9d3181da;Path=/;HttpOnly;SameSite=None;Secure;Domain=codesigning-userrp-ppe.azurewebsites.net + - ARRAffinity=2d343760a8ed36b0212d0c52481d1fee3a42070a07d1709749e873bd7238f130;Path=/;HttpOnly;Secure;Domain=codesigning-userrp-ppe.azurewebsites.net + - ARRAffinitySameSite=2d343760a8ed36b0212d0c52481d1fee3a42070a07d1709749e873bd7238f130;Path=/;HttpOnly;SameSite=None;Secure;Domain=codesigning-userrp-ppe.azurewebsites.net strict-transport-security: - max-age=31536000; includeSubDomains transfer-encoding: @@ -112,8 +110,10 @@ interactions: - Accept-Encoding,Accept-Encoding x-content-type-options: - nosniff + x-ms-providerhub-traffic: + - 'True' x-ms-ratelimit-remaining-subscription-writes: - - '1199' + - '1198' x-powered-by: - ASP.NET status: @@ -159,13 +159,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 05 Mar 2021 15:03:28 GMT + - Fri, 12 Mar 2021 11:22:35 GMT p3p: - CP="DSP CUR OTPi IND OTRi ONL FIN" set-cookie: - - fpc=As5niDM-ZX5IpgUawFtIdZg; expires=Sun, 04-Apr-2021 15:03:28 GMT; path=/; + - fpc=Aj5Du2BfUeVLroZ96eisimk; expires=Sun, 11-Apr-2021 11:22:36 GMT; path=/; secure; HttpOnly; SameSite=None - - esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevroG9Bdz4ZtOtAh7ROqWEYuMG3dZwJvpvQMmkY-i3tHL0gWbGXpkGilNpaR7Zgm91QG70-gZBqes6UthL0wtC5_97obSm12JPTGO3mDkEAHKJHmDJr4t4emkWKDoLSOUM4BNRaBm62PLhjuF0C2NcxGiOvv2Dt-dLGpTkyo94Mdr4gAA; + - esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevretesaV-WtcTdjoumOBcQ5isyRO8d1qmIsleGPucuSDrO8ZRfpDFr7F_9aRfp_0ukJCvqcBuzXJB1ZgwOXK1GLhL04OO4exTFv9w71ibK4I0VlOKKB14TXTQsYspnp_JSiTzOJzPz0_ft_Fo4HseYtMHSXwsQaoNtYegFeqdMssogAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None - x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly - stsservicecookie=estsfd; path=/; secure; samesite=none; httponly @@ -174,7 +174,7 @@ interactions: x-content-type-options: - nosniff x-ms-ests-server: - - 2.1.11530.15 - SEASLR2 ProdSlices + - 2.1.11562.6 - KRSLR2 ProdSlices status: code: 200 message: OK @@ -197,24 +197,22 @@ interactions: uri: https://api-dogfood.resources.windows-int.net/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.CodeSigning/codeSignAccounts/MyAccount?api-version=2020-12-14-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.CodeSigning/codeSignAccounts/MyAccount","name":"MyAccount","type":"Microsoft.CodeSigning/codeSignAccounts","location":"eastus","tags":{"key1":"value1"},"systemData":{"createdBy":"billtest124476@outlook.com","createdByType":"User","createdAt":"2021-03-05T15:03:25.0197596Z","lastModifiedBy":"billtest124476@outlook.com","lastModifiedByType":"User","lastModifiedAt":"2021-03-05T15:03:25.0197596Z"},"properties":{"accountName":"MyAccount","accountUrl":null,"provisioningState":"Succeeded"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.CodeSigning/codeSignAccounts/MyAccount","name":"MyAccount","type":"Microsoft.CodeSigning/codeSignAccounts","location":"eastus","systemData":{"createdBy":"billtest124476@outlook.com","createdByType":"User","createdAt":"2021-03-12T11:22:30.4322131Z","lastModifiedBy":"billtest124476@outlook.com","lastModifiedByType":"User","lastModifiedAt":"2021-03-12T11:22:30.4322131Z"},"properties":{"accountUri":null,"provisioningState":"Succeeded","verificationStatus":"NotCompleted"}}' headers: cache-control: - no-cache content-length: - - '657' + - '642' content-type: - application/json; charset=utf-8 date: - - Fri, 05 Mar 2021 15:03:29 GMT + - Fri, 12 Mar 2021 11:22:37 GMT etag: - - '"df00765e-0000-0700-0000-6042483f0000"' + - '"2900f273-0000-0700-0000-604b4efb0000"' expires: - '-1' pragma: - no-cache - server: - - Kestrel strict-transport-security: - max-age=31536000; includeSubDomains transfer-encoding: @@ -223,6 +221,8 @@ interactions: - Accept-Encoding x-content-type-options: - nosniff + x-ms-providerhub-traffic: + - 'True' status: code: 200 message: OK @@ -266,13 +266,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 05 Mar 2021 15:03:29 GMT + - Fri, 12 Mar 2021 11:22:37 GMT p3p: - CP="DSP CUR OTPi IND OTRi ONL FIN" set-cookie: - - fpc=AvyKw9IswodElM6YI_X-Oo4; expires=Sun, 04-Apr-2021 15:03:30 GMT; path=/; + - fpc=AvxZ4XTuuntGgijvVb7GX9Q; expires=Sun, 11-Apr-2021 11:22:38 GMT; path=/; secure; HttpOnly; SameSite=None - - esctx=AQABAAAAAAD--DLA3VO7QrddgJg7Wevrrj3W5uYNdjZbIEXuRv5wZoe0k6r84lZ-Gpv8vdq6Mk962_a5WBpPuEXkZflBLKlWAebERTUrEBZg4RQuoX0HeSLiLfY1AKSJzNr6_0NYA6Kp-oIAIlhqFU8VmJ_EiTMpsmlf-yHRneItXhaMD0LAtuJQ4fqtPp0Jt6-CQs_153cgAA; + - esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrTUFmopAqaAzurc9475VrbTaFq8FlsFKW7l1i-_uuMzdlfnggXsa4uhrTRGhUejTDmovfxWev6nVTA_ToOWPCA5jL5McDGj9MZRpD_M0xp0ftyKv7xnMQ338SxLI-yz37iWJpXt-bDTKDxelLAxI5uWOaeG6VvVh5vIoi6xWdwkkgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None - x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly - stsservicecookie=estsfd; path=/; secure; samesite=none; httponly @@ -281,7 +281,7 @@ interactions: x-content-type-options: - nosniff x-ms-ests-server: - - 2.1.11530.15 - KRSLR2 ProdSlices + - 2.1.11562.6 - SEASLR2 ProdSlices status: code: 200 message: OK @@ -304,16 +304,16 @@ interactions: uri: https://api-dogfood.resources.windows-int.net/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.CodeSigning/codeSignAccounts?api-version=2020-12-14-preview response: body: - string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.CodeSigning/codeSignAccounts/MyAccount","name":"MyAccount","type":"Microsoft.CodeSigning/codeSignAccounts","location":"eastus","tags":{"key1":"value1"},"systemData":{"createdBy":"billtest124476@outlook.com","createdByType":"User","createdAt":"2021-03-05T15:03:25.0197596Z","lastModifiedBy":"billtest124476@outlook.com","lastModifiedByType":"User","lastModifiedAt":"2021-03-05T15:03:25.0197596Z"},"properties":{"accountName":"MyAccount","accountUrl":null,"provisioningState":"Succeeded"}}]}' + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.CodeSigning/codeSignAccounts/MyAccount","name":"MyAccount","type":"Microsoft.CodeSigning/codeSignAccounts","location":"eastus","systemData":{"createdBy":"billtest124476@outlook.com","createdByType":"User","createdAt":"2021-03-12T11:22:30.4322131Z","lastModifiedBy":"billtest124476@outlook.com","lastModifiedByType":"User","lastModifiedAt":"2021-03-12T11:22:30.4322131Z"},"properties":{"accountUri":null,"provisioningState":"Succeeded","verificationStatus":"NotCompleted"}}]}' headers: cache-control: - no-cache content-length: - - '669' + - '654' content-type: - application/json; charset=utf-8 date: - - Fri, 05 Mar 2021 15:03:31 GMT + - Fri, 12 Mar 2021 11:22:38 GMT expires: - '-1' pragma: @@ -325,9 +325,9 @@ interactions: x-content-type-options: - nosniff x-ms-original-request-ids: - - d649d12a-adec-4a10-b2c0-d7459ed6484f - - 89b58c4f-1e33-4f5f-b204-11c360797d73 - - b87a8c69-2cdf-4b4b-a946-f686cf85286b + - 59c73fef-75c0-4926-a196-cdeddc84a9a8 + - 379c371c-e986-4acf-bc49-c083797fa72f + - 5df4f8e8-9af8-4f55-80f6-ec1748a45302 status: code: 200 message: OK @@ -371,13 +371,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 05 Mar 2021 15:03:31 GMT + - Fri, 12 Mar 2021 11:22:39 GMT p3p: - CP="DSP CUR OTPi IND OTRi ONL FIN" set-cookie: - - fpc=AjY2Qge5GbBBq414Lk6-c3g; expires=Sun, 04-Apr-2021 15:03:31 GMT; path=/; + - fpc=AutvPYazASFGr67783hcWvo; expires=Sun, 11-Apr-2021 11:22:39 GMT; path=/; secure; HttpOnly; SameSite=None - - esctx=AQABAAAAAAD--DLA3VO7QrddgJg7Wevrdr8sz5orvWOM3VvWofB_0z6OK5Tyrep0jZBY-s5D6Mok9G-7FDiBn-YACioxWepSfvlNQWKurQqzdgeevlWeuFcYt9VSCjH5qwxQF_QvzAh-696rO6i79yShBYQz-V34IaRM5O7EAz9XwzhiW6tfprtRdpq00QfYjVQOSV1ycwYgAA; + - esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrP_LRsHmoCYuJRfDl_1uZY1m2uGcVN8nJqMszR4GAY4mffzXeG12wVzjmAyz8PbYQ7Tmhnr8GQdkFQsNozUoIm0qDq2fgDPzLDlcgbxs8fV4kdTTkQxG724PH0PU3vvjVZWy39qtbveQpeoWIM6O-umQa3OZUhOa8CZTR9zCk7Z0gAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None - x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly - stsservicecookie=estsfd; path=/; secure; samesite=none; httponly @@ -386,7 +386,7 @@ interactions: x-content-type-options: - nosniff x-ms-ests-server: - - 2.1.11513.17 - KRSLR1 ProdSlices + - 2.1.11562.6 - SEASLR1 ProdSlices status: code: 200 message: OK @@ -409,16 +409,16 @@ interactions: uri: https://api-dogfood.resources.windows-int.net/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CodeSigning/codeSignAccounts?api-version=2020-12-14-preview response: body: - string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/dogfoodRG/providers/Microsoft.CodeSigning/codeSignAccounts/Test1","name":"Test1","type":"Microsoft.CodeSigning/codeSignAccounts","location":"eastus","systemData":{"createdBy":"billtest124476@outlook.com","createdByType":"User","createdAt":"2021-01-05T12:24:35.1626638Z","lastModifiedBy":"billtest124476@outlook.com","lastModifiedByType":"User","lastModifiedAt":"2021-01-05T12:37:29.1978003Z"},"properties":{"provisioningState":"Succeeded"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/dogfoodRG/providers/Microsoft.CodeSigning/codeSignAccounts/Vishi1","name":"Vishi1","type":"Microsoft.CodeSigning/codeSignAccounts","location":"eastus","systemData":{"createdBy":"billtest124476@outlook.com","createdByType":"User","createdAt":"2021-01-12T11:27:13.5985295Z","lastModifiedBy":"billtest124476@outlook.com","lastModifiedByType":"User","lastModifiedAt":"2021-01-12T11:27:13.5985295Z"},"properties":{"accountName":"Vishi1","provisioningState":"Succeeded"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/dogfoodRG/providers/Microsoft.CodeSigning/codeSignAccounts/csaCli2","name":"csaCli2","type":"Microsoft.CodeSigning/codeSignAccounts","location":"eastus","systemData":{"createdBy":"billtest124476@outlook.com","createdByType":"User","createdAt":"2021-01-19T07:08:10.6124865Z","lastModifiedBy":"billtest124476@outlook.com","lastModifiedByType":"User","lastModifiedAt":"2021-01-19T07:08:10.6124865Z"},"properties":{"accountName":null,"provisioningState":"Succeeded"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/amritaRG/providers/Microsoft.CodeSigning/codeSignAccounts/acc100","name":"acc100","type":"Microsoft.CodeSigning/codeSignAccounts","location":"eastus","systemData":{"createdBy":"billtest124476@outlook.com","createdByType":"User","createdAt":"2021-03-04T06:11:47.0605817Z","lastModifiedBy":"billtest124476@outlook.com","lastModifiedByType":"User","lastModifiedAt":"2021-03-04T06:11:47.0605817Z"},"properties":{"accountName":"acc100","accountUrl":null,"provisioningState":"Succeeded"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/demo2/providers/Microsoft.CodeSigning/codeSignAccounts/account1","name":"account1","type":"Microsoft.CodeSigning/codeSignAccounts","location":"eastus","systemData":{"createdBy":"Test1@billtest124476outlook.ccsctp.net","createdByType":"User","createdAt":"2021-03-04T07:54:17.9029536Z","lastModifiedBy":"Test1@billtest124476outlook.ccsctp.net","lastModifiedByType":"User","lastModifiedAt":"2021-03-04T07:54:17.9029536Z"},"properties":{"accountName":"account1","accountUrl":null,"provisioningState":"Succeeded"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/demo1/providers/Microsoft.CodeSigning/codeSignAccounts/account1","name":"account1","type":"Microsoft.CodeSigning/codeSignAccounts","location":"eastus","systemData":{"createdBy":"billtest124476@outlook.com","createdByType":"User","createdAt":"2021-03-04T09:20:03.1101648Z","lastModifiedBy":"billtest124476@outlook.com","lastModifiedByType":"User","lastModifiedAt":"2021-03-04T09:20:03.1101648Z"},"properties":{"accountName":"account1","accountUrl":null,"provisioningState":"Succeeded"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/amritaRG/providers/Microsoft.CodeSigning/codeSignAccounts/account1","name":"account1","type":"Microsoft.CodeSigning/codeSignAccounts","location":"eastus","systemData":{"createdBy":"billtest124476@outlook.com","createdByType":"User","createdAt":"2021-03-04T09:57:17.4666379Z","lastModifiedBy":"billtest124476@outlook.com","lastModifiedByType":"User","lastModifiedAt":"2021-03-04T09:57:17.4666379Z"},"properties":{"accountName":"account1","accountUrl":null,"provisioningState":"Succeeded"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/amritaRG/providers/Microsoft.CodeSigning/codeSignAccounts/acc101","name":"acc101","type":"Microsoft.CodeSigning/codeSignAccounts","location":"eastus","systemData":{"createdBy":"billtest124476@outlook.com","createdByType":"User","createdAt":"2021-03-05T04:01:20.0447626Z","lastModifiedBy":"billtest124476@outlook.com","lastModifiedByType":"User","lastModifiedAt":"2021-03-05T04:01:20.0447626Z"},"properties":{"accountName":"acc101","accountUrl":null,"provisioningState":"Succeeded"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.CodeSigning/codeSignAccounts/MyAccount","name":"MyAccount","type":"Microsoft.CodeSigning/codeSignAccounts","location":"eastus","tags":{"key1":"value1"},"systemData":{"createdBy":"billtest124476@outlook.com","createdByType":"User","createdAt":"2021-03-05T15:03:25.0197596Z","lastModifiedBy":"billtest124476@outlook.com","lastModifiedByType":"User","lastModifiedAt":"2021-03-05T15:03:25.0197596Z"},"properties":{"accountName":"MyAccount","accountUrl":null,"provisioningState":"Succeeded"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/dogfoodRG/providers/Microsoft.CodeSigning/codeSignAccounts/Vishi2","name":"Vishi2","type":"Microsoft.CodeSigning/codeSignAccounts","location":"westus","systemData":{"createdBy":"billtest124476@outlook.com","createdByType":"User","createdAt":"2021-01-13T07:48:17.6792347Z","lastModifiedBy":"billtest124476@outlook.com","lastModifiedByType":"User","lastModifiedAt":"2021-01-13T07:48:17.6792347Z"},"properties":{"accountName":"Vishi2","provisioningState":"Succeeded"}}]}' + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/dogfoodRG/providers/Microsoft.CodeSigning/codeSignAccounts/Test1","name":"Test1","type":"Microsoft.CodeSigning/codeSignAccounts","location":"eastus","systemData":{"createdBy":"billtest124476@outlook.com","createdByType":"User","createdAt":"2021-01-05T12:24:35.1626638Z","lastModifiedBy":"billtest124476@outlook.com","lastModifiedByType":"User","lastModifiedAt":"2021-01-05T12:37:29.1978003Z"},"properties":{"provisioningState":"Succeeded"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/dogfoodRG/providers/Microsoft.CodeSigning/codeSignAccounts/Vishi1","name":"Vishi1","type":"Microsoft.CodeSigning/codeSignAccounts","location":"eastus","systemData":{"createdBy":"billtest124476@outlook.com","createdByType":"User","createdAt":"2021-01-12T11:27:13.5985295Z","lastModifiedBy":"billtest124476@outlook.com","lastModifiedByType":"User","lastModifiedAt":"2021-01-12T11:27:13.5985295Z"},"properties":{"provisioningState":"Succeeded"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/dogfoodRG/providers/Microsoft.CodeSigning/codeSignAccounts/csaCli2","name":"csaCli2","type":"Microsoft.CodeSigning/codeSignAccounts","location":"eastus","systemData":{"createdBy":"billtest124476@outlook.com","createdByType":"User","createdAt":"2021-01-19T07:08:10.6124865Z","lastModifiedBy":"billtest124476@outlook.com","lastModifiedByType":"User","lastModifiedAt":"2021-01-19T07:08:10.6124865Z"},"properties":{"provisioningState":"Succeeded"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/amritaRG/providers/Microsoft.CodeSigning/codeSignAccounts/acc100","name":"acc100","type":"Microsoft.CodeSigning/codeSignAccounts","location":"eastus","systemData":{"createdBy":"billtest124476@outlook.com","createdByType":"User","createdAt":"2021-03-04T06:11:47.0605817Z","lastModifiedBy":"billtest124476@outlook.com","lastModifiedByType":"User","lastModifiedAt":"2021-03-04T06:11:47.0605817Z"},"properties":{"provisioningState":"Succeeded"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/demo2/providers/Microsoft.CodeSigning/codeSignAccounts/account1","name":"account1","type":"Microsoft.CodeSigning/codeSignAccounts","location":"eastus","systemData":{"createdBy":"Test1@billtest124476outlook.ccsctp.net","createdByType":"User","createdAt":"2021-03-04T07:54:17.9029536Z","lastModifiedBy":"Test1@billtest124476outlook.ccsctp.net","lastModifiedByType":"User","lastModifiedAt":"2021-03-04T07:54:17.9029536Z"},"properties":{"provisioningState":"Succeeded"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/demo1/providers/Microsoft.CodeSigning/codeSignAccounts/account1","name":"account1","type":"Microsoft.CodeSigning/codeSignAccounts","location":"eastus","systemData":{"createdBy":"billtest124476@outlook.com","createdByType":"User","createdAt":"2021-03-04T09:20:03.1101648Z","lastModifiedBy":"billtest124476@outlook.com","lastModifiedByType":"User","lastModifiedAt":"2021-03-04T09:20:03.1101648Z"},"properties":{"provisioningState":"Succeeded"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/amritaRG/providers/Microsoft.CodeSigning/codeSignAccounts/account1","name":"account1","type":"Microsoft.CodeSigning/codeSignAccounts","location":"eastus","systemData":{"createdBy":"billtest124476@outlook.com","createdByType":"User","createdAt":"2021-03-04T09:57:17.4666379Z","lastModifiedBy":"billtest124476@outlook.com","lastModifiedByType":"User","lastModifiedAt":"2021-03-04T09:57:17.4666379Z"},"properties":{"provisioningState":"Succeeded"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/amritaRG/providers/Microsoft.CodeSigning/codeSignAccounts/acc101","name":"acc101","type":"Microsoft.CodeSigning/codeSignAccounts","location":"eastus","systemData":{"createdBy":"billtest124476@outlook.com","createdByType":"User","createdAt":"2021-03-05T04:01:20.0447626Z","lastModifiedBy":"billtest124476@outlook.com","lastModifiedByType":"User","lastModifiedAt":"2021-03-05T04:01:20.0447626Z"},"properties":{"provisioningState":"Succeeded"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/amritaRG/providers/Microsoft.CodeSigning/codeSignAccounts/acc102","name":"acc102","type":"Microsoft.CodeSigning/codeSignAccounts","location":"eastus","systemData":{"createdBy":"billtest124476@outlook.com","createdByType":"User","createdAt":"2021-03-10T05:21:16.5057681Z","lastModifiedBy":"billtest124476@outlook.com","lastModifiedByType":"User","lastModifiedAt":"2021-03-10T05:21:16.5057681Z"},"properties":{"provisioningState":"Succeeded","verificationStatus":"Completed"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/amritaRG/providers/Microsoft.CodeSigning/codeSignAccounts/acc103","name":"acc103","type":"Microsoft.CodeSigning/codeSignAccounts","location":"eastus","systemData":{"createdBy":"billtest124476@outlook.com","createdByType":"User","createdAt":"2021-03-10T05:25:23.8047717Z","lastModifiedBy":"billtest124476@outlook.com","lastModifiedByType":"User","lastModifiedAt":"2021-03-10T05:25:23.8047717Z"},"properties":{"provisioningState":"Succeeded","verificationStatus":"Completed"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/amritaRG/providers/Microsoft.CodeSigning/codeSignAccounts/acc104","name":"acc104","type":"Microsoft.CodeSigning/codeSignAccounts","location":"eastus","systemData":{"createdBy":"billtest124476@outlook.com","createdByType":"User","createdAt":"2021-03-10T05:27:03.1974942Z","lastModifiedBy":"billtest124476@outlook.com","lastModifiedByType":"User","lastModifiedAt":"2021-03-10T05:27:03.1974942Z"},"properties":{"accountUri":null,"provisioningState":"Succeeded","verificationStatus":"NotCompleted"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRG/providers/Microsoft.CodeSigning/codeSignAccounts/accountOne","name":"accountOne","type":"Microsoft.CodeSigning/codeSignAccounts","location":"eastus","systemData":{"createdBy":"billtest124476@outlook.com","createdByType":"User","createdAt":"2021-03-10T06:05:54.8277608Z","lastModifiedBy":"billtest124476@outlook.com","lastModifiedByType":"User","lastModifiedAt":"2021-03-10T06:05:54.8277608Z"},"properties":{"provisioningState":"Succeeded","verificationStatus":"NotCompleted"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRG/providers/Microsoft.CodeSigning/codeSignAccounts/accountTwo","name":"accountTwo","type":"Microsoft.CodeSigning/codeSignAccounts","location":"eastus","systemData":{"createdBy":"billtest124476@outlook.com","createdByType":"User","createdAt":"2021-03-12T05:08:10.5588917Z","lastModifiedBy":"billtest124476@outlook.com","lastModifiedByType":"User","lastModifiedAt":"2021-03-12T05:08:10.5588917Z"},"properties":{"provisioningState":"Succeeded","verificationStatus":"NotCompleted"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRG/providers/Microsoft.CodeSigning/codeSignAccounts/accountThree","name":"accountThree","type":"Microsoft.CodeSigning/codeSignAccounts","location":"eastus","systemData":{"createdBy":"billtest124476@outlook.com","createdByType":"User","createdAt":"2021-03-12T06:30:28.9795167Z","lastModifiedBy":"billtest124476@outlook.com","lastModifiedByType":"User","lastModifiedAt":"2021-03-12T06:30:28.9795167Z"},"properties":{"provisioningState":"Accepted"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.CodeSigning/codeSignAccounts/MyAccount","name":"MyAccount","type":"Microsoft.CodeSigning/codeSignAccounts","location":"eastus","systemData":{"createdBy":"billtest124476@outlook.com","createdByType":"User","createdAt":"2021-03-12T11:22:30.4322131Z","lastModifiedBy":"billtest124476@outlook.com","lastModifiedByType":"User","lastModifiedAt":"2021-03-12T11:22:30.4322131Z"},"properties":{"accountUri":null,"provisioningState":"Succeeded","verificationStatus":"NotCompleted"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/dogfoodRG/providers/Microsoft.CodeSigning/codeSignAccounts/Vishi2","name":"Vishi2","type":"Microsoft.CodeSigning/codeSignAccounts","location":"westus","systemData":{"createdBy":"billtest124476@outlook.com","createdByType":"User","createdAt":"2021-01-13T07:48:17.6792347Z","lastModifiedBy":"billtest124476@outlook.com","lastModifiedByType":"User","lastModifiedAt":"2021-01-13T07:48:17.6792347Z"},"properties":{"provisioningState":"Succeeded"}}]}' headers: cache-control: - no-cache content-length: - - '5623' + - '8635' content-type: - application/json; charset=utf-8 date: - - Fri, 05 Mar 2021 15:03:32 GMT + - Fri, 12 Mar 2021 11:22:39 GMT expires: - '-1' pragma: @@ -430,9 +430,9 @@ interactions: x-content-type-options: - nosniff x-ms-original-request-ids: - - fc06db8b-2551-4f6f-be6d-d90f824e03f1 - - 667fa782-c043-47e6-a04f-ce90e4303e42 - - 0e688acd-baeb-46a8-a0af-4c72317f9778 + - 1392104e-d833-4ac6-9caa-c1c0414a2bb6 + - fc342ebc-cde9-4d31-915b-6e57d0b631d5 + - 01638f03-c364-4519-a5f1-22cac38e976b status: code: 200 message: OK @@ -476,13 +476,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 05 Mar 2021 15:03:31 GMT + - Fri, 12 Mar 2021 11:22:40 GMT p3p: - CP="DSP CUR OTPi IND OTRi ONL FIN" set-cookie: - - fpc=AjXLYIuie5pGs0Ipp_awvJ4; expires=Sun, 04-Apr-2021 15:03:32 GMT; path=/; + - fpc=AvzyOxbe5NZDskPG90qEuak; expires=Sun, 11-Apr-2021 11:22:40 GMT; path=/; secure; HttpOnly; SameSite=None - - esctx=AQABAAAAAAD--DLA3VO7QrddgJg7Wevrfj7DEt0aqgB1s2TGpHXLG_r4D8TJVWkMdXGUhzo_-7zl2SkLy_ZkrxhxK7TNRf_qb1Y30CbxseUQCqDjNaXgZhG8LugeuAbTe9AfONyeT3lVyiKi37HFub789uOjopDQP5VUn-6FWN8_EoKA5C3Credd3Te7p24gDd93-XlaxQIgAA; + - esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrAz4JZFSZAfJyy4AnHawlSUpJ1WflhZCrQkGGh-dRa0Fg4OWvPCO2NeAbSXNKkH1F67T9ORJXQSWCnFqIsHYpHhhKRoPkxPl99QNXFk179AsZXynJJlrnC4MR74mONskXXxtucnj_ikjJh4-JN-XpVBZY93acBFJ1_4kYd5X9mDMgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None - x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly - stsservicecookie=estsfd; path=/; secure; samesite=none; httponly @@ -491,7 +491,7 @@ interactions: x-content-type-options: - nosniff x-ms-ests-server: - - 2.1.11530.15 - SEASLR2 ProdSlices + - 2.1.11562.6 - SEASLR2 ProdSlices status: code: 200 message: OK @@ -511,31 +511,29 @@ interactions: Content-Type: - application/json ParameterSetName: - - --account-name --tags --resource-group + - --tags --account-name --resource-group User-Agent: - AZURECLI/2.17.1 azsdk-python-mgmt-codesigning/0.1.0 Python/3.7.9 (Windows-10-10.0.19041-SP0) method: PATCH uri: https://api-dogfood.resources.windows-int.net/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.CodeSigning/codeSignAccounts/MyAccount?api-version=2020-12-14-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.CodeSigning/codeSignAccounts/MyAccount","name":"MyAccount","type":"Microsoft.CodeSigning/codeSignAccounts","location":"eastus","tags":{"key1":"value1"},"systemData":{"createdBy":"billtest124476@outlook.com","createdByType":"User","createdAt":"2021-03-05T15:03:25.0197596Z","lastModifiedBy":"billtest124476@outlook.com","lastModifiedByType":"User","lastModifiedAt":"2021-03-05T15:03:34.4481263Z"},"properties":{"accountName":"MyAccount","accountUrl":null,"provisioningState":"Succeeded"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.CodeSigning/codeSignAccounts/MyAccount","name":"MyAccount","type":"Microsoft.CodeSigning/codeSignAccounts","location":"eastus","tags":{"key1":"value1"},"systemData":{"createdBy":"billtest124476@outlook.com","createdByType":"User","createdAt":"2021-03-12T11:22:30.4322131Z","lastModifiedBy":"billtest124476@outlook.com","lastModifiedByType":"User","lastModifiedAt":"2021-03-12T11:22:42.6376759Z"},"properties":{"accountUri":null,"provisioningState":"Succeeded","verificationStatus":"NotCompleted"}}' headers: cache-control: - no-cache content-length: - - '657' + - '667' content-type: - application/json; charset=utf-8 date: - - Fri, 05 Mar 2021 15:03:36 GMT + - Fri, 12 Mar 2021 11:22:44 GMT etag: - - '"df00985e-0000-0700-0000-604248460000"' + - '"2900fe74-0000-0700-0000-604b4f020000"' expires: - '-1' pragma: - no-cache - server: - - Kestrel strict-transport-security: - max-age=31536000; includeSubDomains transfer-encoding: @@ -544,6 +542,8 @@ interactions: - Accept-Encoding x-content-type-options: - nosniff + x-ms-providerhub-traffic: + - 'True' x-ms-ratelimit-remaining-subscription-writes: - '1199' status: @@ -589,13 +589,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 05 Mar 2021 15:03:36 GMT + - Fri, 12 Mar 2021 11:22:44 GMT p3p: - CP="DSP CUR OTPi IND OTRi ONL FIN" set-cookie: - - fpc=AudgpuKODTtOuR51UimVoP8; expires=Sun, 04-Apr-2021 15:03:36 GMT; path=/; + - fpc=ApwBukhM7g5Pg07jaHONaEQ; expires=Sun, 11-Apr-2021 11:22:44 GMT; path=/; secure; HttpOnly; SameSite=None - - esctx=AQABAAAAAAD--DLA3VO7QrddgJg7Wevr86Nse4kCXMu3OV07AyAFTYVRDzAzrxUOgswkyj4yL4vtGSPOh5DckNId54BSxG7L8gVYQXnzSSkTStml5-Up_EqMz-3IGNTJ_a-33jkBKQXB1Sq-iXT3V4rzdodka94QZgQKH-vnWBSxwTikbCNsYd7PM8Gy4DcAwrg5an4cwQMgAA; + - esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrUeniVKk9qEUbBq-5YcUb_har8LSARJmSLRztu33Xi4HckeXFR698W4H3Mg0e3IW20ict9yAXKuX5TPhq_0V0cGTtTZLf5wYiwyqNIVulMpV-AMGKEcTVHsIZK1s_ZspDmWLYtkqcu2SiVB3ALqETY9TjG90EsjkRE8w9GFufYcYgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None - x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly - stsservicecookie=estsfd; path=/; secure; samesite=none; httponly @@ -604,12 +604,13 @@ interactions: x-content-type-options: - nosniff x-ms-ests-server: - - 2.1.11530.15 - KRSLR2 ProdSlices + - 2.1.11562.6 - SEASLR2 ProdSlices status: code: 200 message: OK - request: - body: '{"properties": {"rotationPolicy": "Monthly"}}' + body: '{"properties": {"profileType": "PublicTrust", "rotationPolicy": "Monthly", + "commonName": "Contoso", "subjectAlternativeName": "Contoso Corporate Engineering"}}' headers: Accept: - application/json @@ -620,40 +621,40 @@ interactions: Connection: - keep-alive Content-Length: - - '45' + - '159' Content-Type: - application/json ParameterSetName: - - --account-name --profile-name --resource-group + - --account-name --profile-name --common-name --profile-type --subject-alternative-name + --resource-group User-Agent: - AZURECLI/2.17.1 azsdk-python-mgmt-codesigning/0.1.0 Python/3.7.9 (Windows-10-10.0.19041-SP0) method: PUT uri: https://api-dogfood.resources.windows-int.net/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.CodeSigning/codeSignAccounts/MyAccount/certificateProfiles/profileA?api-version=2020-12-14-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.CodeSigning/codeSignAccounts/MyAccount/certificateProfiles/profileA","name":"profileA","type":"Microsoft.CodeSigning/codeSignAccounts/certificateProfiles","systemData":{"createdBy":"billtest124476@outlook.com","createdByType":"User","createdAt":"2021-03-05T15:03:37.8791151Z","lastModifiedBy":"billtest124476@outlook.com","lastModifiedByType":"User","lastModifiedAt":"2021-03-05T15:03:37.8791151Z"},"properties":{"profileName":"profileA","authority":null,"commonName":null,"organization":null,"subjectAlternativeName":null,"streetAddress":null,"country":null,"state":null,"city":null,"provisioningState":"Succeeded"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.CodeSigning/codeSignAccounts/MyAccount/certificateProfiles/profileA","name":"profileA","type":"Microsoft.CodeSigning/codeSignAccounts/certificateProfiles","systemData":{"createdBy":"billtest124476@outlook.com","createdByType":"User","createdAt":"2021-03-12T11:22:45.9106409Z","lastModifiedBy":"billtest124476@outlook.com","lastModifiedByType":"User","lastModifiedAt":"2021-03-12T11:22:45.9106409Z"},"properties":{"profileType":"PublicTrust","rotationPolicy":"Monthly","authority":null,"commonName":"Contoso","organization":null,"subjectAlternativeName":"Contoso + Corporate Engineering","streetAddress":null,"country":null,"state":null,"city":null,"provisioningState":"Succeeded","certificates":[]}}' headers: cache-control: - no-cache content-length: - - '787' + - '867' content-type: - application/json; charset=utf-8 date: - - Fri, 05 Mar 2021 15:03:38 GMT + - Fri, 12 Mar 2021 11:22:47 GMT etag: - - '"20022f42-0000-0700-0000-6042484a0000"' + - '"0100c67b-0000-0700-0000-604b4f070000"' expires: - '-1' pragma: - no-cache request-context: - appId=cid-v1:c73a5c90-b6dd-400a-b5e1-6c06fd162b47 - server: - - Kestrel set-cookie: - - ARRAffinity=684b4944ceab4636e2b792fe6045b6c7d40594baa8d10298f020586a9d3181da;Path=/;HttpOnly;Secure;Domain=codesigning-userrp-ppe.azurewebsites.net - - ARRAffinitySameSite=684b4944ceab4636e2b792fe6045b6c7d40594baa8d10298f020586a9d3181da;Path=/;HttpOnly;SameSite=None;Secure;Domain=codesigning-userrp-ppe.azurewebsites.net + - ARRAffinity=2d343760a8ed36b0212d0c52481d1fee3a42070a07d1709749e873bd7238f130;Path=/;HttpOnly;Secure;Domain=codesigning-userrp-ppe.azurewebsites.net + - ARRAffinitySameSite=2d343760a8ed36b0212d0c52481d1fee3a42070a07d1709749e873bd7238f130;Path=/;HttpOnly;SameSite=None;Secure;Domain=codesigning-userrp-ppe.azurewebsites.net strict-transport-security: - max-age=31536000; includeSubDomains transfer-encoding: @@ -662,6 +663,8 @@ interactions: - Accept-Encoding,Accept-Encoding x-content-type-options: - nosniff + x-ms-providerhub-traffic: + - 'True' x-ms-ratelimit-remaining-subscription-writes: - '1199' x-powered-by: @@ -709,13 +712,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 05 Mar 2021 15:03:39 GMT + - Fri, 12 Mar 2021 11:22:47 GMT p3p: - CP="DSP CUR OTPi IND OTRi ONL FIN" set-cookie: - - fpc=ArykUEVLcpxEhWMwe9DaYxs; expires=Sun, 04-Apr-2021 15:03:39 GMT; path=/; + - fpc=An8xTnnig3dMqXvNbMNg9I0; expires=Sun, 11-Apr-2021 11:22:47 GMT; path=/; secure; HttpOnly; SameSite=None - - esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrsA5bRmNwlzL9o0MS4T5P95Uv0_inYYm8VSJj4sWvEiYHVWugA6I2RZfWH61KmUJjXOQKRc2jQ4So7atF1M-NEv4hIqeTzZ4iT_Y6jr2aHDKOMPwxGVxM47E-KsM2QuL8QHIkq0YD1dBaD5sIjvT8YHoPo0jRYHEyNQItoPqQDscgAA; + - esctx=AQABAAAAAAD--DLA3VO7QrddgJg7Wevrbi39270RTStaSplljfny1oLrG4zH5w54V8z7XU7VhsfZ-B3Z1m4uUqDILsdw9-RH_uVZE04nX75cNRdeYhG32r3vaZfPbLBBgXpO_zIzZtKzf0qPHmvsiLWstmhBUxwoVAabVNa3CbTfXD8L77i9FFMiUNBcmMb4Kc16oVS5X-QgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None - x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly - stsservicecookie=estsfd; path=/; secure; samesite=none; httponly @@ -724,7 +727,7 @@ interactions: x-content-type-options: - nosniff x-ms-ests-server: - - 2.1.11530.15 - KRSLR1 ProdSlices + - 2.1.11562.6 - KRSLR1 ProdSlices status: code: 200 message: OK @@ -747,24 +750,23 @@ interactions: uri: https://api-dogfood.resources.windows-int.net/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.CodeSigning/codeSignAccounts/MyAccount/certificateProfiles/profileA?api-version=2020-12-14-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.CodeSigning/codeSignAccounts/MyAccount/certificateProfiles/profileA","name":"profileA","type":"Microsoft.CodeSigning/codeSignAccounts/certificateProfiles","systemData":{"createdBy":"billtest124476@outlook.com","createdByType":"User","createdAt":"2021-03-05T15:03:37.8791151Z","lastModifiedBy":"billtest124476@outlook.com","lastModifiedByType":"User","lastModifiedAt":"2021-03-05T15:03:37.8791151Z"},"properties":{"profileName":"profileA","authority":null,"commonName":null,"organization":null,"subjectAlternativeName":null,"streetAddress":null,"country":null,"state":null,"city":null,"provisioningState":"Succeeded"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.CodeSigning/codeSignAccounts/MyAccount/certificateProfiles/profileA","name":"profileA","type":"Microsoft.CodeSigning/codeSignAccounts/certificateProfiles","systemData":{"createdBy":"billtest124476@outlook.com","createdByType":"User","createdAt":"2021-03-12T11:22:45.9106409Z","lastModifiedBy":"billtest124476@outlook.com","lastModifiedByType":"User","lastModifiedAt":"2021-03-12T11:22:45.9106409Z"},"properties":{"profileType":"PublicTrust","rotationPolicy":"Monthly","authority":null,"commonName":"Contoso","organization":null,"subjectAlternativeName":"Contoso + Corporate Engineering","streetAddress":null,"country":null,"state":null,"city":null,"provisioningState":"Succeeded","certificates":[]}}' headers: cache-control: - no-cache content-length: - - '787' + - '867' content-type: - application/json; charset=utf-8 date: - - Fri, 05 Mar 2021 15:03:40 GMT + - Fri, 12 Mar 2021 11:22:49 GMT etag: - - '"20022f42-0000-0700-0000-6042484a0000"' + - '"0100c67b-0000-0700-0000-604b4f070000"' expires: - '-1' pragma: - no-cache - server: - - Kestrel strict-transport-security: - max-age=31536000; includeSubDomains transfer-encoding: @@ -773,6 +775,8 @@ interactions: - Accept-Encoding x-content-type-options: - nosniff + x-ms-providerhub-traffic: + - 'True' status: code: 200 message: OK @@ -816,13 +820,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 05 Mar 2021 15:03:40 GMT + - Fri, 12 Mar 2021 11:22:48 GMT p3p: - CP="DSP CUR OTPi IND OTRi ONL FIN" set-cookie: - - fpc=Atyocg2IVZdHiT46s8Y9RM0; expires=Sun, 04-Apr-2021 15:03:41 GMT; path=/; + - fpc=Aq9W0FkD7pdFpXdgM_Yeh10; expires=Sun, 11-Apr-2021 11:22:49 GMT; path=/; secure; HttpOnly; SameSite=None - - esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrT9juzNXZwb7gAoghd03NWxQ4RTgz17BZ_ysVy8fNBbzTZwv3YNtGaCoIKqzFbSuYH85vW3NFAyftivMX-aoBsr_HrkR0r9bufWMz8jilc7VMKyjPRv8Egv-ixBBj0zYLnJnD_a75xn_Vp9lfaoTIAiC32gd1-BcfkYzuNT6_I0AgAA; + - esctx=AQABAAAAAAD--DLA3VO7QrddgJg7Wevr5QqBrAwfp2OnPbFEhX4KJHoecwU5sDNA5jnnncCVc8TtkN4q-W7_cgiiJAeTMgp_AwP9qsn8n5HYpaOYhjq7Hujr9Pp3PSqL3BvX7rSUbWYgcRYNNlfPOyc6aZ2cBzdy8hP469HpT1PHd_o8GHJjba5HayIhTc3UhTU4y-6RLTogAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None - x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly - stsservicecookie=estsfd; path=/; secure; samesite=none; httponly @@ -831,7 +835,7 @@ interactions: x-content-type-options: - nosniff x-ms-ests-server: - - 2.1.11530.15 - SEASLR2 ProdSlices + - 2.1.11562.6 - KRSLR2 ProdSlices status: code: 200 message: OK @@ -854,22 +858,249 @@ interactions: uri: https://api-dogfood.resources.windows-int.net/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.CodeSigning/codeSignAccounts/MyAccount/certificateProfiles?api-version=2020-12-14-preview response: body: - string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.CodeSigning/codeSignAccounts/MyAccount/certificateProfiles/profileA","name":"profileA","type":"Microsoft.CodeSigning/codeSignAccounts/certificateProfiles","systemData":{"createdBy":"billtest124476@outlook.com","createdByType":"User","createdAt":"2021-03-05T15:03:37.8791151Z","lastModifiedBy":"billtest124476@outlook.com","lastModifiedByType":"User","lastModifiedAt":"2021-03-05T15:03:37.8791151Z"},"properties":{"profileName":"profileA","authority":null,"commonName":null,"organization":null,"subjectAlternativeName":null,"streetAddress":null,"country":null,"state":null,"city":null,"provisioningState":"Succeeded"}}]}' + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.CodeSigning/codeSignAccounts/MyAccount/certificateProfiles/profileA","name":"profileA","type":"Microsoft.CodeSigning/codeSignAccounts/certificateProfiles","systemData":{"createdBy":"billtest124476@outlook.com","createdByType":"User","createdAt":"2021-03-12T11:22:45.9106409Z","lastModifiedBy":"billtest124476@outlook.com","lastModifiedByType":"User","lastModifiedAt":"2021-03-12T11:22:45.9106409Z"},"properties":{"profileType":"PublicTrust","rotationPolicy":"Monthly","authority":null,"commonName":"Contoso","organization":null,"subjectAlternativeName":"Contoso + Corporate Engineering","streetAddress":null,"country":null,"state":null,"city":null,"provisioningState":"Succeeded","certificates":[]}}]}' + headers: + cache-control: + - no-cache + content-length: + - '879' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 12 Mar 2021 11:22:50 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Charset: + - utf-8 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python-requests/2.22.0 + return-client-request-id: + - 'true' + x-client-CPU: + - x64 + x-client-OS: + - win32 + x-client-SKU: + - Python + x-client-Ver: + - 1.2.3 + method: GET + uri: https://login.microsoftonline.com/common/discovery/instance?authorization_endpoint=https%3A%2F%2Flogin.windows-ppe.net%2F8c0f0bff-5806-4d21-8802-ebe21a1afa4f%2Foauth2%2Fauthorize&api-version=1.0 + response: + body: + string: '{"tenant_discovery_endpoint":"https://login.windows-ppe.net/8c0f0bff-5806-4d21-8802-ebe21a1afa4f/.well-known/openid-configuration"}' + headers: + access-control-allow-methods: + - GET, OPTIONS + access-control-allow-origin: + - '*' + cache-control: + - max-age=86400, private + content-length: + - '131' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 12 Mar 2021 11:22:50 GMT + p3p: + - CP="DSP CUR OTPi IND OTRi ONL FIN" + set-cookie: + - fpc=Ag0z1Iy7JXJLgQhEjMRZ4_E; expires=Sun, 11-Apr-2021 11:22:51 GMT; path=/; + secure; HttpOnly; SameSite=None + - esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrY1cfbMMvgwyynCe7gB-O2cNk-upgNCuwuhuo-piYJXj0owGLVh8yhRZMGOA1T7N57PSKGjVf5iG8smRSm31G9_ifxwNmZfaAoxvg3jjsDuJBFKLgG3UUkNreqwMVAV_bNb-PBZ0fB92ybKPSy66Cvpf9G-xC8qzkqw85l4hkaq0gAA; + domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None + - x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly + - stsservicecookie=estsfd; path=/; secure; samesite=none; httponly + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ests-server: + - 2.1.11562.6 - KRSLR1 ProdSlices + status: + code: 200 + message: OK +- request: + body: '{"properties": {"profileType": "Test", "rotationPolicy": "Monthly", "commonName": + "Contoso", "subjectAlternativeName": "Contoso Corporate Engineering"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - codesigning certificate-profile update + Connection: + - keep-alive + Content-Length: + - '152' + Content-Type: + - application/json + ParameterSetName: + - --common-name --profile-type --subject-alternative-name --account-name --profile-name + --resource-group + User-Agent: + - AZURECLI/2.17.1 azsdk-python-mgmt-codesigning/0.1.0 Python/3.7.9 (Windows-10-10.0.19041-SP0) + method: PATCH + uri: https://api-dogfood.resources.windows-int.net/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.CodeSigning/codeSignAccounts/MyAccount/certificateProfiles/profileA?api-version=2020-12-14-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.CodeSigning/codeSignAccounts/MyAccount/certificateProfiles/profileA","name":"profileA","type":"Microsoft.CodeSigning/codeSignAccounts/certificateProfiles","systemData":{"createdBy":"billtest124476@outlook.com","createdByType":"User","createdAt":"2021-03-12T11:22:45.9106409Z","lastModifiedBy":"billtest124476@outlook.com","lastModifiedByType":"User","lastModifiedAt":"2021-03-12T11:22:52.3820988Z"},"properties":{"profileType":"Test","rotationPolicy":"Monthly","authority":null,"commonName":"Contoso","organization":null,"subjectAlternativeName":"Contoso + Corporate Engineering","streetAddress":null,"country":null,"state":null,"city":null,"provisioningState":"Succeeded","certificates":[]}}' + headers: + cache-control: + - no-cache + content-length: + - '860' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 12 Mar 2021 11:22:52 GMT + etag: + - '"0100d77b-0000-0700-0000-604b4f0c0000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Charset: + - utf-8 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python-requests/2.22.0 + return-client-request-id: + - 'true' + x-client-CPU: + - x64 + x-client-OS: + - win32 + x-client-SKU: + - Python + x-client-Ver: + - 1.2.3 + method: GET + uri: https://login.microsoftonline.com/common/discovery/instance?authorization_endpoint=https%3A%2F%2Flogin.windows-ppe.net%2F8c0f0bff-5806-4d21-8802-ebe21a1afa4f%2Foauth2%2Fauthorize&api-version=1.0 + response: + body: + string: '{"tenant_discovery_endpoint":"https://login.windows-ppe.net/8c0f0bff-5806-4d21-8802-ebe21a1afa4f/.well-known/openid-configuration"}' + headers: + access-control-allow-methods: + - GET, OPTIONS + access-control-allow-origin: + - '*' + cache-control: + - max-age=86400, private + content-length: + - '131' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 12 Mar 2021 11:22:52 GMT + p3p: + - CP="DSP CUR OTPi IND OTRi ONL FIN" + set-cookie: + - fpc=Ao94VW1YxjlEsHw8CslO4Fs; expires=Sun, 11-Apr-2021 11:22:53 GMT; path=/; + secure; HttpOnly; SameSite=None + - esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrOGyU7qPLbGg8TUAjVXQIHUxCEPkHMaeM58OZzDueoncacf3U7PU8qns6OYkeZky-12_FxjHPl06qQGCfKDsMpyNmgNtEvQu3sXXEfDQX6J13qegzd2DXsGBmF-CR4Vl2r2R9rBjl30Ebpi9zu32o9Wuq8Na5TWy1VUStjNdwwMEgAA; + domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None + - x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly + - stsservicecookie=estsfd; path=/; secure; samesite=none; httponly + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ests-server: + - 2.1.11562.6 - SEASLR1 ProdSlices + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - codesigning operation show + Connection: + - keep-alive + User-Agent: + - AZURECLI/2.17.1 azsdk-python-mgmt-codesigning/0.1.0 Python/3.7.9 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://api-dogfood.resources.windows-int.net/providers/Microsoft.CodeSigning/operations?api-version=2020-12-14-preview + response: + body: + string: '{"value":[{"name":"Microsoft.CodeSigning/codeSignAccounts/Read","isDataAction":false,"display":{"provider":"Microsoft.CodeSigning","resource":"codeSignAccounts","operation":"Gets/List + codeSignAccounts resources","description":"Read codeSignAccounts"},"properties":null},{"name":"Microsoft.CodeSigning/codeSignAccounts/Write","isDataAction":false,"display":{"provider":"Microsoft.CodeSigning","resource":"codeSignAccounts","operation":"Create/update + codeSignAccounts resources","description":"Writes codeSignAccounts"},"properties":null},{"name":"Microsoft.CodeSigning/codeSignAccounts/Delete","isDataAction":false,"display":{"provider":"Microsoft.CodeSigning","resource":"codeSignAccounts","operation":"Deletes + codeSignAccounts resource","description":"Deletes codeSignAccounts"},"properties":null},{"name":"Microsoft.CodeSigning/RegisteredSubscriptions/read","isDataAction":false,"display":{"provider":"Microsoft.CodeSigning","resource":"RegisteredSubscriptions","operation":"Gets/Lists + registered subscriptions","description":"Reads registered subscriptions"},"properties":null},{"name":"Microsoft.CodeSigning/certificateProfiles/Read","isDataAction":false,"display":{"provider":"Microsoft.CodeSigning","resource":"certificateProfiles","operation":"Gets/List + certificateProfiles resources","description":"Read certificateProfiles"},"properties":null},{"name":"Microsoft.CodeSigning/certificateProfiles/Write","isDataAction":false,"display":{"provider":"Microsoft.CodeSigning","resource":"certificateProfiles","operation":"Create/update + certificateProfiles resources","description":"Writes certificateProfiles"},"properties":null},{"name":"Microsoft.CodeSigning/certificateProfiles/Delete","isDataAction":false,"display":{"provider":"Microsoft.CodeSigning","resource":"certificateProfiles","operation":"Deletes + certificateProfiles resource","description":"Deletes certificateProfiles"},"properties":null},{"name":"Microsoft.CodeSigning/Locations/OperationStatuses/read","isDataAction":false,"display":{"provider":"Microsoft.CodeSigning","resource":"codeSignAccounts","operation":"Read + operation statuses of codeSignAccounts","description":"Read Operation Statuses"},"properties":null},{"name":"Microsoft.CodeSigning/Locations/OperationStatuses/write","isDataAction":false,"display":{"provider":"Microsoft.CodeSigning","resource":"codeSignAccounts","operation":"Write + operation statuses of codeSignAccounts","description":"Write Operation Statuses"},"properties":null}]}' headers: cache-control: - no-cache content-length: - - '799' + - '2470' content-type: - application/json; charset=utf-8 date: - - Fri, 05 Mar 2021 15:03:41 GMT + - Fri, 12 Mar 2021 11:22:54 GMT expires: - '-1' pragma: - no-cache - server: - - Kestrel strict-transport-security: - max-age=31536000; includeSubDomains transfer-encoding: @@ -878,6 +1109,8 @@ interactions: - Accept-Encoding x-content-type-options: - nosniff + x-ms-providerhub-traffic: + - 'True' status: code: 200 message: OK diff --git a/src/codesigning/azext_codesigning/tests/latest/test_codesigning_scenario.py b/src/codesigning/azext_codesigning/tests/latest/test_codesigning_scenario.py index d71628a7021..f1d141cde37 100644 --- a/src/codesigning/azext_codesigning/tests/latest/test_codesigning_scenario.py +++ b/src/codesigning/azext_codesigning/tests/latest/test_codesigning_scenario.py @@ -19,6 +19,8 @@ from .example_steps import step_certificate_profile_create from .example_steps import step_certificate_profile_show from .example_steps import step_certificate_profile_list +from .example_steps import step_certificate_profile_update +from .example_steps import step_operation_show from .. import ( try_manual, raise_if, @@ -53,6 +55,10 @@ def call_scenario(test, rg): step_certificate_profile_create(test, rg, checks=[]) step_certificate_profile_show(test, rg, checks=[]) step_certificate_profile_list(test, rg, checks=[]) + step_certificate_profile_update(test, rg, checks=[]) + # STEP NOT FOUND: Delete a Certificate Profile + # STEP NOT FOUND: Delete a Code Sign Account + step_operation_show(test, rg, checks=[]) cleanup_scenario(test, rg) diff --git a/src/codesigning/azext_codesigning/tests/latest/test_codesigning_scenario_coverage.md b/src/codesigning/azext_codesigning/tests/latest/test_codesigning_scenario_coverage.md index d2ac25f77ae..25016d77584 100644 --- a/src/codesigning/azext_codesigning/tests/latest/test_codesigning_scenario_coverage.md +++ b/src/codesigning/azext_codesigning/tests/latest/test_codesigning_scenario_coverage.md @@ -1,10 +1,12 @@ |Scenario|Result|ErrorMessage|ErrorStack|ErrorNormalized|StartDt|EndDt| -|step_create|successed||||2021-03-05 15:03:20.335232|2021-03-05 15:03:28.686646| -|step_show|successed||||2021-03-05 15:03:28.687115|2021-03-05 15:03:29.862280| -|step_list|successed||||2021-03-05 15:03:29.862280|2021-03-05 15:03:31.436550| -|step_list2|successed||||2021-03-05 15:03:31.436550|2021-03-05 15:03:32.569104| -|step_update|successed||||2021-03-05 15:03:32.570060|2021-03-05 15:03:36.611778| -|step_certificate_profile_create|successed||||2021-03-05 15:03:36.612833|2021-03-05 15:03:39.180930| -|step_certificate_profile_show|successed||||2021-03-05 15:03:39.181644|2021-03-05 15:03:41.009973| -|step_certificate_profile_list|successed||||2021-03-05 15:03:41.009973|2021-03-05 15:03:42.127071| -Coverage: 8/8 +|step_create|successed||||2021-03-12 11:22:26.093042|2021-03-12 11:22:36.122302| +|step_show|successed||||2021-03-12 11:22:36.123301|2021-03-12 11:22:37.829122| +|step_list|successed||||2021-03-12 11:22:37.829122|2021-03-12 11:22:39.336026| +|step_list2|successed||||2021-03-12 11:22:39.336026|2021-03-12 11:22:40.664287| +|step_update|successed||||2021-03-12 11:22:40.664287|2021-03-12 11:22:44.629018| +|step_certificate_profile_create|successed||||2021-03-12 11:22:44.630019|2021-03-12 11:22:47.495356| +|step_certificate_profile_show|successed||||2021-03-12 11:22:47.495356|2021-03-12 11:22:49.020785| +|step_certificate_profile_list|successed||||2021-03-12 11:22:49.020785|2021-03-12 11:22:50.843754| +|step_certificate_profile_update|successed||||2021-03-12 11:22:50.843754|2021-03-12 11:22:53.037149| +|step_operation_show|successed||||2021-03-12 11:22:53.037149|2021-03-12 11:22:54.607716| +Coverage: 10/10 diff --git a/src/codesigning/azext_codesigning/vendored_sdks/codesigning/_code_signing_management_client.py b/src/codesigning/azext_codesigning/vendored_sdks/codesigning/_code_signing_management_client.py index 42ab80922ff..855a0f911c8 100644 --- a/src/codesigning/azext_codesigning/vendored_sdks/codesigning/_code_signing_management_client.py +++ b/src/codesigning/azext_codesigning/vendored_sdks/codesigning/_code_signing_management_client.py @@ -25,7 +25,7 @@ class CodeSigningManagementClient(object): - """Code Sign Resource Provider Account and CertificateProfile management API. + """Code Sign Resource Provider Account and Certificate Profile management API. :ivar code_sign_account: CodeSignAccountOperations operations :vartype code_sign_account: azure.mgmt.codesigning.operations.CodeSignAccountOperations @@ -35,7 +35,7 @@ class CodeSigningManagementClient(object): :vartype operations: azure.mgmt.codesigning.operations.Operations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The ID of the subscription to which the CodeSign account is registered. + :param subscription_id: The ID of the target subscription. :type subscription_id: str :param str base_url: Service URL """ diff --git a/src/codesigning/azext_codesigning/vendored_sdks/codesigning/_configuration.py b/src/codesigning/azext_codesigning/vendored_sdks/codesigning/_configuration.py index 6ddc7bde15b..d20f7490494 100644 --- a/src/codesigning/azext_codesigning/vendored_sdks/codesigning/_configuration.py +++ b/src/codesigning/azext_codesigning/vendored_sdks/codesigning/_configuration.py @@ -29,7 +29,7 @@ class CodeSigningManagementClientConfiguration(Configuration): :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The ID of the subscription to which the CodeSign account is registered. + :param subscription_id: The ID of the target subscription. :type subscription_id: str """ diff --git a/src/codesigning/azext_codesigning/vendored_sdks/codesigning/aio/_code_signing_management_client.py b/src/codesigning/azext_codesigning/vendored_sdks/codesigning/aio/_code_signing_management_client.py index ce6d7779147..5fd1b45609d 100644 --- a/src/codesigning/azext_codesigning/vendored_sdks/codesigning/aio/_code_signing_management_client.py +++ b/src/codesigning/azext_codesigning/vendored_sdks/codesigning/aio/_code_signing_management_client.py @@ -23,7 +23,7 @@ class CodeSigningManagementClient(object): - """Code Sign Resource Provider Account and CertificateProfile management API. + """Code Sign Resource Provider Account and Certificate Profile management API. :ivar code_sign_account: CodeSignAccountOperations operations :vartype code_sign_account: azure.mgmt.codesigning.aio.operations.CodeSignAccountOperations @@ -33,7 +33,7 @@ class CodeSigningManagementClient(object): :vartype operations: azure.mgmt.codesigning.aio.operations.Operations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The ID of the subscription to which the CodeSign account is registered. + :param subscription_id: The ID of the target subscription. :type subscription_id: str :param str base_url: Service URL """ diff --git a/src/codesigning/azext_codesigning/vendored_sdks/codesigning/aio/_configuration.py b/src/codesigning/azext_codesigning/vendored_sdks/codesigning/aio/_configuration.py index 187bb63b2db..730b8a9e72f 100644 --- a/src/codesigning/azext_codesigning/vendored_sdks/codesigning/aio/_configuration.py +++ b/src/codesigning/azext_codesigning/vendored_sdks/codesigning/aio/_configuration.py @@ -27,7 +27,7 @@ class CodeSigningManagementClientConfiguration(Configuration): :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The ID of the subscription to which the CodeSign account is registered. + :param subscription_id: The ID of the target subscription. :type subscription_id: str """ diff --git a/src/codesigning/azext_codesigning/vendored_sdks/codesigning/aio/operations/_certificate_profile_operations.py b/src/codesigning/azext_codesigning/vendored_sdks/codesigning/aio/operations/_certificate_profile_operations.py index 89f3df523d4..88304673d6e 100644 --- a/src/codesigning/azext_codesigning/vendored_sdks/codesigning/aio/operations/_certificate_profile_operations.py +++ b/src/codesigning/azext_codesigning/vendored_sdks/codesigning/aio/operations/_certificate_profile_operations.py @@ -49,10 +49,9 @@ def list_by_code_sign_account( ) -> AsyncIterable["models.CertificateProfiles"]: """List certificate profiles within a code sign account. - :param resource_group_name: The name of the resource group under which Code Sign Account is - registered. + :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str - :param account_name: Code Sign account name. + :param account_name: Code Signing account name. :type account_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CertificateProfiles or the result of cls(response) @@ -76,9 +75,9 @@ def prepare_request(next_link=None): # Construct URL url = self.list_by_code_sign_account.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', pattern=r'^[a-zA-Z0-9-]{3,24}$'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters @@ -117,22 +116,24 @@ async def get_next(next_link=None): ) list_by_code_sign_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSignAccounts/{accountName}/certificateProfiles'} # type: ignore - async def get( + async def create( self, resource_group_name: str, account_name: str, profile_name: str, + certificate_profile: Optional["models.CertificateProfile"] = None, **kwargs ) -> "models.CertificateProfile": - """Get details of particular certificate profile. + """Create a certificate profile. - :param resource_group_name: The name of the resource group under which Code Sign Account is - registered. + :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str - :param account_name: Code Sign account name. + :param account_name: Code Signing account name. :type account_name: str :param profile_name: Certificate profile name. :type profile_name: str + :param certificate_profile: + :type certificate_profile: ~azure.mgmt.codesigning.models.CertificateProfile :keyword callable cls: A custom type or function that will be passed the direct response :return: CertificateProfile, or the result of cls(response) :rtype: ~azure.mgmt.codesigning.models.CertificateProfile @@ -144,15 +145,16 @@ async def get( } error_map.update(kwargs.pop('error_map', {})) api_version = "2020-12-14-preview" + content_type = kwargs.pop("content_type", "application/json") accept = "application/json" # Construct URL - url = self.get.metadata['url'] # type: ignore + url = self.create.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'accountName': self._serialize.url("account_name", account_name, 'str'), - 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', pattern=r'^[a-zA-Z0-9-]{3,24}$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str', pattern=r'^[a-zA-Z0-9-]{3,24}$'), } url = self._client.format_url(url, **path_format_arguments) @@ -162,9 +164,16 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - request = self._client.get(url, query_parameters, header_parameters) + body_content_kwargs = {} # type: Dict[str, Any] + if certificate_profile is not None: + body_content = self._serialize.body(certificate_profile, 'CertificateProfile') + else: + body_content = None + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -179,9 +188,9 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSignAccounts/{accountName}/certificateProfiles/{profileName}'} # type: ignore + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSignAccounts/{accountName}/certificateProfiles/{profileName}'} # type: ignore - async def create( + async def update( self, resource_group_name: str, account_name: str, @@ -189,12 +198,11 @@ async def create( certificate_profile: Optional["models.CertificateProfile"] = None, **kwargs ) -> "models.CertificateProfile": - """Create a certificate profile. + """Update a certificate profile. - :param resource_group_name: The name of the resource group under which Code Sign Account is - registered. + :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str - :param account_name: Code Sign account name. + :param account_name: Code Signing account name. :type account_name: str :param profile_name: Certificate profile name. :type profile_name: str @@ -215,12 +223,12 @@ async def create( accept = "application/json" # Construct URL - url = self.create.metadata['url'] # type: ignore + url = self.update.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'accountName': self._serialize.url("account_name", account_name, 'str'), - 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', pattern=r'^[a-zA-Z0-9-]{3,24}$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str', pattern=r'^[a-zA-Z0-9-]{3,24}$'), } url = self._client.format_url(url, **path_format_arguments) @@ -239,7 +247,7 @@ async def create( else: body_content = None body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -254,27 +262,23 @@ async def create( return cls(pipeline_response, deserialized, {}) return deserialized - create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSignAccounts/{accountName}/certificateProfiles/{profileName}'} # type: ignore + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSignAccounts/{accountName}/certificateProfiles/{profileName}'} # type: ignore - async def update( + async def get( self, resource_group_name: str, account_name: str, profile_name: str, - certificate_profile: Optional["models.CertificateProfile"] = None, **kwargs ) -> "models.CertificateProfile": - """Update certificate profile. + """Get details of a certificate profile. - :param resource_group_name: The name of the resource group under which Code Sign Account is - registered. + :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str - :param account_name: Code Sign account name. + :param account_name: Code Signing account name. :type account_name: str :param profile_name: Certificate profile name. :type profile_name: str - :param certificate_profile: - :type certificate_profile: ~azure.mgmt.codesigning.models.CertificateProfile :keyword callable cls: A custom type or function that will be passed the direct response :return: CertificateProfile, or the result of cls(response) :rtype: ~azure.mgmt.codesigning.models.CertificateProfile @@ -286,16 +290,15 @@ async def update( } error_map.update(kwargs.pop('error_map', {})) api_version = "2020-12-14-preview" - content_type = kwargs.pop("content_type", "application/json") accept = "application/json" # Construct URL - url = self.update.metadata['url'] # type: ignore + url = self.get.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'accountName': self._serialize.url("account_name", account_name, 'str'), - 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', pattern=r'^[a-zA-Z0-9-]{3,24}$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str', pattern=r'^[a-zA-Z0-9-]{3,24}$'), } url = self._client.format_url(url, **path_format_arguments) @@ -305,16 +308,9 @@ async def update( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - body_content_kwargs = {} # type: Dict[str, Any] - if certificate_profile is not None: - body_content = self._serialize.body(certificate_profile, 'CertificateProfile') - else: - body_content = None - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + request = self._client.get(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -329,7 +325,7 @@ async def update( return cls(pipeline_response, deserialized, {}) return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSignAccounts/{accountName}/certificateProfiles/{profileName}'} # type: ignore + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSignAccounts/{accountName}/certificateProfiles/{profileName}'} # type: ignore async def delete( self, @@ -338,12 +334,11 @@ async def delete( profile_name: str, **kwargs ) -> None: - """Delete certificate profile. + """Delete a Certificate Profile. - :param resource_group_name: The name of the resource group under which Code Sign Account is - registered. + :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str - :param account_name: Code Sign account name. + :param account_name: Code Signing account name. :type account_name: str :param profile_name: Certificate profile name. :type profile_name: str @@ -363,10 +358,10 @@ async def delete( # Construct URL url = self.delete.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'accountName': self._serialize.url("account_name", account_name, 'str'), - 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', pattern=r'^[a-zA-Z0-9-]{3,24}$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str', pattern=r'^[a-zA-Z0-9-]{3,24}$'), } url = self._client.format_url(url, **path_format_arguments) diff --git a/src/codesigning/azext_codesigning/vendored_sdks/codesigning/aio/operations/_code_sign_account_operations.py b/src/codesigning/azext_codesigning/vendored_sdks/codesigning/aio/operations/_code_sign_account_operations.py index 5d536d89e0a..4f6330ebddd 100644 --- a/src/codesigning/azext_codesigning/vendored_sdks/codesigning/aio/operations/_code_sign_account_operations.py +++ b/src/codesigning/azext_codesigning/vendored_sdks/codesigning/aio/operations/_code_sign_account_operations.py @@ -41,158 +41,21 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config - def list_by_subscription( - self, - **kwargs - ) -> AsyncIterable["models.CodeSignAccounts"]: - """Lists Code Sign Accounts within a subscription. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either CodeSignAccounts or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.codesigning.models.CodeSignAccounts] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.CodeSignAccounts"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-12-14-preview" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list_by_subscription.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('CodeSignAccounts', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.CodeSigning/codeSignAccounts'} # type: ignore - - def list_by_resource_group( - self, - resource_group_name: str, - **kwargs - ) -> AsyncIterable["models.CodeSignAccounts"]: - """List Code Sign Accounts within a resource group. - - :param resource_group_name: The name of the resource group under which Code Sign Account is - registered. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either CodeSignAccounts or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.codesigning.models.CodeSignAccounts] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.CodeSignAccounts"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-12-14-preview" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list_by_resource_group.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('CodeSignAccounts', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSignAccounts'} # type: ignore - - async def get( + async def create( self, resource_group_name: str, account_name: str, + code_sign_account: Optional["models.CodeSignAccount"] = None, **kwargs ) -> "models.CodeSignAccount": - """Get Code Sign Account. + """Create a Code Sign Account. - :param resource_group_name: The name of the resource group under which Code Sign Account is - registered. + :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str - :param account_name: Code Sign account name. + :param account_name: Code Signing account name. :type account_name: str + :param code_sign_account: + :type code_sign_account: ~azure.mgmt.codesigning.models.CodeSignAccount :keyword callable cls: A custom type or function that will be passed the direct response :return: CodeSignAccount, or the result of cls(response) :rtype: ~azure.mgmt.codesigning.models.CodeSignAccount @@ -204,14 +67,15 @@ async def get( } error_map.update(kwargs.pop('error_map', {})) api_version = "2020-12-14-preview" + content_type = kwargs.pop("content_type", "application/json") accept = "application/json" # Construct URL - url = self.get.metadata['url'] # type: ignore + url = self.create.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', pattern=r'^[a-zA-Z0-9-]{3,24}$'), } url = self._client.format_url(url, **path_format_arguments) @@ -221,41 +85,51 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - request = self._client.get(url, query_parameters, header_parameters) + body_content_kwargs = {} # type: Dict[str, Any] + if code_sign_account is not None: + body_content = self._serialize.body(code_sign_account, 'CodeSignAccount') + else: + body_content = None + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200]: + if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('CodeSignAccount', pipeline_response) + if response.status_code == 200: + deserialized = self._deserialize('CodeSignAccount', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('CodeSignAccount', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSignAccounts/{accountName}'} # type: ignore + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSignAccounts/{accountName}'} # type: ignore - async def create( + async def update( self, resource_group_name: str, account_name: str, - code_sign_account: Optional["models.CodeSignAccount"] = None, + code_sign_account_patch: "models.CodeSignAccountPatch", **kwargs ) -> "models.CodeSignAccount": - """Create Code Sign Account. + """Update a code sign account. - :param resource_group_name: The name of the resource group under which Code Sign Account is - registered. + :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str - :param account_name: Code Sign account name. + :param account_name: Code Signing account name. :type account_name: str - :param code_sign_account: - :type code_sign_account: ~azure.mgmt.codesigning.models.CodeSignAccount + :param code_sign_account_patch: + :type code_sign_account_patch: ~azure.mgmt.codesigning.models.CodeSignAccountPatch :keyword callable cls: A custom type or function that will be passed the direct response :return: CodeSignAccount, or the result of cls(response) :rtype: ~azure.mgmt.codesigning.models.CodeSignAccount @@ -271,11 +145,11 @@ async def create( accept = "application/json" # Construct URL - url = self.create.metadata['url'] # type: ignore + url = self.update.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', pattern=r'^[a-zA-Z0-9-]{3,24}$'), } url = self._client.format_url(url, **path_format_arguments) @@ -289,48 +163,37 @@ async def create( header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') body_content_kwargs = {} # type: Dict[str, Any] - if code_sign_account is not None: - body_content = self._serialize.body(code_sign_account, 'CodeSignAccount') - else: - body_content = None + body_content = self._serialize.body(code_sign_account_patch, 'CodeSignAccountPatch') body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200, 201]: + if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - if response.status_code == 200: - deserialized = self._deserialize('CodeSignAccount', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('CodeSignAccount', pipeline_response) + deserialized = self._deserialize('CodeSignAccount', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSignAccounts/{accountName}'} # type: ignore + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSignAccounts/{accountName}'} # type: ignore - async def update( + async def get( self, resource_group_name: str, account_name: str, - code_sign_account_patch: "models.CodeSignAccountPatch", **kwargs ) -> "models.CodeSignAccount": - """Update a code sign account. + """Get a Code Sign Account. - :param resource_group_name: The name of the resource group under which Code Sign Account is - registered. + :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str - :param account_name: Code Sign account name. + :param account_name: Code Signing account name. :type account_name: str - :param code_sign_account_patch: - :type code_sign_account_patch: ~azure.mgmt.codesigning.models.CodeSignAccountPatch :keyword callable cls: A custom type or function that will be passed the direct response :return: CodeSignAccount, or the result of cls(response) :rtype: ~azure.mgmt.codesigning.models.CodeSignAccount @@ -342,15 +205,14 @@ async def update( } error_map.update(kwargs.pop('error_map', {})) api_version = "2020-12-14-preview" - content_type = kwargs.pop("content_type", "application/json") accept = "application/json" # Construct URL - url = self.update.metadata['url'] # type: ignore + url = self.get.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', pattern=r'^[a-zA-Z0-9-]{3,24}$'), } url = self._client.format_url(url, **path_format_arguments) @@ -360,13 +222,9 @@ async def update( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(code_sign_account_patch, 'CodeSignAccountPatch') - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + request = self._client.get(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -381,7 +239,7 @@ async def update( return cls(pipeline_response, deserialized, {}) return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSignAccounts/{accountName}'} # type: ignore + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSignAccounts/{accountName}'} # type: ignore async def delete( self, @@ -391,10 +249,9 @@ async def delete( ) -> None: """Delete a Code Sign Account. - :param resource_group_name: The name of the resource group under which Code Sign Account is - registered. + :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str - :param account_name: Code Sign account name. + :param account_name: Code Signing account name. :type account_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) @@ -412,9 +269,9 @@ async def delete( # Construct URL url = self.delete.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', pattern=r'^[a-zA-Z0-9-]{3,24}$'), } url = self._client.format_url(url, **path_format_arguments) @@ -439,3 +296,141 @@ async def delete( return cls(pipeline_response, None, {}) delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSignAccounts/{accountName}'} # type: ignore + + def list_by_subscription( + self, + **kwargs + ) -> AsyncIterable["models.CodeSignAccounts"]: + """Lists Code Sign Accounts within a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either CodeSignAccounts or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.codesigning.models.CodeSignAccounts] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.CodeSignAccounts"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-14-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_subscription.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('CodeSignAccounts', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.CodeSigning/codeSignAccounts'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["models.CodeSignAccounts"]: + """List Code Sign Accounts within a resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either CodeSignAccounts or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.codesigning.models.CodeSignAccounts] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.CodeSignAccounts"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-14-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('CodeSignAccounts', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSignAccounts'} # type: ignore diff --git a/src/codesigning/azext_codesigning/vendored_sdks/codesigning/models/__init__.py b/src/codesigning/azext_codesigning/vendored_sdks/codesigning/models/__init__.py index d98c3535e19..02d8c88b844 100644 --- a/src/codesigning/azext_codesigning/vendored_sdks/codesigning/models/__init__.py +++ b/src/codesigning/azext_codesigning/vendored_sdks/codesigning/models/__init__.py @@ -10,7 +10,6 @@ from ._models_py3 import Certificate from ._models_py3 import CertificateProfile from ._models_py3 import CertificateProfiles - from ._models_py3 import CertificateProperties from ._models_py3 import CodeSignAccount from ._models_py3 import CodeSignAccountPatch from ._models_py3 import CodeSignAccounts @@ -28,7 +27,6 @@ from ._models import Certificate # type: ignore from ._models import CertificateProfile # type: ignore from ._models import CertificateProfiles # type: ignore - from ._models import CertificateProperties # type: ignore from ._models import CodeSignAccount # type: ignore from ._models import CodeSignAccountPatch # type: ignore from ._models import CodeSignAccounts # type: ignore @@ -55,7 +53,6 @@ 'Certificate', 'CertificateProfile', 'CertificateProfiles', - 'CertificateProperties', 'CodeSignAccount', 'CodeSignAccountPatch', 'CodeSignAccounts', diff --git a/src/codesigning/azext_codesigning/vendored_sdks/codesigning/models/_code_signing_management_client_enums.py b/src/codesigning/azext_codesigning/vendored_sdks/codesigning/models/_code_signing_management_client_enums.py index 407de056460..f803d1e51f3 100644 --- a/src/codesigning/azext_codesigning/vendored_sdks/codesigning/models/_code_signing_management_client_enums.py +++ b/src/codesigning/azext_codesigning/vendored_sdks/codesigning/models/_code_signing_management_client_enums.py @@ -36,6 +36,8 @@ class CreatedByType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): KEY = "Key" class ProfileType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Profile type of the certificate + """ TEST = "Test" TRIAL = "Trial" @@ -43,7 +45,7 @@ class ProfileType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): PUBLIC_TRUST = "PublicTrust" class ProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The current provisioning state + """Provisioning state of the vault """ SUCCEEDED = "Succeeded" @@ -55,11 +57,13 @@ class ProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): ACCEPTED = "Accepted" class RotationPolicy(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Rotation policy of the certificate + """ MONTHLY = "Monthly" class VerificationStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The vetting status of the code sign account + """Vetting status of the code sign account """ COMPLETED = "Completed" diff --git a/src/codesigning/azext_codesigning/vendored_sdks/codesigning/models/_models.py b/src/codesigning/azext_codesigning/vendored_sdks/codesigning/models/_models.py index b9eb50e7e64..74d722f4436 100644 --- a/src/codesigning/azext_codesigning/vendored_sdks/codesigning/models/_models.py +++ b/src/codesigning/azext_codesigning/vendored_sdks/codesigning/models/_models.py @@ -10,22 +10,22 @@ import msrest.serialization -class CertificateProperties(msrest.serialization.Model): - """Certificate properties. +class Certificate(msrest.serialization.Model): + """Properties of the certificate. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: + :ivar id: Id of the certificate. :vartype id: str - :ivar subject_name: + :ivar subject_name: Subject name of the certificate. :vartype subject_name: str - :ivar subject_alternative_name: + :ivar subject_alternative_name: Subject alternative name of the certificate. :vartype subject_alternative_name: str - :ivar thumbprint: + :ivar thumbprint: Thumbprint of the certificate. :vartype thumbprint: str - :ivar created_date: + :ivar created_date: Certificate created date. :vartype created_date: str - :ivar expiry_date: + :ivar expiry_date: Certificate expiry date. :vartype expiry_date: str """ @@ -51,7 +51,7 @@ def __init__( self, **kwargs ): - super(CertificateProperties, self).__init__(**kwargs) + super(Certificate, self).__init__(**kwargs) self.id = None self.subject_name = None self.subject_alternative_name = None @@ -60,80 +60,6 @@ def __init__( self.expiry_date = None -class Certificate(CertificateProperties): - """Certificate. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: - :vartype id: str - :ivar subject_name: - :vartype subject_name: str - :ivar subject_alternative_name: - :vartype subject_alternative_name: str - :ivar thumbprint: - :vartype thumbprint: str - :ivar created_date: - :vartype created_date: str - :ivar expiry_date: - :vartype expiry_date: str - :ivar id_properties_id: - :vartype id_properties_id: str - :ivar subject_name_properties_subject_name: - :vartype subject_name_properties_subject_name: str - :ivar subject_alternative_name_properties_subject_alternative_name: - :vartype subject_alternative_name_properties_subject_alternative_name: str - :ivar thumbprint_properties_thumbprint: - :vartype thumbprint_properties_thumbprint: str - :ivar created_date_properties_created_date: - :vartype created_date_properties_created_date: str - :ivar expiry_date_properties_expiry_date: - :vartype expiry_date_properties_expiry_date: str - """ - - _validation = { - 'id': {'readonly': True}, - 'subject_name': {'readonly': True}, - 'subject_alternative_name': {'readonly': True}, - 'thumbprint': {'readonly': True}, - 'created_date': {'readonly': True}, - 'expiry_date': {'readonly': True}, - 'id_properties_id': {'readonly': True}, - 'subject_name_properties_subject_name': {'readonly': True}, - 'subject_alternative_name_properties_subject_alternative_name': {'readonly': True}, - 'thumbprint_properties_thumbprint': {'readonly': True}, - 'created_date_properties_created_date': {'readonly': True}, - 'expiry_date_properties_expiry_date': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'subject_name': {'key': 'subjectName', 'type': 'str'}, - 'subject_alternative_name': {'key': 'subjectAlternativeName', 'type': 'str'}, - 'thumbprint': {'key': 'thumbprint', 'type': 'str'}, - 'created_date': {'key': 'createdDate', 'type': 'str'}, - 'expiry_date': {'key': 'expiryDate', 'type': 'str'}, - 'id_properties_id': {'key': 'properties.id', 'type': 'str'}, - 'subject_name_properties_subject_name': {'key': 'properties.subjectName', 'type': 'str'}, - 'subject_alternative_name_properties_subject_alternative_name': {'key': 'properties.subjectAlternativeName', 'type': 'str'}, - 'thumbprint_properties_thumbprint': {'key': 'properties.thumbprint', 'type': 'str'}, - 'created_date_properties_created_date': {'key': 'properties.createdDate', 'type': 'str'}, - 'expiry_date_properties_expiry_date': {'key': 'properties.expiryDate', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(Certificate, self).__init__(**kwargs) - self.id_properties_id = None - self.subject_name_properties_subject_name = None - self.subject_alternative_name_properties_subject_alternative_name = None - self.thumbprint_properties_thumbprint = None - self.created_date_properties_created_date = None - self.expiry_date_properties_expiry_date = None - - class Resource(msrest.serialization.Model): """Common fields that are returned in the response for all Azure Resource Manager resources. @@ -186,17 +112,16 @@ class CertificateProfile(Resource): :vartype type: str :ivar system_data: Metadata pertaining to creation and last modification of the resource. :vartype system_data: ~azure.mgmt.codesigning.models.SystemData - :param profile_name: - :type profile_name: str - :param profile_type: Possible values include: "Test", "Trial", "PrivateTrust", "PublicTrust". + :param profile_type: Profile type of the certificate. Possible values include: "Test", "Trial", + "PrivateTrust", "PublicTrust". :type profile_type: str or ~azure.mgmt.codesigning.models.ProfileType - :param rotation_policy: Possible values include: "Monthly". + :param rotation_policy: Rotation policy of the certificate. Possible values include: "Monthly". :type rotation_policy: str or ~azure.mgmt.codesigning.models.RotationPolicy - :ivar authority: - :vartype authority: str - :param common_name: + :param common_name: Name of the certificate. :type common_name: str - :param subject_alternative_name: + :ivar authority: Certificate authority of the certificate. + :vartype authority: str + :param subject_alternative_name: Subject Alternative Name of the certificate. :type subject_alternative_name: str :ivar organization: :vartype organization: str @@ -208,11 +133,11 @@ class CertificateProfile(Resource): :vartype state: str :ivar city: :vartype city: str - :param certificates: - :type certificates: ~azure.mgmt.codesigning.models.Certificate - :param provisioning_state: The current provisioning state. Possible values include: + :ivar certificates: + :vartype certificates: list[~azure.mgmt.codesigning.models.Certificate] + :ivar provisioning_state: Provisioning state of the vault. Possible values include: "Succeeded", "Failed", "Canceled", "Provisioning", "Updating", "Deleting", "Accepted". - :type provisioning_state: str or ~azure.mgmt.codesigning.models.ProvisioningState + :vartype provisioning_state: str or ~azure.mgmt.codesigning.models.ProvisioningState """ _validation = { @@ -226,6 +151,8 @@ class CertificateProfile(Resource): 'country': {'readonly': True}, 'state': {'readonly': True}, 'city': {'readonly': True}, + 'certificates': {'readonly': True}, + 'provisioning_state': {'readonly': True}, } _attribute_map = { @@ -233,18 +160,17 @@ class CertificateProfile(Resource): 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'profile_name': {'key': 'properties.profileName', 'type': 'str'}, 'profile_type': {'key': 'properties.profileType', 'type': 'str'}, 'rotation_policy': {'key': 'properties.rotationPolicy', 'type': 'str'}, - 'authority': {'key': 'properties.authority', 'type': 'str'}, 'common_name': {'key': 'properties.commonName', 'type': 'str'}, + 'authority': {'key': 'properties.authority', 'type': 'str'}, 'subject_alternative_name': {'key': 'properties.subjectAlternativeName', 'type': 'str'}, 'organization': {'key': 'properties.organization', 'type': 'str'}, 'street_address': {'key': 'properties.streetAddress', 'type': 'str'}, 'country': {'key': 'properties.country', 'type': 'str'}, 'state': {'key': 'properties.state', 'type': 'str'}, 'city': {'key': 'properties.city', 'type': 'str'}, - 'certificates': {'key': 'properties.certificates', 'type': 'Certificate'}, + 'certificates': {'key': 'properties.certificates', 'type': '[Certificate]'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, } @@ -254,19 +180,18 @@ def __init__( ): super(CertificateProfile, self).__init__(**kwargs) self.system_data = None - self.profile_name = kwargs.get('profile_name', None) self.profile_type = kwargs.get('profile_type', None) self.rotation_policy = kwargs.get('rotation_policy', None) - self.authority = None self.common_name = kwargs.get('common_name', None) + self.authority = None self.subject_alternative_name = kwargs.get('subject_alternative_name', None) self.organization = None self.street_address = None self.country = None self.state = None self.city = None - self.certificates = kwargs.get('certificates', None) - self.provisioning_state = kwargs.get('provisioning_state', None) + self.certificates = None + self.provisioning_state = None class CertificateProfiles(msrest.serialization.Model): @@ -358,16 +283,15 @@ class CodeSignAccount(TrackedResource): :type location: str :ivar system_data: Metadata pertaining to creation and last modification of the resource. :vartype system_data: ~azure.mgmt.codesigning.models.SystemData - :param account_name: - :type account_name: str - :param account_url: - :type account_url: str - :param verification_status: The vetting status of the code sign account. Possible values - include: "Completed", "InProgress", "NotCompleted". - :type verification_status: str or ~azure.mgmt.codesigning.models.VerificationStatus - :param provisioning_state: The current provisioning state. Possible values include: + :ivar account_uri: The URI of the code sign account for performing operations on certificate + profiles. This property is readonly. + :vartype account_uri: str + :ivar verification_status: Vetting status of the code sign account. Possible values include: + "Completed", "InProgress", "NotCompleted". + :vartype verification_status: str or ~azure.mgmt.codesigning.models.VerificationStatus + :ivar provisioning_state: Provisioning state of the vault. Possible values include: "Succeeded", "Failed", "Canceled", "Provisioning", "Updating", "Deleting", "Accepted". - :type provisioning_state: str or ~azure.mgmt.codesigning.models.ProvisioningState + :vartype provisioning_state: str or ~azure.mgmt.codesigning.models.ProvisioningState """ _validation = { @@ -376,6 +300,9 @@ class CodeSignAccount(TrackedResource): 'type': {'readonly': True}, 'location': {'required': True}, 'system_data': {'readonly': True}, + 'account_uri': {'readonly': True}, + 'verification_status': {'readonly': True}, + 'provisioning_state': {'readonly': True}, } _attribute_map = { @@ -385,8 +312,7 @@ class CodeSignAccount(TrackedResource): 'tags': {'key': 'tags', 'type': '{str}'}, 'location': {'key': 'location', 'type': 'str'}, 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'account_name': {'key': 'properties.accountName', 'type': 'str'}, - 'account_url': {'key': 'properties.accountUrl', 'type': 'str'}, + 'account_uri': {'key': 'properties.accountUri', 'type': 'str'}, 'verification_status': {'key': 'properties.verificationStatus', 'type': 'str'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, } @@ -397,10 +323,9 @@ def __init__( ): super(CodeSignAccount, self).__init__(**kwargs) self.system_data = None - self.account_name = kwargs.get('account_name', None) - self.account_url = kwargs.get('account_url', None) - self.verification_status = kwargs.get('verification_status', None) - self.provisioning_state = kwargs.get('provisioning_state', None) + self.account_uri = None + self.verification_status = None + self.provisioning_state = None class CodeSignAccountPatch(msrest.serialization.Model): @@ -425,7 +350,7 @@ def __init__( class CodeSignAccounts(msrest.serialization.Model): """The paginated list of code sign accounts. - :param value: The list of code sign accounts. + :param value: List of code sign accounts. :type value: list[~azure.mgmt.codesigning.models.CodeSignAccount] :param next_link: The link to fetch the next page of code sign account. :type next_link: str diff --git a/src/codesigning/azext_codesigning/vendored_sdks/codesigning/models/_models_py3.py b/src/codesigning/azext_codesigning/vendored_sdks/codesigning/models/_models_py3.py index 168a0978941..6942cda7a03 100644 --- a/src/codesigning/azext_codesigning/vendored_sdks/codesigning/models/_models_py3.py +++ b/src/codesigning/azext_codesigning/vendored_sdks/codesigning/models/_models_py3.py @@ -15,22 +15,22 @@ from ._code_signing_management_client_enums import * -class CertificateProperties(msrest.serialization.Model): - """Certificate properties. +class Certificate(msrest.serialization.Model): + """Properties of the certificate. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: + :ivar id: Id of the certificate. :vartype id: str - :ivar subject_name: + :ivar subject_name: Subject name of the certificate. :vartype subject_name: str - :ivar subject_alternative_name: + :ivar subject_alternative_name: Subject alternative name of the certificate. :vartype subject_alternative_name: str - :ivar thumbprint: + :ivar thumbprint: Thumbprint of the certificate. :vartype thumbprint: str - :ivar created_date: + :ivar created_date: Certificate created date. :vartype created_date: str - :ivar expiry_date: + :ivar expiry_date: Certificate expiry date. :vartype expiry_date: str """ @@ -56,7 +56,7 @@ def __init__( self, **kwargs ): - super(CertificateProperties, self).__init__(**kwargs) + super(Certificate, self).__init__(**kwargs) self.id = None self.subject_name = None self.subject_alternative_name = None @@ -65,80 +65,6 @@ def __init__( self.expiry_date = None -class Certificate(CertificateProperties): - """Certificate. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: - :vartype id: str - :ivar subject_name: - :vartype subject_name: str - :ivar subject_alternative_name: - :vartype subject_alternative_name: str - :ivar thumbprint: - :vartype thumbprint: str - :ivar created_date: - :vartype created_date: str - :ivar expiry_date: - :vartype expiry_date: str - :ivar id_properties_id: - :vartype id_properties_id: str - :ivar subject_name_properties_subject_name: - :vartype subject_name_properties_subject_name: str - :ivar subject_alternative_name_properties_subject_alternative_name: - :vartype subject_alternative_name_properties_subject_alternative_name: str - :ivar thumbprint_properties_thumbprint: - :vartype thumbprint_properties_thumbprint: str - :ivar created_date_properties_created_date: - :vartype created_date_properties_created_date: str - :ivar expiry_date_properties_expiry_date: - :vartype expiry_date_properties_expiry_date: str - """ - - _validation = { - 'id': {'readonly': True}, - 'subject_name': {'readonly': True}, - 'subject_alternative_name': {'readonly': True}, - 'thumbprint': {'readonly': True}, - 'created_date': {'readonly': True}, - 'expiry_date': {'readonly': True}, - 'id_properties_id': {'readonly': True}, - 'subject_name_properties_subject_name': {'readonly': True}, - 'subject_alternative_name_properties_subject_alternative_name': {'readonly': True}, - 'thumbprint_properties_thumbprint': {'readonly': True}, - 'created_date_properties_created_date': {'readonly': True}, - 'expiry_date_properties_expiry_date': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'subject_name': {'key': 'subjectName', 'type': 'str'}, - 'subject_alternative_name': {'key': 'subjectAlternativeName', 'type': 'str'}, - 'thumbprint': {'key': 'thumbprint', 'type': 'str'}, - 'created_date': {'key': 'createdDate', 'type': 'str'}, - 'expiry_date': {'key': 'expiryDate', 'type': 'str'}, - 'id_properties_id': {'key': 'properties.id', 'type': 'str'}, - 'subject_name_properties_subject_name': {'key': 'properties.subjectName', 'type': 'str'}, - 'subject_alternative_name_properties_subject_alternative_name': {'key': 'properties.subjectAlternativeName', 'type': 'str'}, - 'thumbprint_properties_thumbprint': {'key': 'properties.thumbprint', 'type': 'str'}, - 'created_date_properties_created_date': {'key': 'properties.createdDate', 'type': 'str'}, - 'expiry_date_properties_expiry_date': {'key': 'properties.expiryDate', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(Certificate, self).__init__(**kwargs) - self.id_properties_id = None - self.subject_name_properties_subject_name = None - self.subject_alternative_name_properties_subject_alternative_name = None - self.thumbprint_properties_thumbprint = None - self.created_date_properties_created_date = None - self.expiry_date_properties_expiry_date = None - - class Resource(msrest.serialization.Model): """Common fields that are returned in the response for all Azure Resource Manager resources. @@ -191,17 +117,16 @@ class CertificateProfile(Resource): :vartype type: str :ivar system_data: Metadata pertaining to creation and last modification of the resource. :vartype system_data: ~azure.mgmt.codesigning.models.SystemData - :param profile_name: - :type profile_name: str - :param profile_type: Possible values include: "Test", "Trial", "PrivateTrust", "PublicTrust". + :param profile_type: Profile type of the certificate. Possible values include: "Test", "Trial", + "PrivateTrust", "PublicTrust". :type profile_type: str or ~azure.mgmt.codesigning.models.ProfileType - :param rotation_policy: Possible values include: "Monthly". + :param rotation_policy: Rotation policy of the certificate. Possible values include: "Monthly". :type rotation_policy: str or ~azure.mgmt.codesigning.models.RotationPolicy - :ivar authority: - :vartype authority: str - :param common_name: + :param common_name: Name of the certificate. :type common_name: str - :param subject_alternative_name: + :ivar authority: Certificate authority of the certificate. + :vartype authority: str + :param subject_alternative_name: Subject Alternative Name of the certificate. :type subject_alternative_name: str :ivar organization: :vartype organization: str @@ -213,11 +138,11 @@ class CertificateProfile(Resource): :vartype state: str :ivar city: :vartype city: str - :param certificates: - :type certificates: ~azure.mgmt.codesigning.models.Certificate - :param provisioning_state: The current provisioning state. Possible values include: + :ivar certificates: + :vartype certificates: list[~azure.mgmt.codesigning.models.Certificate] + :ivar provisioning_state: Provisioning state of the vault. Possible values include: "Succeeded", "Failed", "Canceled", "Provisioning", "Updating", "Deleting", "Accepted". - :type provisioning_state: str or ~azure.mgmt.codesigning.models.ProvisioningState + :vartype provisioning_state: str or ~azure.mgmt.codesigning.models.ProvisioningState """ _validation = { @@ -231,6 +156,8 @@ class CertificateProfile(Resource): 'country': {'readonly': True}, 'state': {'readonly': True}, 'city': {'readonly': True}, + 'certificates': {'readonly': True}, + 'provisioning_state': {'readonly': True}, } _attribute_map = { @@ -238,48 +165,43 @@ class CertificateProfile(Resource): 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'profile_name': {'key': 'properties.profileName', 'type': 'str'}, 'profile_type': {'key': 'properties.profileType', 'type': 'str'}, 'rotation_policy': {'key': 'properties.rotationPolicy', 'type': 'str'}, - 'authority': {'key': 'properties.authority', 'type': 'str'}, 'common_name': {'key': 'properties.commonName', 'type': 'str'}, + 'authority': {'key': 'properties.authority', 'type': 'str'}, 'subject_alternative_name': {'key': 'properties.subjectAlternativeName', 'type': 'str'}, 'organization': {'key': 'properties.organization', 'type': 'str'}, 'street_address': {'key': 'properties.streetAddress', 'type': 'str'}, 'country': {'key': 'properties.country', 'type': 'str'}, 'state': {'key': 'properties.state', 'type': 'str'}, 'city': {'key': 'properties.city', 'type': 'str'}, - 'certificates': {'key': 'properties.certificates', 'type': 'Certificate'}, + 'certificates': {'key': 'properties.certificates', 'type': '[Certificate]'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, } def __init__( self, *, - profile_name: Optional[str] = None, profile_type: Optional[Union[str, "ProfileType"]] = None, rotation_policy: Optional[Union[str, "RotationPolicy"]] = None, common_name: Optional[str] = None, subject_alternative_name: Optional[str] = None, - certificates: Optional["Certificate"] = None, - provisioning_state: Optional[Union[str, "ProvisioningState"]] = None, **kwargs ): super(CertificateProfile, self).__init__(**kwargs) self.system_data = None - self.profile_name = profile_name self.profile_type = profile_type self.rotation_policy = rotation_policy - self.authority = None self.common_name = common_name + self.authority = None self.subject_alternative_name = subject_alternative_name self.organization = None self.street_address = None self.country = None self.state = None self.city = None - self.certificates = certificates - self.provisioning_state = provisioning_state + self.certificates = None + self.provisioning_state = None class CertificateProfiles(msrest.serialization.Model): @@ -377,16 +299,15 @@ class CodeSignAccount(TrackedResource): :type location: str :ivar system_data: Metadata pertaining to creation and last modification of the resource. :vartype system_data: ~azure.mgmt.codesigning.models.SystemData - :param account_name: - :type account_name: str - :param account_url: - :type account_url: str - :param verification_status: The vetting status of the code sign account. Possible values - include: "Completed", "InProgress", "NotCompleted". - :type verification_status: str or ~azure.mgmt.codesigning.models.VerificationStatus - :param provisioning_state: The current provisioning state. Possible values include: + :ivar account_uri: The URI of the code sign account for performing operations on certificate + profiles. This property is readonly. + :vartype account_uri: str + :ivar verification_status: Vetting status of the code sign account. Possible values include: + "Completed", "InProgress", "NotCompleted". + :vartype verification_status: str or ~azure.mgmt.codesigning.models.VerificationStatus + :ivar provisioning_state: Provisioning state of the vault. Possible values include: "Succeeded", "Failed", "Canceled", "Provisioning", "Updating", "Deleting", "Accepted". - :type provisioning_state: str or ~azure.mgmt.codesigning.models.ProvisioningState + :vartype provisioning_state: str or ~azure.mgmt.codesigning.models.ProvisioningState """ _validation = { @@ -395,6 +316,9 @@ class CodeSignAccount(TrackedResource): 'type': {'readonly': True}, 'location': {'required': True}, 'system_data': {'readonly': True}, + 'account_uri': {'readonly': True}, + 'verification_status': {'readonly': True}, + 'provisioning_state': {'readonly': True}, } _attribute_map = { @@ -404,8 +328,7 @@ class CodeSignAccount(TrackedResource): 'tags': {'key': 'tags', 'type': '{str}'}, 'location': {'key': 'location', 'type': 'str'}, 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'account_name': {'key': 'properties.accountName', 'type': 'str'}, - 'account_url': {'key': 'properties.accountUrl', 'type': 'str'}, + 'account_uri': {'key': 'properties.accountUri', 'type': 'str'}, 'verification_status': {'key': 'properties.verificationStatus', 'type': 'str'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, } @@ -415,18 +338,13 @@ def __init__( *, location: str, tags: Optional[Dict[str, str]] = None, - account_name: Optional[str] = None, - account_url: Optional[str] = None, - verification_status: Optional[Union[str, "VerificationStatus"]] = None, - provisioning_state: Optional[Union[str, "ProvisioningState"]] = None, **kwargs ): super(CodeSignAccount, self).__init__(tags=tags, location=location, **kwargs) self.system_data = None - self.account_name = account_name - self.account_url = account_url - self.verification_status = verification_status - self.provisioning_state = provisioning_state + self.account_uri = None + self.verification_status = None + self.provisioning_state = None class CodeSignAccountPatch(msrest.serialization.Model): @@ -453,7 +371,7 @@ def __init__( class CodeSignAccounts(msrest.serialization.Model): """The paginated list of code sign accounts. - :param value: The list of code sign accounts. + :param value: List of code sign accounts. :type value: list[~azure.mgmt.codesigning.models.CodeSignAccount] :param next_link: The link to fetch the next page of code sign account. :type next_link: str diff --git a/src/codesigning/azext_codesigning/vendored_sdks/codesigning/operations/_certificate_profile_operations.py b/src/codesigning/azext_codesigning/vendored_sdks/codesigning/operations/_certificate_profile_operations.py index e2dc899d570..72d08b259b0 100644 --- a/src/codesigning/azext_codesigning/vendored_sdks/codesigning/operations/_certificate_profile_operations.py +++ b/src/codesigning/azext_codesigning/vendored_sdks/codesigning/operations/_certificate_profile_operations.py @@ -54,10 +54,9 @@ def list_by_code_sign_account( # type: (...) -> Iterable["models.CertificateProfiles"] """List certificate profiles within a code sign account. - :param resource_group_name: The name of the resource group under which Code Sign Account is - registered. + :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str - :param account_name: Code Sign account name. + :param account_name: Code Signing account name. :type account_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CertificateProfiles or the result of cls(response) @@ -81,9 +80,9 @@ def prepare_request(next_link=None): # Construct URL url = self.list_by_code_sign_account.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', pattern=r'^[a-zA-Z0-9-]{3,24}$'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters @@ -122,23 +121,25 @@ def get_next(next_link=None): ) list_by_code_sign_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSignAccounts/{accountName}/certificateProfiles'} # type: ignore - def get( + def create( self, resource_group_name, # type: str account_name, # type: str profile_name, # type: str + certificate_profile=None, # type: Optional["models.CertificateProfile"] **kwargs # type: Any ): # type: (...) -> "models.CertificateProfile" - """Get details of particular certificate profile. + """Create a certificate profile. - :param resource_group_name: The name of the resource group under which Code Sign Account is - registered. + :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str - :param account_name: Code Sign account name. + :param account_name: Code Signing account name. :type account_name: str :param profile_name: Certificate profile name. :type profile_name: str + :param certificate_profile: + :type certificate_profile: ~azure.mgmt.codesigning.models.CertificateProfile :keyword callable cls: A custom type or function that will be passed the direct response :return: CertificateProfile, or the result of cls(response) :rtype: ~azure.mgmt.codesigning.models.CertificateProfile @@ -150,15 +151,16 @@ def get( } error_map.update(kwargs.pop('error_map', {})) api_version = "2020-12-14-preview" + content_type = kwargs.pop("content_type", "application/json") accept = "application/json" # Construct URL - url = self.get.metadata['url'] # type: ignore + url = self.create.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'accountName': self._serialize.url("account_name", account_name, 'str'), - 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', pattern=r'^[a-zA-Z0-9-]{3,24}$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str', pattern=r'^[a-zA-Z0-9-]{3,24}$'), } url = self._client.format_url(url, **path_format_arguments) @@ -168,9 +170,16 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - request = self._client.get(url, query_parameters, header_parameters) + body_content_kwargs = {} # type: Dict[str, Any] + if certificate_profile is not None: + body_content = self._serialize.body(certificate_profile, 'CertificateProfile') + else: + body_content = None + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -185,9 +194,9 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSignAccounts/{accountName}/certificateProfiles/{profileName}'} # type: ignore + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSignAccounts/{accountName}/certificateProfiles/{profileName}'} # type: ignore - def create( + def update( self, resource_group_name, # type: str account_name, # type: str @@ -196,12 +205,11 @@ def create( **kwargs # type: Any ): # type: (...) -> "models.CertificateProfile" - """Create a certificate profile. + """Update a certificate profile. - :param resource_group_name: The name of the resource group under which Code Sign Account is - registered. + :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str - :param account_name: Code Sign account name. + :param account_name: Code Signing account name. :type account_name: str :param profile_name: Certificate profile name. :type profile_name: str @@ -222,12 +230,12 @@ def create( accept = "application/json" # Construct URL - url = self.create.metadata['url'] # type: ignore + url = self.update.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'accountName': self._serialize.url("account_name", account_name, 'str'), - 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', pattern=r'^[a-zA-Z0-9-]{3,24}$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str', pattern=r'^[a-zA-Z0-9-]{3,24}$'), } url = self._client.format_url(url, **path_format_arguments) @@ -246,7 +254,7 @@ def create( else: body_content = None body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -261,28 +269,24 @@ def create( return cls(pipeline_response, deserialized, {}) return deserialized - create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSignAccounts/{accountName}/certificateProfiles/{profileName}'} # type: ignore + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSignAccounts/{accountName}/certificateProfiles/{profileName}'} # type: ignore - def update( + def get( self, resource_group_name, # type: str account_name, # type: str profile_name, # type: str - certificate_profile=None, # type: Optional["models.CertificateProfile"] **kwargs # type: Any ): # type: (...) -> "models.CertificateProfile" - """Update certificate profile. + """Get details of a certificate profile. - :param resource_group_name: The name of the resource group under which Code Sign Account is - registered. + :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str - :param account_name: Code Sign account name. + :param account_name: Code Signing account name. :type account_name: str :param profile_name: Certificate profile name. :type profile_name: str - :param certificate_profile: - :type certificate_profile: ~azure.mgmt.codesigning.models.CertificateProfile :keyword callable cls: A custom type or function that will be passed the direct response :return: CertificateProfile, or the result of cls(response) :rtype: ~azure.mgmt.codesigning.models.CertificateProfile @@ -294,16 +298,15 @@ def update( } error_map.update(kwargs.pop('error_map', {})) api_version = "2020-12-14-preview" - content_type = kwargs.pop("content_type", "application/json") accept = "application/json" # Construct URL - url = self.update.metadata['url'] # type: ignore + url = self.get.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'accountName': self._serialize.url("account_name", account_name, 'str'), - 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', pattern=r'^[a-zA-Z0-9-]{3,24}$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str', pattern=r'^[a-zA-Z0-9-]{3,24}$'), } url = self._client.format_url(url, **path_format_arguments) @@ -313,16 +316,9 @@ def update( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - body_content_kwargs = {} # type: Dict[str, Any] - if certificate_profile is not None: - body_content = self._serialize.body(certificate_profile, 'CertificateProfile') - else: - body_content = None - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -337,7 +333,7 @@ def update( return cls(pipeline_response, deserialized, {}) return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSignAccounts/{accountName}/certificateProfiles/{profileName}'} # type: ignore + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSignAccounts/{accountName}/certificateProfiles/{profileName}'} # type: ignore def delete( self, @@ -347,12 +343,11 @@ def delete( **kwargs # type: Any ): # type: (...) -> None - """Delete certificate profile. + """Delete a Certificate Profile. - :param resource_group_name: The name of the resource group under which Code Sign Account is - registered. + :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str - :param account_name: Code Sign account name. + :param account_name: Code Signing account name. :type account_name: str :param profile_name: Certificate profile name. :type profile_name: str @@ -372,10 +367,10 @@ def delete( # Construct URL url = self.delete.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'accountName': self._serialize.url("account_name", account_name, 'str'), - 'profileName': self._serialize.url("profile_name", profile_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', pattern=r'^[a-zA-Z0-9-]{3,24}$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str', pattern=r'^[a-zA-Z0-9-]{3,24}$'), } url = self._client.format_url(url, **path_format_arguments) diff --git a/src/codesigning/azext_codesigning/vendored_sdks/codesigning/operations/_code_sign_account_operations.py b/src/codesigning/azext_codesigning/vendored_sdks/codesigning/operations/_code_sign_account_operations.py index 19ad9256d1a..3589d0749dd 100644 --- a/src/codesigning/azext_codesigning/vendored_sdks/codesigning/operations/_code_sign_account_operations.py +++ b/src/codesigning/azext_codesigning/vendored_sdks/codesigning/operations/_code_sign_account_operations.py @@ -45,161 +45,22 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config - def list_by_subscription( - self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["models.CodeSignAccounts"] - """Lists Code Sign Accounts within a subscription. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either CodeSignAccounts or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.codesigning.models.CodeSignAccounts] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.CodeSignAccounts"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-12-14-preview" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list_by_subscription.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('CodeSignAccounts', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.CodeSigning/codeSignAccounts'} # type: ignore - - def list_by_resource_group( - self, - resource_group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["models.CodeSignAccounts"] - """List Code Sign Accounts within a resource group. - - :param resource_group_name: The name of the resource group under which Code Sign Account is - registered. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either CodeSignAccounts or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.codesigning.models.CodeSignAccounts] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.CodeSignAccounts"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-12-14-preview" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list_by_resource_group.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('CodeSignAccounts', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - error = self._deserialize(models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSignAccounts'} # type: ignore - - def get( + def create( self, resource_group_name, # type: str account_name, # type: str + code_sign_account=None, # type: Optional["models.CodeSignAccount"] **kwargs # type: Any ): # type: (...) -> "models.CodeSignAccount" - """Get Code Sign Account. + """Create a Code Sign Account. - :param resource_group_name: The name of the resource group under which Code Sign Account is - registered. + :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str - :param account_name: Code Sign account name. + :param account_name: Code Signing account name. :type account_name: str + :param code_sign_account: + :type code_sign_account: ~azure.mgmt.codesigning.models.CodeSignAccount :keyword callable cls: A custom type or function that will be passed the direct response :return: CodeSignAccount, or the result of cls(response) :rtype: ~azure.mgmt.codesigning.models.CodeSignAccount @@ -211,14 +72,15 @@ def get( } error_map.update(kwargs.pop('error_map', {})) api_version = "2020-12-14-preview" + content_type = kwargs.pop("content_type", "application/json") accept = "application/json" # Construct URL - url = self.get.metadata['url'] # type: ignore + url = self.create.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', pattern=r'^[a-zA-Z0-9-]{3,24}$'), } url = self._client.format_url(url, **path_format_arguments) @@ -228,42 +90,52 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - request = self._client.get(url, query_parameters, header_parameters) + body_content_kwargs = {} # type: Dict[str, Any] + if code_sign_account is not None: + body_content = self._serialize.body(code_sign_account, 'CodeSignAccount') + else: + body_content = None + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200]: + if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('CodeSignAccount', pipeline_response) + if response.status_code == 200: + deserialized = self._deserialize('CodeSignAccount', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('CodeSignAccount', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSignAccounts/{accountName}'} # type: ignore + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSignAccounts/{accountName}'} # type: ignore - def create( + def update( self, resource_group_name, # type: str account_name, # type: str - code_sign_account=None, # type: Optional["models.CodeSignAccount"] + code_sign_account_patch, # type: "models.CodeSignAccountPatch" **kwargs # type: Any ): # type: (...) -> "models.CodeSignAccount" - """Create Code Sign Account. + """Update a code sign account. - :param resource_group_name: The name of the resource group under which Code Sign Account is - registered. + :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str - :param account_name: Code Sign account name. + :param account_name: Code Signing account name. :type account_name: str - :param code_sign_account: - :type code_sign_account: ~azure.mgmt.codesigning.models.CodeSignAccount + :param code_sign_account_patch: + :type code_sign_account_patch: ~azure.mgmt.codesigning.models.CodeSignAccountPatch :keyword callable cls: A custom type or function that will be passed the direct response :return: CodeSignAccount, or the result of cls(response) :rtype: ~azure.mgmt.codesigning.models.CodeSignAccount @@ -279,11 +151,11 @@ def create( accept = "application/json" # Construct URL - url = self.create.metadata['url'] # type: ignore + url = self.update.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', pattern=r'^[a-zA-Z0-9-]{3,24}$'), } url = self._client.format_url(url, **path_format_arguments) @@ -297,49 +169,38 @@ def create( header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') body_content_kwargs = {} # type: Dict[str, Any] - if code_sign_account is not None: - body_content = self._serialize.body(code_sign_account, 'CodeSignAccount') - else: - body_content = None + body_content = self._serialize.body(code_sign_account_patch, 'CodeSignAccountPatch') body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200, 201]: + if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - if response.status_code == 200: - deserialized = self._deserialize('CodeSignAccount', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('CodeSignAccount', pipeline_response) + deserialized = self._deserialize('CodeSignAccount', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSignAccounts/{accountName}'} # type: ignore + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSignAccounts/{accountName}'} # type: ignore - def update( + def get( self, resource_group_name, # type: str account_name, # type: str - code_sign_account_patch, # type: "models.CodeSignAccountPatch" **kwargs # type: Any ): # type: (...) -> "models.CodeSignAccount" - """Update a code sign account. + """Get a Code Sign Account. - :param resource_group_name: The name of the resource group under which Code Sign Account is - registered. + :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str - :param account_name: Code Sign account name. + :param account_name: Code Signing account name. :type account_name: str - :param code_sign_account_patch: - :type code_sign_account_patch: ~azure.mgmt.codesigning.models.CodeSignAccountPatch :keyword callable cls: A custom type or function that will be passed the direct response :return: CodeSignAccount, or the result of cls(response) :rtype: ~azure.mgmt.codesigning.models.CodeSignAccount @@ -351,15 +212,14 @@ def update( } error_map.update(kwargs.pop('error_map', {})) api_version = "2020-12-14-preview" - content_type = kwargs.pop("content_type", "application/json") accept = "application/json" # Construct URL - url = self.update.metadata['url'] # type: ignore + url = self.get.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', pattern=r'^[a-zA-Z0-9-]{3,24}$'), } url = self._client.format_url(url, **path_format_arguments) @@ -369,13 +229,9 @@ def update( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(code_sign_account_patch, 'CodeSignAccountPatch') - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -390,7 +246,7 @@ def update( return cls(pipeline_response, deserialized, {}) return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSignAccounts/{accountName}'} # type: ignore + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSignAccounts/{accountName}'} # type: ignore def delete( self, @@ -401,10 +257,9 @@ def delete( # type: (...) -> None """Delete a Code Sign Account. - :param resource_group_name: The name of the resource group under which Code Sign Account is - registered. + :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str - :param account_name: Code Sign account name. + :param account_name: Code Signing account name. :type account_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) @@ -422,9 +277,9 @@ def delete( # Construct URL url = self.delete.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', pattern=r'^[a-zA-Z0-9-]{3,24}$'), } url = self._client.format_url(url, **path_format_arguments) @@ -449,3 +304,143 @@ def delete( return cls(pipeline_response, None, {}) delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSignAccounts/{accountName}'} # type: ignore + + def list_by_subscription( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.CodeSignAccounts"] + """Lists Code Sign Accounts within a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either CodeSignAccounts or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.codesigning.models.CodeSignAccounts] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.CodeSignAccounts"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-14-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_subscription.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('CodeSignAccounts', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.CodeSigning/codeSignAccounts'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.CodeSignAccounts"] + """List Code Sign Accounts within a resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either CodeSignAccounts or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.codesigning.models.CodeSignAccounts] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.CodeSignAccounts"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-14-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('CodeSignAccounts', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSignAccounts'} # type: ignore diff --git a/src/codesigning/report.md b/src/codesigning/report.md index 65ea7d53f6b..d722fc43dce 100644 --- a/src/codesigning/report.md +++ b/src/codesigning/report.md @@ -30,13 +30,13 @@ |[az codesigning certificate-profile list](#CertificateProfileListByCodeSignAccount)|ListByCodeSignAccount|[Parameters](#ParametersCertificateProfileListByCodeSignAccount)|[Example](#ExamplesCertificateProfileListByCodeSignAccount)| |[az codesigning certificate-profile show](#CertificateProfileGet)|Get|[Parameters](#ParametersCertificateProfileGet)|[Example](#ExamplesCertificateProfileGet)| |[az codesigning certificate-profile create](#CertificateProfileCreate)|Create|[Parameters](#ParametersCertificateProfileCreate)|[Example](#ExamplesCertificateProfileCreate)| -|[az codesigning certificate-profile update](#CertificateProfileUpdate)|Update|[Parameters](#ParametersCertificateProfileUpdate)|Not Found| +|[az codesigning certificate-profile update](#CertificateProfileUpdate)|Update|[Parameters](#ParametersCertificateProfileUpdate)|[Example](#ExamplesCertificateProfileUpdate)| |[az codesigning certificate-profile delete](#CertificateProfileDelete)|Delete|[Parameters](#ParametersCertificateProfileDelete)|[Example](#ExamplesCertificateProfileDelete)| ### Commands in `az codesigning operation` group |CLI Command|Operation Swagger name|Parameters|Examples| |---------|------------|--------|-----------| -|[az codesigning operation show](#OperationsGet)|Get|[Parameters](#ParametersOperationsGet)|Not Found| +|[az codesigning operation show](#OperationsGet)|Get|[Parameters](#ParametersOperationsGet)|[Example](#ExamplesOperationsGet)| ## COMMAND DETAILS @@ -51,7 +51,7 @@ az codesigning list --resource-group "MyResourceGroup" ##### Parameters |Option|Type|Description|Path (SDK)|Swagger name| |------|----|-----------|----------|------------| -|**--resource-group-name**|string|The name of the resource group under which Code Sign Account is registered|resource_group_name|resourceGroupName| +|**--resource-group-name**|string|The name of the resource group. The name is case insensitive.|resource_group_name|resourceGroupName| #### Command `az codesigning list` @@ -71,39 +71,34 @@ az codesigning show --account-name "MyAccount" --resource-group "MyResourceGroup ##### Parameters |Option|Type|Description|Path (SDK)|Swagger name| |------|----|-----------|----------|------------| -|**--resource-group-name**|string|The name of the resource group under which Code Sign Account is registered|resource_group_name|resourceGroupName| -|**--account-name**|string|Code Sign account name|account_name|accountName| +|**--resource-group-name**|string|The name of the resource group. The name is case insensitive.|resource_group_name|resourceGroupName| +|**--account-name**|string|Code Signing account name|account_name|accountName| #### Command `az codesigning create` ##### Example ``` -az codesigning create --account-name "MyAccount" --location "eastus" --tags key1="value1" --resource-group \ -"MyResourceGroup" +az codesigning create --account-name "MyAccount" --location "eastus" --resource-group "MyResourceGroup" ``` ##### Parameters |Option|Type|Description|Path (SDK)|Swagger name| |------|----|-----------|----------|------------| -|**--resource-group-name**|string|The name of the resource group under which Code Sign Account is registered|resource_group_name|resourceGroupName| -|**--account-name**|string|Code Sign account name|account_name|accountName| +|**--resource-group-name**|string|The name of the resource group. The name is case insensitive.|resource_group_name|resourceGroupName| +|**--account-name**|string|Code Signing account name|account_name|accountName| |**--tags**|dictionary|Resource tags.|tags|tags| |**--location**|string|The geo-location where the resource lives|location|location| -|**--code-sign-account-properties-account-name**|string||code_sign_account_properties_account_name|accountName| -|**--account-url**|string||account_url|accountUrl| -|**--verification-status**|choice|The vetting status of the code sign account|verification_status|verificationStatus| -|**--provisioning-state**|choice|The current provisioning state|provisioning_state|provisioningState| #### Command `az codesigning update` ##### Example ``` -az codesigning update --account-name "MyAccount" --tags key1="value1" --resource-group "MyResourceGroup" +az codesigning update --tags key1="value1" --account-name "MyAccount" --resource-group "MyResourceGroup" ``` ##### Parameters |Option|Type|Description|Path (SDK)|Swagger name| |------|----|-----------|----------|------------| -|**--resource-group-name**|string|The name of the resource group under which Code Sign Account is registered|resource_group_name|resourceGroupName| -|**--account-name**|string|Code Sign account name|account_name|accountName| +|**--resource-group-name**|string|The name of the resource group. The name is case insensitive.|resource_group_name|resourceGroupName| +|**--account-name**|string|Code Signing account name|account_name|accountName| |**--tags**|dictionary|Resource tags.|tags|tags| #### Command `az codesigning delete` @@ -115,8 +110,8 @@ az codesigning delete --account-name "MyAccount" --resource-group "MyResourceGro ##### Parameters |Option|Type|Description|Path (SDK)|Swagger name| |------|----|-----------|----------|------------| -|**--resource-group-name**|string|The name of the resource group under which Code Sign Account is registered|resource_group_name|resourceGroupName| -|**--account-name**|string|Code Sign account name|account_name|accountName| +|**--resource-group-name**|string|The name of the resource group. The name is case insensitive.|resource_group_name|resourceGroupName| +|**--account-name**|string|Code Signing account name|account_name|accountName| ### group `az codesigning certificate-profile` #### Command `az codesigning certificate-profile list` @@ -128,8 +123,8 @@ az codesigning certificate-profile list --account-name "MyAccount" --resource-gr ##### Parameters |Option|Type|Description|Path (SDK)|Swagger name| |------|----|-----------|----------|------------| -|**--resource-group-name**|string|The name of the resource group under which Code Sign Account is registered|resource_group_name|resourceGroupName| -|**--account-name**|string|Code Sign account name|account_name|accountName| +|**--resource-group-name**|string|The name of the resource group. The name is case insensitive.|resource_group_name|resourceGroupName| +|**--account-name**|string|Code Signing account name|account_name|accountName| #### Command `az codesigning certificate-profile show` @@ -141,42 +136,45 @@ az codesigning certificate-profile show --account-name "MyAccount" --profile-nam ##### Parameters |Option|Type|Description|Path (SDK)|Swagger name| |------|----|-----------|----------|------------| -|**--resource-group-name**|string|The name of the resource group under which Code Sign Account is registered|resource_group_name|resourceGroupName| -|**--account-name**|string|Code Sign account name|account_name|accountName| +|**--resource-group-name**|string|The name of the resource group. The name is case insensitive.|resource_group_name|resourceGroupName| +|**--account-name**|string|Code Signing account name|account_name|accountName| |**--profile-name**|string|Certificate profile name|profile_name|profileName| #### Command `az codesigning certificate-profile create` ##### Example ``` -az codesigning certificate-profile create --account-name "MyAccount" --profile-name "profileA" --resource-group \ +az codesigning certificate-profile create --account-name "MyAccount" --profile-name "profileA" --common-name "Contoso" \ +--profile-type "PublicTrust" --subject-alternative-name "Contoso Corporate Engineering" --resource-group \ "MyResourceGroup" ``` ##### Parameters |Option|Type|Description|Path (SDK)|Swagger name| |------|----|-----------|----------|------------| -|**--resource-group-name**|string|The name of the resource group under which Code Sign Account is registered|resource_group_name|resourceGroupName| -|**--account-name**|string|Code Sign account name|account_name|accountName| +|**--resource-group-name**|string|The name of the resource group. The name is case insensitive.|resource_group_name|resourceGroupName| +|**--account-name**|string|Code Signing account name|account_name|accountName| |**--profile-name**|string|Certificate profile name|profile_name|profileName| -|**--certificate-profile-properties-profile-name**|string||certificate_profile_properties_profile_name|profileName| -|**--profile-type**|choice||profile_type|profileType| -|**--common-name**|string||common_name|commonName| -|**--subject-alternative-name**|string||subject_alternative_name|subjectAlternativeName| -|**--provisioning-state**|choice|The current provisioning state|provisioning_state|provisioningState| +|**--profile-type**|choice|Profile type of the certificate|profile_type|profileType| +|**--common-name**|string|Name of the certificate|common_name|commonName| +|**--subject-alternative-name**|string|Subject Alternative Name of the certificate|subject_alternative_name|subjectAlternativeName| #### Command `az codesigning certificate-profile update` +##### Example +``` +az codesigning certificate-profile update --common-name "Contoso" --profile-type "Test" --subject-alternative-name \ +"Contoso Corporate Engineering" --account-name "MyAccount" --profile-name "profileA" --resource-group \ +"MyResourceGroup" +``` ##### Parameters |Option|Type|Description|Path (SDK)|Swagger name| |------|----|-----------|----------|------------| -|**--resource-group-name**|string|The name of the resource group under which Code Sign Account is registered|resource_group_name|resourceGroupName| -|**--account-name**|string|Code Sign account name|account_name|accountName| +|**--resource-group-name**|string|The name of the resource group. The name is case insensitive.|resource_group_name|resourceGroupName| +|**--account-name**|string|Code Signing account name|account_name|accountName| |**--profile-name**|string|Certificate profile name|profile_name|profileName| -|**--certificate-profile-properties-profile-name**|string||certificate_profile_properties_profile_name|profileName| -|**--profile-type**|choice||profile_type|profileType| -|**--common-name**|string||common_name|commonName| -|**--subject-alternative-name**|string||subject_alternative_name|subjectAlternativeName| -|**--provisioning-state**|choice|The current provisioning state|provisioning_state|provisioningState| +|**--profile-type**|choice|Profile type of the certificate|profile_type|profileType| +|**--common-name**|string|Name of the certificate|common_name|commonName| +|**--subject-alternative-name**|string|Subject Alternative Name of the certificate|subject_alternative_name|subjectAlternativeName| #### Command `az codesigning certificate-profile delete` @@ -188,13 +186,17 @@ az codesigning certificate-profile delete --account-name "MyAccount" --profile-n ##### Parameters |Option|Type|Description|Path (SDK)|Swagger name| |------|----|-----------|----------|------------| -|**--resource-group-name**|string|The name of the resource group under which Code Sign Account is registered|resource_group_name|resourceGroupName| -|**--account-name**|string|Code Sign account name|account_name|accountName| +|**--resource-group-name**|string|The name of the resource group. The name is case insensitive.|resource_group_name|resourceGroupName| +|**--account-name**|string|Code Signing account name|account_name|accountName| |**--profile-name**|string|Certificate profile name|profile_name|profileName| ### group `az codesigning operation` #### Command `az codesigning operation show` +##### Example +``` +az codesigning operation show +``` ##### Parameters |Option|Type|Description|Path (SDK)|Swagger name| |------|----|-----------|----------|------------| \ No newline at end of file From b2e6cd985b4fa63b05d9f19b7dc28dc7a6defd6a Mon Sep 17 00:00:00 2001 From: Amrita Shanbhag Date: Wed, 2 Jun 2021 17:50:09 +0530 Subject: [PATCH 3/3] Updated the extension --- src/codesigning/README.md | 29 +- .../generated/_client_factory.py | 8 +- .../azext_codesigning/generated/_help.py | 91 +-- .../azext_codesigning/generated/_params.py | 38 +- .../azext_codesigning/generated/commands.py | 30 +- .../azext_codesigning/generated/custom.py | 109 ++-- .../tests/latest/example_steps.py | 55 +- .../recordings/test_codesigning_Scenario.yaml | 349 ++++++----- .../tests/latest/test_codesigning_scenario.py | 13 +- .../test_codesigning_scenario_coverage.md | 20 +- .../_code_signing_management_client.py | 11 +- .../aio/_code_signing_management_client.py | 11 +- .../codesigning/aio/operations/__init__.py | 4 +- .../_certificate_profile_operations.py | 247 ++++++-- .../_code_signing_account_operations.py | 549 +++++++++++++++++ .../codesigning/aio/operations/_operations.py | 6 +- .../codesigning/models/__init__.py | 23 +- .../_code_signing_management_client_enums.py | 13 +- .../codesigning/models/_models.py | 158 ++--- .../codesigning/models/_models_py3.py | 168 +++--- .../codesigning/operations/__init__.py | 4 +- .../_certificate_profile_operations.py | 249 ++++++-- .../_code_signing_account_operations.py | 561 ++++++++++++++++++ .../codesigning/operations/_operations.py | 6 +- .../vendored_sdks/codesigning/setup.py | 37 ++ src/codesigning/report.md | 132 ++--- 26 files changed, 2111 insertions(+), 810 deletions(-) create mode 100644 src/codesigning/azext_codesigning/vendored_sdks/codesigning/aio/operations/_code_signing_account_operations.py create mode 100644 src/codesigning/azext_codesigning/vendored_sdks/codesigning/operations/_code_signing_account_operations.py create mode 100644 src/codesigning/azext_codesigning/vendored_sdks/codesigning/setup.py diff --git a/src/codesigning/README.md b/src/codesigning/README.md index c92f15db196..4607b256867 100644 --- a/src/codesigning/README.md +++ b/src/codesigning/README.md @@ -11,11 +11,11 @@ az extension add --name codesigning #### codesigning #### ##### Create ##### ``` -az codesigning create --account-name "MyAccount" --location "eastus" --resource-group "MyResourceGroup" +az codesigning create --name "MyAccount" --location "eastus" --resource-group "MyResourceGroup" ``` ##### Show ##### ``` -az codesigning show --account-name "MyAccount" --resource-group "MyResourceGroup" +az codesigning show --name "MyAccount" --resource-group "MyResourceGroup" ``` ##### List ##### ``` @@ -23,41 +23,28 @@ az codesigning list --resource-group "MyResourceGroup" ``` ##### Update ##### ``` -az codesigning update --tags key1="value1" --account-name "MyAccount" --resource-group "MyResourceGroup" +az codesigning update --name "MyAccount" --tags key1="value1" --resource-group "MyResourceGroup" ``` ##### Delete ##### ``` -az codesigning delete --account-name "MyAccount" --resource-group "MyResourceGroup" +az codesigning delete --name "MyAccount" --resource-group "MyResourceGroup" ``` #### codesigning certificate-profile #### ##### Create ##### ``` -az codesigning certificate-profile create --account-name "MyAccount" --profile-name "profileA" --common-name "Contoso" \ - --profile-type "PublicTrust" --subject-alternative-name "Contoso Corporate Engineering" \ - --resource-group "MyResourceGroup" +az codesigning certificate-profile create --account-name "MyAccount" --common-name "Contoso Inc" \ + --organization "Contoso Inc" --name "profileA" --resource-group "MyResourceGroup" ``` ##### Show ##### ``` -az codesigning certificate-profile show --account-name "MyAccount" --profile-name "profileA" \ - --resource-group "MyResourceGroup" +az codesigning certificate-profile show --account-name "MyAccount" --name "profileA" --resource-group "MyResourceGroup" ``` ##### List ##### ``` az codesigning certificate-profile list --account-name "MyAccount" --resource-group "MyResourceGroup" ``` -##### Update ##### -``` -az codesigning certificate-profile update --common-name "Contoso" --profile-type "Test" \ - --subject-alternative-name "Contoso Corporate Engineering" --account-name "MyAccount" --profile-name "profileA" \ - --resource-group "MyResourceGroup" -``` ##### Delete ##### ``` -az codesigning certificate-profile delete --account-name "MyAccount" --profile-name "profileA" \ +az codesigning certificate-profile delete --account-name "MyAccount" --name "profileA" \ --resource-group "MyResourceGroup" -``` -#### codesigning operation #### -##### Show ##### -``` -az codesigning operation show ``` \ No newline at end of file diff --git a/src/codesigning/azext_codesigning/generated/_client_factory.py b/src/codesigning/azext_codesigning/generated/_client_factory.py index 8a92587fa43..9db5734aa84 100644 --- a/src/codesigning/azext_codesigning/generated/_client_factory.py +++ b/src/codesigning/azext_codesigning/generated/_client_factory.py @@ -16,13 +16,9 @@ def cf_codesigning_cl(cli_ctx, *_): CodeSigningManagementClient) -def cf_code_sign_account(cli_ctx, *_): - return cf_codesigning_cl(cli_ctx).code_sign_account +def cf_code_signing_account(cli_ctx, *_): + return cf_codesigning_cl(cli_ctx).code_signing_account def cf_certificate_profile(cli_ctx, *_): return cf_codesigning_cl(cli_ctx).certificate_profile - - -def cf_operation(cli_ctx, *_): - return cf_codesigning_cl(cli_ctx).operations diff --git a/src/codesigning/azext_codesigning/generated/_help.py b/src/codesigning/azext_codesigning/generated/_help.py index 6ea8937b734..9eb274bc4ab 100644 --- a/src/codesigning/azext_codesigning/generated/_help.py +++ b/src/codesigning/azext_codesigning/generated/_help.py @@ -14,57 +14,68 @@ helps['codesigning'] = """ type: group - short-summary: Manage code sign account with codesigning + short-summary: Manage code signing account with codesigning """ helps['codesigning list'] = """ type: command - short-summary: "List Code Sign Accounts within a resource group And Lists Code Sign Accounts within a \ + short-summary: "List Code Signing Accounts within a resource group And Lists Code Signing Accounts within a \ subscription." examples: - - name: List Code Sign Accounts by Resource Group + - name: List Code Signing Accounts by Resource Group text: |- az codesigning list --resource-group "MyResourceGroup" - - name: List Code Sign Accounts by Subscription + - name: List Code Signing Accounts by Subscription text: |- az codesigning list """ helps['codesigning show'] = """ type: command - short-summary: "Get a Code Sign Account." + short-summary: "Get a Code Signing Account." examples: - - name: Get Code Sign Account + - name: Get Code Signing Account text: |- - az codesigning show --account-name "MyAccount" --resource-group "MyResourceGroup" + az codesigning show --name "MyAccount" --resource-group "MyResourceGroup" """ helps['codesigning create'] = """ type: command - short-summary: "Create a Code Sign Account." + short-summary: "Create a Code Signing Account." examples: - - name: Create Code Sign Account + - name: Create Code Signing Account text: |- - az codesigning create --account-name "MyAccount" --location "eastus" --resource-group "MyResourceGroup" + az codesigning create --name "MyAccount" --location "eastus" --resource-group "MyResourceGroup" """ helps['codesigning update'] = """ type: command - short-summary: "Update a code sign account." + short-summary: "Update a code signing account." examples: - - name: Update Code Sign Account + - name: Update Code Signing Account text: |- - az codesigning update --tags key1="value1" --account-name "MyAccount" --resource-group \ -"MyResourceGroup" + az codesigning update --name "MyAccount" --tags key1="value1" --resource-group "MyResourceGroup" """ helps['codesigning delete'] = """ type: command - short-summary: "Delete a Code Sign Account." + short-summary: "Delete Code Signing Account." examples: - - name: Delete Code Sign Account + - name: Delete Code Signing Account text: |- - az codesigning delete --account-name "MyAccount" --resource-group "MyResourceGroup" + az codesigning delete --name "MyAccount" --resource-group "MyResourceGroup" +""" + +helps['codesigning wait'] = """ + type: command + short-summary: Place the CLI in a waiting state until a condition of the codesigning is met. + examples: + - name: Pause executing next line of CLI script until the codesigning is successfully created. + text: |- + az codesigning wait --name "MyAccount" --resource-group "MyResourceGroup" --created + - name: Pause executing next line of CLI script until the codesigning is successfully deleted. + text: |- + az codesigning wait --name "MyAccount" --resource-group "MyResourceGroup" --deleted """ helps['codesigning certificate-profile'] = """ @@ -74,7 +85,7 @@ helps['codesigning certificate-profile list'] = """ type: command - short-summary: "List certificate profiles within a code sign account." + short-summary: "List certificate profiles within a code signing account." examples: - name: List Certificate Profiles text: |- @@ -87,8 +98,8 @@ examples: - name: Get Certificate Profile text: |- - az codesigning certificate-profile show --account-name "MyAccount" --profile-name "profileA" \ ---resource-group "MyResourceGroup" + az codesigning certificate-profile show --account-name "MyAccount" --name "profileA" --resource-group \ +"MyResourceGroup" """ helps['codesigning certificate-profile create'] = """ @@ -97,20 +108,8 @@ examples: - name: Create Certificate Profile text: |- - az codesigning certificate-profile create --account-name "MyAccount" --profile-name "profileA" \ ---common-name "Contoso" --profile-type "PublicTrust" --subject-alternative-name "Contoso Corporate Engineering" \ ---resource-group "MyResourceGroup" -""" - -helps['codesigning certificate-profile update'] = """ - type: command - short-summary: "Update a certificate profile." - examples: - - name: Update Certificate Profile - text: |- - az codesigning certificate-profile update --common-name "Contoso" --profile-type "Test" \ ---subject-alternative-name "Contoso Corporate Engineering" --account-name "MyAccount" --profile-name "profileA" \ ---resource-group "MyResourceGroup" + az codesigning certificate-profile create --account-name "MyAccount" --common-name "Contoso Inc" \ +--organization "Contoso Inc" --name "profileA" --resource-group "MyResourceGroup" """ helps['codesigning certificate-profile delete'] = """ @@ -119,20 +118,22 @@ examples: - name: Delete Certificate Profile text: |- - az codesigning certificate-profile delete --account-name "MyAccount" --profile-name "profileA" \ ---resource-group "MyResourceGroup" -""" - -helps['codesigning operation'] = """ - type: group - short-summary: Manage operation with codesigning + az codesigning certificate-profile delete --account-name "MyAccount" --name "profileA" --resource-group \ +"MyResourceGroup" """ -helps['codesigning operation show'] = """ +helps['codesigning certificate-profile wait'] = """ type: command - short-summary: "Lists all of the available API operations for code signing resource." + short-summary: Place the CLI in a waiting state until a condition of the codesigning certificate-profile is met. examples: - - name: List Code Sign Account operations + - name: Pause executing next line of CLI script until the codesigning certificate-profile is successfully \ +created. + text: |- + az codesigning certificate-profile wait --account-name "MyAccount" --name "profileA" --resource-group \ +"MyResourceGroup" --created + - name: Pause executing next line of CLI script until the codesigning certificate-profile is successfully \ +deleted. text: |- - az codesigning operation show + az codesigning certificate-profile wait --account-name "MyAccount" --name "profileA" --resource-group \ +"MyResourceGroup" --deleted """ diff --git a/src/codesigning/azext_codesigning/generated/_params.py b/src/codesigning/azext_codesigning/generated/_params.py index 60107b48a05..a4788955e9a 100644 --- a/src/codesigning/azext_codesigning/generated/_params.py +++ b/src/codesigning/azext_codesigning/generated/_params.py @@ -12,7 +12,6 @@ from azure.cli.core.commands.parameters import ( tags_type, - get_enum_type, resource_group_name_type, get_location_type ) @@ -26,23 +25,27 @@ def load_arguments(self, _): with self.argument_context('codesigning show') as c: c.argument('resource_group_name', resource_group_name_type) - c.argument('account_name', type=str, help='Code Signing account name', id_part='name') + c.argument('name', options_list=['--name', '-n'], type=str, help='Code Signing account name', id_part='name') with self.argument_context('codesigning create') as c: c.argument('resource_group_name', resource_group_name_type) - c.argument('account_name', type=str, help='Code Signing account name') + c.argument('name', options_list=['--name', '-n'], type=str, help='Code Signing account name') c.argument('tags', tags_type) c.argument('location', arg_type=get_location_type(self.cli_ctx), required=False, validator=get_default_location_from_resource_group) with self.argument_context('codesigning update') as c: c.argument('resource_group_name', resource_group_name_type) - c.argument('account_name', type=str, help='Code Signing account name', id_part='name') + c.argument('name', options_list=['--name', '-n'], type=str, help='Code Signing account name', id_part='name') c.argument('tags', tags_type) with self.argument_context('codesigning delete') as c: c.argument('resource_group_name', resource_group_name_type) - c.argument('account_name', type=str, help='Code Signing account name', id_part='name') + c.argument('name', options_list=['--name', '-n'], type=str, help='Code Signing account name', id_part='name') + + with self.argument_context('codesigning wait') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('name', options_list=['--name', '-n'], type=str, help='Code Signing account name', id_part='name') with self.argument_context('codesigning certificate-profile list') as c: c.argument('resource_group_name', resource_group_name_type) @@ -51,27 +54,24 @@ def load_arguments(self, _): with self.argument_context('codesigning certificate-profile show') as c: c.argument('resource_group_name', resource_group_name_type) c.argument('account_name', type=str, help='Code Signing account name', id_part='name') - c.argument('profile_name', type=str, help='Certificate profile name', id_part='child_name_1') + c.argument('name', options_list=['--name', '-n'], type=str, help='Certificate profile name', + id_part='child_name_1') with self.argument_context('codesigning certificate-profile create') as c: c.argument('resource_group_name', resource_group_name_type) c.argument('account_name', type=str, help='Code Signing account name') - c.argument('profile_name', type=str, help='Certificate profile name') - c.argument('profile_type', arg_type=get_enum_type(['Test', 'Trial', 'PrivateTrust', 'PublicTrust']), - help='Profile type of the certificate') - c.argument('common_name', type=str, help='Name of the certificate') - c.argument('subject_alternative_name', type=str, help='Subject Alternative Name of the certificate') + c.argument('name', options_list=['--name', '-n'], type=str, help='Certificate profile name') + c.argument('common_name', type=str, help='Used as CN in the subject name of the certificate') + c.argument('organization', type=str, help='Used as O in the subject name of the certificate') - with self.argument_context('codesigning certificate-profile update') as c: + with self.argument_context('codesigning certificate-profile delete') as c: c.argument('resource_group_name', resource_group_name_type) c.argument('account_name', type=str, help='Code Signing account name', id_part='name') - c.argument('profile_name', type=str, help='Certificate profile name', id_part='child_name_1') - c.argument('profile_type', arg_type=get_enum_type(['Test', 'Trial', 'PrivateTrust', 'PublicTrust']), - help='Profile type of the certificate') - c.argument('common_name', type=str, help='Name of the certificate') - c.argument('subject_alternative_name', type=str, help='Subject Alternative Name of the certificate') + c.argument('name', options_list=['--name', '-n'], type=str, help='Certificate profile name', + id_part='child_name_1') - with self.argument_context('codesigning certificate-profile delete') as c: + with self.argument_context('codesigning certificate-profile wait') as c: c.argument('resource_group_name', resource_group_name_type) c.argument('account_name', type=str, help='Code Signing account name', id_part='name') - c.argument('profile_name', type=str, help='Certificate profile name', id_part='child_name_1') + c.argument('name', options_list=['--name', '-n'], type=str, help='Certificate profile name', + id_part='child_name_1') diff --git a/src/codesigning/azext_codesigning/generated/commands.py b/src/codesigning/azext_codesigning/generated/commands.py index 11ab76aec98..522c6ab501f 100644 --- a/src/codesigning/azext_codesigning/generated/commands.py +++ b/src/codesigning/azext_codesigning/generated/commands.py @@ -15,18 +15,19 @@ def load_command_table(self, _): - from azext_codesigning.generated._client_factory import cf_code_sign_account - codesigning_code_sign_account = CliCommandType( - operations_tmpl='azext_codesigning.vendored_sdks.codesigning.operations._code_sign_account_operations#CodeSignA' - 'ccountOperations.{}', - client_factory=cf_code_sign_account) - with self.command_group('codesigning', codesigning_code_sign_account, client_factory=cf_code_sign_account, + from azext_codesigning.generated._client_factory import cf_code_signing_account + codesigning_code_signing_account = CliCommandType( + operations_tmpl='azext_codesigning.vendored_sdks.codesigning.operations._code_signing_account_operations#CodeSi' + 'gningAccountOperations.{}', + client_factory=cf_code_signing_account) + with self.command_group('codesigning', codesigning_code_signing_account, client_factory=cf_code_signing_account, is_experimental=True) as g: g.custom_command('list', 'codesigning_list') g.custom_show_command('show', 'codesigning_show') - g.custom_command('create', 'codesigning_create') + g.custom_command('create', 'codesigning_create', supports_no_wait=True) g.custom_command('update', 'codesigning_update') - g.custom_command('delete', 'codesigning_delete', confirmation=True) + g.custom_command('delete', 'codesigning_delete', supports_no_wait=True, confirmation=True) + g.custom_wait_command('wait', 'codesigning_show') from azext_codesigning.generated._client_factory import cf_certificate_profile codesigning_certificate_profile = CliCommandType( @@ -37,13 +38,6 @@ def load_command_table(self, _): client_factory=cf_certificate_profile) as g: g.custom_command('list', 'codesigning_certificate_profile_list') g.custom_show_command('show', 'codesigning_certificate_profile_show') - g.custom_command('create', 'codesigning_certificate_profile_create') - g.custom_command('update', 'codesigning_certificate_profile_update') - g.custom_command('delete', 'codesigning_certificate_profile_delete', confirmation=True) - - from azext_codesigning.generated._client_factory import cf_operation - codesigning_operation = CliCommandType( - operations_tmpl='azext_codesigning.vendored_sdks.codesigning.operations._operations_operations#Operations.{}', - client_factory=cf_operation) - with self.command_group('codesigning operation', codesigning_operation, client_factory=cf_operation) as g: - g.custom_show_command('show', 'codesigning_operation_show') + g.custom_command('create', 'codesigning_certificate_profile_create', supports_no_wait=True) + g.custom_command('delete', 'codesigning_certificate_profile_delete', supports_no_wait=True, confirmation=True) + g.custom_wait_command('wait', 'codesigning_certificate_profile_show') diff --git a/src/codesigning/azext_codesigning/generated/custom.py b/src/codesigning/azext_codesigning/generated/custom.py index ab9df5b7280..412bd50dc5a 100644 --- a/src/codesigning/azext_codesigning/generated/custom.py +++ b/src/codesigning/azext_codesigning/generated/custom.py @@ -9,6 +9,8 @@ # -------------------------------------------------------------------------- # pylint: disable=too-many-lines +from azure.cli.core.util import sdk_no_wait + def codesigning_list(client, resource_group_name=None): @@ -19,102 +21,91 @@ def codesigning_list(client, def codesigning_show(client, resource_group_name, - account_name): + name): return client.get(resource_group_name=resource_group_name, - account_name=account_name) + account_name=name) def codesigning_create(client, resource_group_name, - account_name, + name, tags=None, - location=None): - code_sign_account = {} - code_sign_account['tags'] = tags - code_sign_account['location'] = location - return client.create(resource_group_name=resource_group_name, - account_name=account_name, - code_sign_account=code_sign_account) + location=None, + no_wait=False): + code_signing_account = {} + code_signing_account['tags'] = tags + code_signing_account['location'] = location + return sdk_no_wait(no_wait, + client.begin_create, + resource_group_name=resource_group_name, + account_name=name, + code_signing_account=code_signing_account) def codesigning_update(client, resource_group_name, - account_name, + name, tags=None): - code_sign_account_patch = {} - code_sign_account_patch['tags'] = tags + code_signing_account_patch = {} + code_signing_account_patch['tags'] = tags return client.update(resource_group_name=resource_group_name, - account_name=account_name, - code_sign_account_patch=code_sign_account_patch) + account_name=name, + code_signing_account_patch=code_signing_account_patch) def codesigning_delete(client, resource_group_name, - account_name): - return client.delete(resource_group_name=resource_group_name, - account_name=account_name) + name, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_delete, + resource_group_name=resource_group_name, + account_name=name) def codesigning_certificate_profile_list(client, resource_group_name, account_name): - return client.list_by_code_sign_account(resource_group_name=resource_group_name, - account_name=account_name) + return client.list_by_code_signing_account(resource_group_name=resource_group_name, + account_name=account_name) def codesigning_certificate_profile_show(client, resource_group_name, account_name, - profile_name): + name): return client.get(resource_group_name=resource_group_name, account_name=account_name, - profile_name=profile_name) + profile_name=name) def codesigning_certificate_profile_create(client, resource_group_name, account_name, - profile_name, - profile_type=None, - common_name=None, - subject_alternative_name=None): - certificate_profile = {} - certificate_profile['profile_type'] = profile_type - certificate_profile['rotation_policy'] = "Monthly" - certificate_profile['common_name'] = common_name - certificate_profile['subject_alternative_name'] = subject_alternative_name - return client.create(resource_group_name=resource_group_name, - account_name=account_name, - profile_name=profile_name, - certificate_profile=certificate_profile) - - -def codesigning_certificate_profile_update(client, - resource_group_name, - account_name, - profile_name, - profile_type=None, - common_name=None, - subject_alternative_name=None): + name, + common_name, + organization, + no_wait=False): certificate_profile = {} - certificate_profile['profile_type'] = profile_type - certificate_profile['rotation_policy'] = "Monthly" + certificate_profile['profile_type'] = "PublicTrust" + certificate_profile['rotation_policy'] = "30 Days" certificate_profile['common_name'] = common_name - certificate_profile['subject_alternative_name'] = subject_alternative_name - return client.update(resource_group_name=resource_group_name, - account_name=account_name, - profile_name=profile_name, - certificate_profile=certificate_profile) + certificate_profile['organization'] = organization + return sdk_no_wait(no_wait, + client.begin_create, + resource_group_name=resource_group_name, + account_name=account_name, + profile_name=name, + certificate_profile=certificate_profile) def codesigning_certificate_profile_delete(client, resource_group_name, account_name, - profile_name): - return client.delete(resource_group_name=resource_group_name, - account_name=account_name, - profile_name=profile_name) - - -def codesigning_operation_show(client): - return client.get() + name, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_delete, + resource_group_name=resource_group_name, + account_name=account_name, + profile_name=name) diff --git a/src/codesigning/azext_codesigning/tests/latest/example_steps.py b/src/codesigning/azext_codesigning/tests/latest/example_steps.py index a3456a871df..50126f3cbd8 100644 --- a/src/codesigning/azext_codesigning/tests/latest/example_steps.py +++ b/src/codesigning/azext_codesigning/tests/latest/example_steps.py @@ -19,10 +19,9 @@ def step_certificate_profile_create(test, rg, checks=None): # pylint: disable=u checks = [] test.cmd('az codesigning certificate-profile create ' '--account-name "MyAccount" ' - '--profile-name "profileA" ' - '--common-name "Contoso" ' - '--profile-type "PublicTrust" ' - '--subject-alternative-name "Contoso Corporate Engineering" ' + '--common-name "Contoso Inc" ' + '--organization "Contoso Inc" ' + '--name "profileA" ' '--resource-group "{rg}"', checks=checks) @@ -34,7 +33,7 @@ def step_certificate_profile_show(test, rg, checks=None): # pylint: disable=unu checks = [] test.cmd('az codesigning certificate-profile show ' '--account-name "MyAccount" ' - '--profile-name "profileA" ' + '--name "profileA" ' '--resource-group "{rg}"', checks=checks) @@ -50,21 +49,6 @@ def step_certificate_profile_list(test, rg, checks=None): # pylint: disable=unu checks=checks) -# EXAMPLE: /CertificateProfile/patch/Update Certificate Profile -@try_manual -def step_certificate_profile_update(test, rg, checks=None): # pylint: disable=unused-argument - if checks is None: - checks = [] - test.cmd('az codesigning certificate-profile update ' - '--common-name "Contoso" ' - '--profile-type "Test" ' - '--subject-alternative-name "Contoso Corporate Engineering" ' - '--account-name "MyAccount" ' - '--profile-name "profileA" ' - '--resource-group "{rg}"', - checks=checks) - - # EXAMPLE: /CertificateProfile/delete/Delete Certificate Profile @try_manual def step_certificate_profile_delete(test, rg, checks=None): # pylint: disable=unused-argument @@ -72,35 +56,35 @@ def step_certificate_profile_delete(test, rg, checks=None): # pylint: disable=u checks = [] test.cmd('az codesigning certificate-profile delete -y ' '--account-name "MyAccount" ' - '--profile-name "profileA" ' + '--name "profileA" ' '--resource-group "{rg}"', checks=checks) -# EXAMPLE: /CodeSignAccount/put/Create Code Sign Account +# EXAMPLE: /CodeSigningAccount/put/Create Code Signing Account @try_manual def step_create(test, rg, checks=None): # pylint: disable=unused-argument if checks is None: checks = [] test.cmd('az codesigning create ' - '--account-name "MyAccount" ' + '--name "MyAccount" ' '--location "eastus" ' '--resource-group "{rg}"', checks=checks) -# EXAMPLE: /CodeSignAccount/get/Get Code Sign Account +# EXAMPLE: /CodeSigningAccount/get/Get Code Signing Account @try_manual def step_show(test, rg, checks=None): # pylint: disable=unused-argument if checks is None: checks = [] test.cmd('az codesigning show ' - '--account-name "MyAccount" ' + '--name "MyAccount" ' '--resource-group "{rg}"', checks=checks) -# EXAMPLE: /CodeSignAccount/get/List Code Sign Accounts by Resource Group +# EXAMPLE: /CodeSigningAccount/get/List Code Signing Accounts by Resource Group @try_manual def step_list(test, rg, checks=None): # pylint: disable=unused-argument if checks is None: @@ -110,7 +94,7 @@ def step_list(test, rg, checks=None): # pylint: disable=unused-argument checks=checks) -# EXAMPLE: /CodeSignAccount/get/List Code Sign Accounts by Subscription +# EXAMPLE: /CodeSigningAccount/get/List Code Signing Accounts by Subscription @try_manual def step_list2(test, rg, checks=None): # pylint: disable=unused-argument if checks is None: @@ -120,33 +104,24 @@ def step_list2(test, rg, checks=None): # pylint: disable=unused-argument checks=checks) -# EXAMPLE: /CodeSignAccount/patch/Update Code Sign Account +# EXAMPLE: /CodeSigningAccount/patch/Update Code Signing Account @try_manual def step_update(test, rg, checks=None): # pylint: disable=unused-argument if checks is None: checks = [] test.cmd('az codesigning update ' + '--name "MyAccount" ' '--tags key1="value1" ' - '--account-name "MyAccount" ' '--resource-group "{rg}"', checks=checks) -# EXAMPLE: /CodeSignAccount/delete/Delete Code Sign Account +# EXAMPLE: /CodeSigningAccount/delete/Delete Code Signing Account @try_manual def step_delete(test, rg, checks=None): # pylint: disable=unused-argument if checks is None: checks = [] test.cmd('az codesigning delete -y ' - '--account-name "MyAccount" ' + '--name "MyAccount" ' '--resource-group "{rg}"', checks=checks) - - -# EXAMPLE: /Operations/get/List Code Sign Account operations -@try_manual -def step_operation_show(test, rg, checks=None): # pylint: disable=unused-argument - if checks is None: - checks = [] - test.cmd('az codesigning operation show', - checks=checks) diff --git a/src/codesigning/azext_codesigning/tests/latest/recordings/test_codesigning_Scenario.yaml b/src/codesigning/azext_codesigning/tests/latest/recordings/test_codesigning_Scenario.yaml index 55335dd8fdd..a6c9b32715c 100644 --- a/src/codesigning/azext_codesigning/tests/latest/recordings/test_codesigning_Scenario.yaml +++ b/src/codesigning/azext_codesigning/tests/latest/recordings/test_codesigning_Scenario.yaml @@ -39,13 +39,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 12 Mar 2021 11:22:26 GMT + - Wed, 02 Jun 2021 11:09:45 GMT p3p: - CP="DSP CUR OTPi IND OTRi ONL FIN" set-cookie: - - fpc=Ap37vIXv_rROrKy8fE5RCQQ; expires=Sun, 11-Apr-2021 11:22:26 GMT; path=/; + - fpc=AoFi0qrsTuxDoJ9BOl10KPo; expires=Fri, 02-Jul-2021 11:09:46 GMT; path=/; secure; HttpOnly; SameSite=None - - esctx=AQABAAAAAAD--DLA3VO7QrddgJg7Wevr6t3f-QdW1HJIPY1d1V1oE46nKlvwOjcC6ys-MuPTAfoMGkBdvC83Rnn2FztpSU8uGrvAeciQh8v0G9_N683rhJiFVSCglDMK-3PPtWCf0b9lWDL1gh98rAwgQfbQj6RMzaA4cxlb5x_i1f_GzN_t4TRueCG-Az8GOvTo2oOlLoEgAA; + - esctx=AQABAAAAAAD--DLA3VO7QrddgJg7Wevrzt2CFVGyKjLTBxUuaLBt401CiR-wqS4SM9ATwUcIAdCksyAoYhrfrTH1PhT-CjSh1Td-ZflG3tvAfmwidNp3H3QeZUmDUmTL38Fx4AqX8yNHc7ju4tn1DIdYg_8v5YrT8ookqAPwnQebqGOf3GudLsYepkXlOSB2MT3bcqgyeBcgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None - x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly - stsservicecookie=estsfd; path=/; secure; samesite=none; httponly @@ -54,7 +54,7 @@ interactions: x-content-type-options: - nosniff x-ms-ests-server: - - 2.1.11562.6 - SEASLR2 ProdSlices + - 2.1.11722.21 - KRSLR2 ProdSlices status: code: 200 message: OK @@ -74,48 +74,43 @@ interactions: Content-Type: - application/json ParameterSetName: - - --account-name --location --resource-group + - --name --location --resource-group User-Agent: - AZURECLI/2.17.1 azsdk-python-mgmt-codesigning/0.1.0 Python/3.7.9 (Windows-10-10.0.19041-SP0) method: PUT - uri: https://api-dogfood.resources.windows-int.net/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.CodeSigning/codeSignAccounts/MyAccount?api-version=2020-12-14-preview + uri: https://api-dogfood.resources.windows-int.net/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.CodeSigning/codeSigningAccounts/MyAccount?api-version=2020-12-14-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.CodeSigning/codeSignAccounts/MyAccount","name":"MyAccount","type":"Microsoft.CodeSigning/codeSignAccounts","location":"eastus","systemData":{"createdBy":"billtest124476@outlook.com","createdByType":"User","createdAt":"2021-03-12T11:22:30.4322131Z","lastModifiedBy":"billtest124476@outlook.com","lastModifiedByType":"User","lastModifiedAt":"2021-03-12T11:22:30.4322131Z"},"properties":{"accountUri":null,"provisioningState":"Succeeded","verificationStatus":"NotCompleted"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.CodeSigning/codeSigningAccounts/MyAccount","name":"MyAccount","type":"microsoft.codesigning/codesigningaccounts","location":"eastus","systemData":{"createdBy":"billtest124476@outlook.com","createdByType":"User","createdAt":"2021-06-02T11:09:52.2908382Z","lastModifiedBy":"billtest124476@outlook.com","lastModifiedByType":"User","lastModifiedAt":"2021-06-02T11:09:52.2908382Z"},"properties":{"provisioningState":"Succeeded"}}' headers: cache-control: - no-cache content-length: - - '642' + - '594' content-type: - application/json; charset=utf-8 date: - - Fri, 12 Mar 2021 11:22:35 GMT + - Wed, 02 Jun 2021 11:09:55 GMT etag: - - '"2900f273-0000-0700-0000-604b4efb0000"' + - '"00001b57-0000-0700-0000-60b767030000"' expires: - '-1' pragma: - no-cache request-context: - - appId=cid-v1:c73a5c90-b6dd-400a-b5e1-6c06fd162b47 - set-cookie: - - ARRAffinity=2d343760a8ed36b0212d0c52481d1fee3a42070a07d1709749e873bd7238f130;Path=/;HttpOnly;Secure;Domain=codesigning-userrp-ppe.azurewebsites.net - - ARRAffinitySameSite=2d343760a8ed36b0212d0c52481d1fee3a42070a07d1709749e873bd7238f130;Path=/;HttpOnly;SameSite=None;Secure;Domain=codesigning-userrp-ppe.azurewebsites.net + - appId= strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding,Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-providerhub-traffic: - 'True' x-ms-ratelimit-remaining-subscription-writes: - - '1198' - x-powered-by: - - ASP.NET + - '1199' + x-msedge-ref: + - 'Ref A: 75CD3DDF37904736BE88E2C1D6010B19 Ref B: MAA01EDGE0407 Ref C: 2021-06-02T11:09:46Z' status: code: 200 message: OK @@ -159,13 +154,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 12 Mar 2021 11:22:35 GMT + - Wed, 02 Jun 2021 11:09:56 GMT p3p: - CP="DSP CUR OTPi IND OTRi ONL FIN" set-cookie: - - fpc=Aj5Du2BfUeVLroZ96eisimk; expires=Sun, 11-Apr-2021 11:22:36 GMT; path=/; + - fpc=AvnsSycYX9VIu5jaOAC12_c; expires=Fri, 02-Jul-2021 11:09:56 GMT; path=/; secure; HttpOnly; SameSite=None - - esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevretesaV-WtcTdjoumOBcQ5isyRO8d1qmIsleGPucuSDrO8ZRfpDFr7F_9aRfp_0ukJCvqcBuzXJB1ZgwOXK1GLhL04OO4exTFv9w71ibK4I0VlOKKB14TXTQsYspnp_JSiTzOJzPz0_ft_Fo4HseYtMHSXwsQaoNtYegFeqdMssogAA; + - esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrkHMHlKTieOuQGMZAYQTihsYznEtTf1IqzwQtavoAQZl6muQVOi6T7QcJS_3RUEmWAmf9nrOTTM7OIFgXElV9o4F9z-2qXhW3lZvY8HiT8njtY_1P1LEF7GXeX2dOWQkQf_dlzPHcAVxZFVu6HwFipRzOhkSgboYMv_2TsO-BPd4gAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None - x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly - stsservicecookie=estsfd; path=/; secure; samesite=none; httponly @@ -174,7 +169,7 @@ interactions: x-content-type-options: - nosniff x-ms-ests-server: - - 2.1.11562.6 - KRSLR2 ProdSlices + - 2.1.11722.21 - SEASLR1 ProdSlices status: code: 200 message: OK @@ -190,39 +185,39 @@ interactions: Connection: - keep-alive ParameterSetName: - - --account-name --resource-group + - --name --resource-group User-Agent: - AZURECLI/2.17.1 azsdk-python-mgmt-codesigning/0.1.0 Python/3.7.9 (Windows-10-10.0.19041-SP0) method: GET - uri: https://api-dogfood.resources.windows-int.net/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.CodeSigning/codeSignAccounts/MyAccount?api-version=2020-12-14-preview + uri: https://api-dogfood.resources.windows-int.net/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.CodeSigning/codeSigningAccounts/MyAccount?api-version=2020-12-14-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.CodeSigning/codeSignAccounts/MyAccount","name":"MyAccount","type":"Microsoft.CodeSigning/codeSignAccounts","location":"eastus","systemData":{"createdBy":"billtest124476@outlook.com","createdByType":"User","createdAt":"2021-03-12T11:22:30.4322131Z","lastModifiedBy":"billtest124476@outlook.com","lastModifiedByType":"User","lastModifiedAt":"2021-03-12T11:22:30.4322131Z"},"properties":{"accountUri":null,"provisioningState":"Succeeded","verificationStatus":"NotCompleted"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.CodeSigning/codeSigningAccounts/MyAccount","name":"MyAccount","type":"microsoft.codesigning/codesigningaccounts","location":"eastus","systemData":{"createdBy":"billtest124476@outlook.com","createdByType":"User","createdAt":"2021-06-02T11:09:52.2908382Z","lastModifiedBy":"billtest124476@outlook.com","lastModifiedByType":"User","lastModifiedAt":"2021-06-02T11:09:52.2908382Z"},"properties":{"provisioningState":"Succeeded"}}' headers: cache-control: - no-cache content-length: - - '642' + - '594' content-type: - application/json; charset=utf-8 date: - - Fri, 12 Mar 2021 11:22:37 GMT + - Wed, 02 Jun 2021 11:09:57 GMT etag: - - '"2900f273-0000-0700-0000-604b4efb0000"' + - '"00001b57-0000-0700-0000-60b767030000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-providerhub-traffic: - 'True' + x-msedge-ref: + - 'Ref A: 637CB604001C40AEB97CCCDF71A602C7 Ref B: MAA01EDGE0605 Ref C: 2021-06-02T11:09:56Z' status: code: 200 message: OK @@ -266,13 +261,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 12 Mar 2021 11:22:37 GMT + - Wed, 02 Jun 2021 11:09:57 GMT p3p: - CP="DSP CUR OTPi IND OTRi ONL FIN" set-cookie: - - fpc=AvxZ4XTuuntGgijvVb7GX9Q; expires=Sun, 11-Apr-2021 11:22:38 GMT; path=/; + - fpc=Ak24b3oMCqtLpvoAXyZBa9M; expires=Fri, 02-Jul-2021 11:09:58 GMT; path=/; secure; HttpOnly; SameSite=None - - esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrTUFmopAqaAzurc9475VrbTaFq8FlsFKW7l1i-_uuMzdlfnggXsa4uhrTRGhUejTDmovfxWev6nVTA_ToOWPCA5jL5McDGj9MZRpD_M0xp0ftyKv7xnMQ338SxLI-yz37iWJpXt-bDTKDxelLAxI5uWOaeG6VvVh5vIoi6xWdwkkgAA; + - esctx=AQABAAAAAAD--DLA3VO7QrddgJg7Wevrt3fx2VKXKcnIRgudIipIIUbYgcSjdWU_sA4Rgi2H2VZdqqDAaU3JTWGX0xWXWKMXIGJFRpabs2B9ygdNweOJSmYfmEKcB8ybkil6j9yKRnQkP8ohVCW2Cm_Zntb9W9mIVLnHnvJ3AoOsovvFthkm2GzjJrhHw8TIrHC2GbO2_gAgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None - x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly - stsservicecookie=estsfd; path=/; secure; samesite=none; httponly @@ -281,7 +276,7 @@ interactions: x-content-type-options: - nosniff x-ms-ests-server: - - 2.1.11562.6 - SEASLR2 ProdSlices + - 2.1.11722.21 - KRSLR1 ProdSlices status: code: 200 message: OK @@ -301,33 +296,35 @@ interactions: User-Agent: - AZURECLI/2.17.1 azsdk-python-mgmt-codesigning/0.1.0 Python/3.7.9 (Windows-10-10.0.19041-SP0) method: GET - uri: https://api-dogfood.resources.windows-int.net/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.CodeSigning/codeSignAccounts?api-version=2020-12-14-preview + uri: https://api-dogfood.resources.windows-int.net/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.CodeSigning/codeSigningAccounts?api-version=2020-12-14-preview response: body: - string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.CodeSigning/codeSignAccounts/MyAccount","name":"MyAccount","type":"Microsoft.CodeSigning/codeSignAccounts","location":"eastus","systemData":{"createdBy":"billtest124476@outlook.com","createdByType":"User","createdAt":"2021-03-12T11:22:30.4322131Z","lastModifiedBy":"billtest124476@outlook.com","lastModifiedByType":"User","lastModifiedAt":"2021-03-12T11:22:30.4322131Z"},"properties":{"accountUri":null,"provisioningState":"Succeeded","verificationStatus":"NotCompleted"}}]}' + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.CodeSigning/codeSigningAccounts/MyAccount","name":"MyAccount","type":"microsoft.codesigning/codesigningaccounts","location":"eastus","systemData":{"createdBy":"billtest124476@outlook.com","createdByType":"User","createdAt":"2021-06-02T11:09:52.2908382Z","lastModifiedBy":"billtest124476@outlook.com","lastModifiedByType":"User","lastModifiedAt":"2021-06-02T11:09:52.2908382Z"},"properties":{"provisioningState":"Succeeded"}}]}' headers: cache-control: - no-cache content-length: - - '654' + - '606' content-type: - application/json; charset=utf-8 date: - - Fri, 12 Mar 2021 11:22:38 GMT + - Wed, 02 Jun 2021 11:09:58 GMT expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-original-request-ids: - - 59c73fef-75c0-4926-a196-cdeddc84a9a8 - - 379c371c-e986-4acf-bc49-c083797fa72f - - 5df4f8e8-9af8-4f55-80f6-ec1748a45302 + - f385673a-3701-493c-90e5-bf733e4cd919 + - f5ddfbda-27d1-490b-afdc-ddf4d17be517 + - 85a2b7ef-69e2-4572-9ee6-21e28a2a72ff + x-msedge-ref: + - 'Ref A: 24863C86222E4CEFA6C02757D60359AD Ref B: MAA01EDGE0508 Ref C: 2021-06-02T11:09:58Z' status: code: 200 message: OK @@ -371,13 +368,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 12 Mar 2021 11:22:39 GMT + - Wed, 02 Jun 2021 11:09:59 GMT p3p: - CP="DSP CUR OTPi IND OTRi ONL FIN" set-cookie: - - fpc=AutvPYazASFGr67783hcWvo; expires=Sun, 11-Apr-2021 11:22:39 GMT; path=/; + - fpc=ApqzJACJ5dlIs3g73L0Tb3U; expires=Fri, 02-Jul-2021 11:09:59 GMT; path=/; secure; HttpOnly; SameSite=None - - esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrP_LRsHmoCYuJRfDl_1uZY1m2uGcVN8nJqMszR4GAY4mffzXeG12wVzjmAyz8PbYQ7Tmhnr8GQdkFQsNozUoIm0qDq2fgDPzLDlcgbxs8fV4kdTTkQxG724PH0PU3vvjVZWy39qtbveQpeoWIM6O-umQa3OZUhOa8CZTR9zCk7Z0gAA; + - esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrjMQxeBHW2gNWFoFwzvogMq_3MoAlcrQR4zyf0D5Jw8LAZCzeBTIn_b1pNM7biaTjWVLC_uSLG0sdLmwHxXCyHrtH2qud3Yc4ke5O5n8rNVk9bFkKsrOB_07GoZ9yrXmYBMAI5TwpTxQWO-lO9VSG_T734zSGTDtPj2WB8MMqMLsgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None - x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly - stsservicecookie=estsfd; path=/; secure; samesite=none; httponly @@ -386,7 +383,7 @@ interactions: x-content-type-options: - nosniff x-ms-ests-server: - - 2.1.11562.6 - SEASLR1 ProdSlices + - 2.1.11722.21 - SEASLR1 ProdSlices status: code: 200 message: OK @@ -406,33 +403,35 @@ interactions: User-Agent: - AZURECLI/2.17.1 azsdk-python-mgmt-codesigning/0.1.0 Python/3.7.9 (Windows-10-10.0.19041-SP0) method: GET - uri: https://api-dogfood.resources.windows-int.net/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CodeSigning/codeSignAccounts?api-version=2020-12-14-preview + uri: https://api-dogfood.resources.windows-int.net/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CodeSigning/codeSigningAccounts?api-version=2020-12-14-preview response: body: - string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/dogfoodRG/providers/Microsoft.CodeSigning/codeSignAccounts/Test1","name":"Test1","type":"Microsoft.CodeSigning/codeSignAccounts","location":"eastus","systemData":{"createdBy":"billtest124476@outlook.com","createdByType":"User","createdAt":"2021-01-05T12:24:35.1626638Z","lastModifiedBy":"billtest124476@outlook.com","lastModifiedByType":"User","lastModifiedAt":"2021-01-05T12:37:29.1978003Z"},"properties":{"provisioningState":"Succeeded"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/dogfoodRG/providers/Microsoft.CodeSigning/codeSignAccounts/Vishi1","name":"Vishi1","type":"Microsoft.CodeSigning/codeSignAccounts","location":"eastus","systemData":{"createdBy":"billtest124476@outlook.com","createdByType":"User","createdAt":"2021-01-12T11:27:13.5985295Z","lastModifiedBy":"billtest124476@outlook.com","lastModifiedByType":"User","lastModifiedAt":"2021-01-12T11:27:13.5985295Z"},"properties":{"provisioningState":"Succeeded"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/dogfoodRG/providers/Microsoft.CodeSigning/codeSignAccounts/csaCli2","name":"csaCli2","type":"Microsoft.CodeSigning/codeSignAccounts","location":"eastus","systemData":{"createdBy":"billtest124476@outlook.com","createdByType":"User","createdAt":"2021-01-19T07:08:10.6124865Z","lastModifiedBy":"billtest124476@outlook.com","lastModifiedByType":"User","lastModifiedAt":"2021-01-19T07:08:10.6124865Z"},"properties":{"provisioningState":"Succeeded"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/amritaRG/providers/Microsoft.CodeSigning/codeSignAccounts/acc100","name":"acc100","type":"Microsoft.CodeSigning/codeSignAccounts","location":"eastus","systemData":{"createdBy":"billtest124476@outlook.com","createdByType":"User","createdAt":"2021-03-04T06:11:47.0605817Z","lastModifiedBy":"billtest124476@outlook.com","lastModifiedByType":"User","lastModifiedAt":"2021-03-04T06:11:47.0605817Z"},"properties":{"provisioningState":"Succeeded"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/demo2/providers/Microsoft.CodeSigning/codeSignAccounts/account1","name":"account1","type":"Microsoft.CodeSigning/codeSignAccounts","location":"eastus","systemData":{"createdBy":"Test1@billtest124476outlook.ccsctp.net","createdByType":"User","createdAt":"2021-03-04T07:54:17.9029536Z","lastModifiedBy":"Test1@billtest124476outlook.ccsctp.net","lastModifiedByType":"User","lastModifiedAt":"2021-03-04T07:54:17.9029536Z"},"properties":{"provisioningState":"Succeeded"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/demo1/providers/Microsoft.CodeSigning/codeSignAccounts/account1","name":"account1","type":"Microsoft.CodeSigning/codeSignAccounts","location":"eastus","systemData":{"createdBy":"billtest124476@outlook.com","createdByType":"User","createdAt":"2021-03-04T09:20:03.1101648Z","lastModifiedBy":"billtest124476@outlook.com","lastModifiedByType":"User","lastModifiedAt":"2021-03-04T09:20:03.1101648Z"},"properties":{"provisioningState":"Succeeded"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/amritaRG/providers/Microsoft.CodeSigning/codeSignAccounts/account1","name":"account1","type":"Microsoft.CodeSigning/codeSignAccounts","location":"eastus","systemData":{"createdBy":"billtest124476@outlook.com","createdByType":"User","createdAt":"2021-03-04T09:57:17.4666379Z","lastModifiedBy":"billtest124476@outlook.com","lastModifiedByType":"User","lastModifiedAt":"2021-03-04T09:57:17.4666379Z"},"properties":{"provisioningState":"Succeeded"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/amritaRG/providers/Microsoft.CodeSigning/codeSignAccounts/acc101","name":"acc101","type":"Microsoft.CodeSigning/codeSignAccounts","location":"eastus","systemData":{"createdBy":"billtest124476@outlook.com","createdByType":"User","createdAt":"2021-03-05T04:01:20.0447626Z","lastModifiedBy":"billtest124476@outlook.com","lastModifiedByType":"User","lastModifiedAt":"2021-03-05T04:01:20.0447626Z"},"properties":{"provisioningState":"Succeeded"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/amritaRG/providers/Microsoft.CodeSigning/codeSignAccounts/acc102","name":"acc102","type":"Microsoft.CodeSigning/codeSignAccounts","location":"eastus","systemData":{"createdBy":"billtest124476@outlook.com","createdByType":"User","createdAt":"2021-03-10T05:21:16.5057681Z","lastModifiedBy":"billtest124476@outlook.com","lastModifiedByType":"User","lastModifiedAt":"2021-03-10T05:21:16.5057681Z"},"properties":{"provisioningState":"Succeeded","verificationStatus":"Completed"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/amritaRG/providers/Microsoft.CodeSigning/codeSignAccounts/acc103","name":"acc103","type":"Microsoft.CodeSigning/codeSignAccounts","location":"eastus","systemData":{"createdBy":"billtest124476@outlook.com","createdByType":"User","createdAt":"2021-03-10T05:25:23.8047717Z","lastModifiedBy":"billtest124476@outlook.com","lastModifiedByType":"User","lastModifiedAt":"2021-03-10T05:25:23.8047717Z"},"properties":{"provisioningState":"Succeeded","verificationStatus":"Completed"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/amritaRG/providers/Microsoft.CodeSigning/codeSignAccounts/acc104","name":"acc104","type":"Microsoft.CodeSigning/codeSignAccounts","location":"eastus","systemData":{"createdBy":"billtest124476@outlook.com","createdByType":"User","createdAt":"2021-03-10T05:27:03.1974942Z","lastModifiedBy":"billtest124476@outlook.com","lastModifiedByType":"User","lastModifiedAt":"2021-03-10T05:27:03.1974942Z"},"properties":{"accountUri":null,"provisioningState":"Succeeded","verificationStatus":"NotCompleted"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRG/providers/Microsoft.CodeSigning/codeSignAccounts/accountOne","name":"accountOne","type":"Microsoft.CodeSigning/codeSignAccounts","location":"eastus","systemData":{"createdBy":"billtest124476@outlook.com","createdByType":"User","createdAt":"2021-03-10T06:05:54.8277608Z","lastModifiedBy":"billtest124476@outlook.com","lastModifiedByType":"User","lastModifiedAt":"2021-03-10T06:05:54.8277608Z"},"properties":{"provisioningState":"Succeeded","verificationStatus":"NotCompleted"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRG/providers/Microsoft.CodeSigning/codeSignAccounts/accountTwo","name":"accountTwo","type":"Microsoft.CodeSigning/codeSignAccounts","location":"eastus","systemData":{"createdBy":"billtest124476@outlook.com","createdByType":"User","createdAt":"2021-03-12T05:08:10.5588917Z","lastModifiedBy":"billtest124476@outlook.com","lastModifiedByType":"User","lastModifiedAt":"2021-03-12T05:08:10.5588917Z"},"properties":{"provisioningState":"Succeeded","verificationStatus":"NotCompleted"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRG/providers/Microsoft.CodeSigning/codeSignAccounts/accountThree","name":"accountThree","type":"Microsoft.CodeSigning/codeSignAccounts","location":"eastus","systemData":{"createdBy":"billtest124476@outlook.com","createdByType":"User","createdAt":"2021-03-12T06:30:28.9795167Z","lastModifiedBy":"billtest124476@outlook.com","lastModifiedByType":"User","lastModifiedAt":"2021-03-12T06:30:28.9795167Z"},"properties":{"provisioningState":"Accepted"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.CodeSigning/codeSignAccounts/MyAccount","name":"MyAccount","type":"Microsoft.CodeSigning/codeSignAccounts","location":"eastus","systemData":{"createdBy":"billtest124476@outlook.com","createdByType":"User","createdAt":"2021-03-12T11:22:30.4322131Z","lastModifiedBy":"billtest124476@outlook.com","lastModifiedByType":"User","lastModifiedAt":"2021-03-12T11:22:30.4322131Z"},"properties":{"accountUri":null,"provisioningState":"Succeeded","verificationStatus":"NotCompleted"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/dogfoodRG/providers/Microsoft.CodeSigning/codeSignAccounts/Vishi2","name":"Vishi2","type":"Microsoft.CodeSigning/codeSignAccounts","location":"westus","systemData":{"createdBy":"billtest124476@outlook.com","createdByType":"User","createdAt":"2021-01-13T07:48:17.6792347Z","lastModifiedBy":"billtest124476@outlook.com","lastModifiedByType":"User","lastModifiedAt":"2021-01-13T07:48:17.6792347Z"},"properties":{"provisioningState":"Succeeded"}}]}' + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/amritarg/providers/Microsoft.CodeSigning/codeSigningAccounts/account1","name":"account1","type":"microsoft.codesigning/codesigningaccounts","location":"eastus","systemData":{"createdBy":"billtest124476@outlook.com","createdByType":"User","createdAt":"2021-06-02T09:07:18.735511Z","lastModifiedBy":"billtest124476@outlook.com","lastModifiedByType":"User","lastModifiedAt":"2021-06-02T09:07:18.735511Z"},"properties":{"provisioningState":"Succeeded"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.CodeSigning/codeSigningAccounts/MyAccount","name":"MyAccount","type":"microsoft.codesigning/codesigningaccounts","location":"eastus","systemData":{"createdBy":"billtest124476@outlook.com","createdByType":"User","createdAt":"2021-06-02T11:09:52.2908382Z","lastModifiedBy":"billtest124476@outlook.com","lastModifiedByType":"User","lastModifiedAt":"2021-06-02T11:09:52.2908382Z"},"properties":{"provisioningState":"Succeeded"}}]}' headers: cache-control: - no-cache content-length: - - '8635' + - '1130' content-type: - application/json; charset=utf-8 date: - - Fri, 12 Mar 2021 11:22:39 GMT + - Wed, 02 Jun 2021 11:10:00 GMT expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-original-request-ids: - - 1392104e-d833-4ac6-9caa-c1c0414a2bb6 - - fc342ebc-cde9-4d31-915b-6e57d0b631d5 - - 01638f03-c364-4519-a5f1-22cac38e976b + - aa4f7a0d-4940-445a-ad2f-b5e055110299 + - f888cb19-4a23-429f-97f5-565b016926a9 + - 539d6220-b2d1-433f-a178-ca81baa4365f + x-msedge-ref: + - 'Ref A: 12284080070248C0A1763F7F2E69106F Ref B: MAA01EDGE0506 Ref C: 2021-06-02T11:09:59Z' status: code: 200 message: OK @@ -476,13 +475,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 12 Mar 2021 11:22:40 GMT + - Wed, 02 Jun 2021 11:10:00 GMT p3p: - CP="DSP CUR OTPi IND OTRi ONL FIN" set-cookie: - - fpc=AvzyOxbe5NZDskPG90qEuak; expires=Sun, 11-Apr-2021 11:22:40 GMT; path=/; + - fpc=Am-yQradxTJIjttWwFAGZ2A; expires=Fri, 02-Jul-2021 11:10:01 GMT; path=/; secure; HttpOnly; SameSite=None - - esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrAz4JZFSZAfJyy4AnHawlSUpJ1WflhZCrQkGGh-dRa0Fg4OWvPCO2NeAbSXNKkH1F67T9ORJXQSWCnFqIsHYpHhhKRoPkxPl99QNXFk179AsZXynJJlrnC4MR74mONskXXxtucnj_ikjJh4-JN-XpVBZY93acBFJ1_4kYd5X9mDMgAA; + - esctx=AQABAAAAAAD--DLA3VO7QrddgJg7Wevr3440iJkFKSBWwENLKYR5FINk61rHQcZb59iIF0X6uMQs_UIXNewlpNjEOBJ-jdlBzpc09Y8CaegQ03-Y7FyrHubO288rYUTc-7M_D6SIHWfDzvAe0ZeW-8Z6D4Uoi2Lacq81Z67N5DfSFeLKCbEkOSOY21uyT-cWkO5f_mPFiPIgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None - x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly - stsservicecookie=estsfd; path=/; secure; samesite=none; httponly @@ -491,7 +490,7 @@ interactions: x-content-type-options: - nosniff x-ms-ests-server: - - 2.1.11562.6 - SEASLR2 ProdSlices + - 2.1.11722.21 - KRSLR1 ProdSlices status: code: 200 message: OK @@ -511,41 +510,41 @@ interactions: Content-Type: - application/json ParameterSetName: - - --tags --account-name --resource-group + - --name --tags --resource-group User-Agent: - AZURECLI/2.17.1 azsdk-python-mgmt-codesigning/0.1.0 Python/3.7.9 (Windows-10-10.0.19041-SP0) method: PATCH - uri: https://api-dogfood.resources.windows-int.net/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.CodeSigning/codeSignAccounts/MyAccount?api-version=2020-12-14-preview + uri: https://api-dogfood.resources.windows-int.net/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.CodeSigning/codeSigningAccounts/MyAccount?api-version=2020-12-14-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.CodeSigning/codeSignAccounts/MyAccount","name":"MyAccount","type":"Microsoft.CodeSigning/codeSignAccounts","location":"eastus","tags":{"key1":"value1"},"systemData":{"createdBy":"billtest124476@outlook.com","createdByType":"User","createdAt":"2021-03-12T11:22:30.4322131Z","lastModifiedBy":"billtest124476@outlook.com","lastModifiedByType":"User","lastModifiedAt":"2021-03-12T11:22:42.6376759Z"},"properties":{"accountUri":null,"provisioningState":"Succeeded","verificationStatus":"NotCompleted"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.CodeSigning/codeSigningAccounts/MyAccount","name":"MyAccount","type":"microsoft.codesigning/codesigningaccounts","location":"eastus","tags":{"key1":"value1"},"systemData":{"createdBy":"billtest124476@outlook.com","createdByType":"User","createdAt":"2021-06-02T11:09:52.2908382Z","lastModifiedBy":"billtest124476@outlook.com","lastModifiedByType":"User","lastModifiedAt":"2021-06-02T11:10:02.5447071Z"},"properties":{"provisioningState":"Succeeded"}}' headers: cache-control: - no-cache content-length: - - '667' + - '619' content-type: - application/json; charset=utf-8 date: - - Fri, 12 Mar 2021 11:22:44 GMT + - Wed, 02 Jun 2021 11:10:05 GMT etag: - - '"2900fe74-0000-0700-0000-604b4f020000"' + - '"00004557-0000-0700-0000-60b7670b0000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-providerhub-traffic: - 'True' x-ms-ratelimit-remaining-subscription-writes: - - '1199' + - '1197' + x-msedge-ref: + - 'Ref A: 157A72FDBD0745798AD36DA21D05501C Ref B: MAA01EDGE0616 Ref C: 2021-06-02T11:10:01Z' status: code: 200 message: OK @@ -589,13 +588,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 12 Mar 2021 11:22:44 GMT + - Wed, 02 Jun 2021 11:10:05 GMT p3p: - CP="DSP CUR OTPi IND OTRi ONL FIN" set-cookie: - - fpc=ApwBukhM7g5Pg07jaHONaEQ; expires=Sun, 11-Apr-2021 11:22:44 GMT; path=/; + - fpc=AmhZn0A98VlIlijIl3jpDuo; expires=Fri, 02-Jul-2021 11:10:05 GMT; path=/; secure; HttpOnly; SameSite=None - - esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrUeniVKk9qEUbBq-5YcUb_har8LSARJmSLRztu33Xi4HckeXFR698W4H3Mg0e3IW20ict9yAXKuX5TPhq_0V0cGTtTZLf5wYiwyqNIVulMpV-AMGKEcTVHsIZK1s_ZspDmWLYtkqcu2SiVB3ALqETY9TjG90EsjkRE8w9GFufYcYgAA; + - esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrHjThGnB7_dZEYpT8Pv2NxB6my8QLaIQSmyZXBBphYm8yNj3rPAma5NKHxyLxttBV73LHi2falOLQsIy2ZV-HScc0D52HX2ZThiQbH3UuRSzzxWV7VY2r-Vp4SWlXly919FJHBFumNmmNoVtOdU3IqwdQ-uPFQCDYHx82-kq2W8YgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None - x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly - stsservicecookie=estsfd; path=/; secure; samesite=none; httponly @@ -604,13 +603,13 @@ interactions: x-content-type-options: - nosniff x-ms-ests-server: - - 2.1.11562.6 - SEASLR2 ProdSlices + - 2.1.11722.21 - SEASLR2 ProdSlices status: code: 200 message: OK - request: - body: '{"properties": {"profileType": "PublicTrust", "rotationPolicy": "Monthly", - "commonName": "Contoso", "subjectAlternativeName": "Contoso Corporate Engineering"}}' + body: '{"properties": {"profileType": "PublicTrust", "rotationPolicy": "30 Days", + "commonName": "Contoso Inc", "organization": "Contoso Inc"}}' headers: Accept: - application/json @@ -621,54 +620,48 @@ interactions: Connection: - keep-alive Content-Length: - - '159' + - '135' Content-Type: - application/json ParameterSetName: - - --account-name --profile-name --common-name --profile-type --subject-alternative-name - --resource-group + - --account-name --common-name --organization --name --resource-group User-Agent: - AZURECLI/2.17.1 azsdk-python-mgmt-codesigning/0.1.0 Python/3.7.9 (Windows-10-10.0.19041-SP0) method: PUT - uri: https://api-dogfood.resources.windows-int.net/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.CodeSigning/codeSignAccounts/MyAccount/certificateProfiles/profileA?api-version=2020-12-14-preview + uri: https://api-dogfood.resources.windows-int.net/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.CodeSigning/codeSigningAccounts/MyAccount/certificateProfiles/profileA?api-version=2020-12-14-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.CodeSigning/codeSignAccounts/MyAccount/certificateProfiles/profileA","name":"profileA","type":"Microsoft.CodeSigning/codeSignAccounts/certificateProfiles","systemData":{"createdBy":"billtest124476@outlook.com","createdByType":"User","createdAt":"2021-03-12T11:22:45.9106409Z","lastModifiedBy":"billtest124476@outlook.com","lastModifiedByType":"User","lastModifiedAt":"2021-03-12T11:22:45.9106409Z"},"properties":{"profileType":"PublicTrust","rotationPolicy":"Monthly","authority":null,"commonName":"Contoso","organization":null,"subjectAlternativeName":"Contoso - Corporate Engineering","streetAddress":null,"country":null,"state":null,"city":null,"provisioningState":"Succeeded","certificates":[]}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.CodeSigning/codeSigningAccounts/MyAccount/certificateProfiles/profileA","name":"profileA","type":"microsoft.codesigning/codesigningaccounts/certificateprofiles","systemData":{"createdBy":"billtest124476@outlook.com","createdByType":"User","createdAt":"2021-06-02T11:10:06.6020053Z","lastModifiedBy":"billtest124476@outlook.com","lastModifiedByType":"User","lastModifiedAt":"2021-06-02T11:10:06.6020053Z"},"properties":{"profileType":"PublicTrust","rotationPolicy":"30 + Days","commonName":"Contoso Inc","organization":"Contoso Inc","provisioningState":"Succeeded"}}' headers: cache-control: - no-cache content-length: - - '867' + - '733' content-type: - application/json; charset=utf-8 date: - - Fri, 12 Mar 2021 11:22:47 GMT + - Wed, 02 Jun 2021 11:10:07 GMT etag: - - '"0100c67b-0000-0700-0000-604b4f070000"' + - '"05006708-0000-0700-0000-60b767100000"' expires: - '-1' pragma: - no-cache request-context: - - appId=cid-v1:c73a5c90-b6dd-400a-b5e1-6c06fd162b47 - set-cookie: - - ARRAffinity=2d343760a8ed36b0212d0c52481d1fee3a42070a07d1709749e873bd7238f130;Path=/;HttpOnly;Secure;Domain=codesigning-userrp-ppe.azurewebsites.net - - ARRAffinitySameSite=2d343760a8ed36b0212d0c52481d1fee3a42070a07d1709749e873bd7238f130;Path=/;HttpOnly;SameSite=None;Secure;Domain=codesigning-userrp-ppe.azurewebsites.net + - appId= strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding,Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-providerhub-traffic: - 'True' x-ms-ratelimit-remaining-subscription-writes: - - '1199' - x-powered-by: - - ASP.NET + - '1198' + x-msedge-ref: + - 'Ref A: 5F25B257D15D4B8A84D146EBF3F65A0D Ref B: MAA01EDGE0515 Ref C: 2021-06-02T11:10:05Z' status: code: 200 message: OK @@ -712,13 +705,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 12 Mar 2021 11:22:47 GMT + - Wed, 02 Jun 2021 11:10:08 GMT p3p: - CP="DSP CUR OTPi IND OTRi ONL FIN" set-cookie: - - fpc=An8xTnnig3dMqXvNbMNg9I0; expires=Sun, 11-Apr-2021 11:22:47 GMT; path=/; + - fpc=AkqglEZnuNpLh_7b8ifj7hY; expires=Fri, 02-Jul-2021 11:10:08 GMT; path=/; secure; HttpOnly; SameSite=None - - esctx=AQABAAAAAAD--DLA3VO7QrddgJg7Wevrbi39270RTStaSplljfny1oLrG4zH5w54V8z7XU7VhsfZ-B3Z1m4uUqDILsdw9-RH_uVZE04nX75cNRdeYhG32r3vaZfPbLBBgXpO_zIzZtKzf0qPHmvsiLWstmhBUxwoVAabVNa3CbTfXD8L77i9FFMiUNBcmMb4Kc16oVS5X-QgAA; + - esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrqeIG73gKp58oBhB-ZDsnMzcs6ARyrnkM2oyLRnnQYHlSiH0-HXhlQ6y9vavxcFVr5U9h2ZN0TfhAVQOumb7ROTNmLWcUirjzXu15eoDi8Z7r7cct1ypdrLFJauGJYpXuLvWzmht5Y8w9Q5LzAoxkQyJYK3N8MBAssf9Q7noHuc0gAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None - x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly - stsservicecookie=estsfd; path=/; secure; samesite=none; httponly @@ -727,7 +720,7 @@ interactions: x-content-type-options: - nosniff x-ms-ests-server: - - 2.1.11562.6 - KRSLR1 ProdSlices + - 2.1.11722.26 - KRSLR2 ProdSlices status: code: 200 message: OK @@ -743,40 +736,40 @@ interactions: Connection: - keep-alive ParameterSetName: - - --account-name --profile-name --resource-group + - --account-name --name --resource-group User-Agent: - AZURECLI/2.17.1 azsdk-python-mgmt-codesigning/0.1.0 Python/3.7.9 (Windows-10-10.0.19041-SP0) method: GET - uri: https://api-dogfood.resources.windows-int.net/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.CodeSigning/codeSignAccounts/MyAccount/certificateProfiles/profileA?api-version=2020-12-14-preview + uri: https://api-dogfood.resources.windows-int.net/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.CodeSigning/codeSigningAccounts/MyAccount/certificateProfiles/profileA?api-version=2020-12-14-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.CodeSigning/codeSignAccounts/MyAccount/certificateProfiles/profileA","name":"profileA","type":"Microsoft.CodeSigning/codeSignAccounts/certificateProfiles","systemData":{"createdBy":"billtest124476@outlook.com","createdByType":"User","createdAt":"2021-03-12T11:22:45.9106409Z","lastModifiedBy":"billtest124476@outlook.com","lastModifiedByType":"User","lastModifiedAt":"2021-03-12T11:22:45.9106409Z"},"properties":{"profileType":"PublicTrust","rotationPolicy":"Monthly","authority":null,"commonName":"Contoso","organization":null,"subjectAlternativeName":"Contoso - Corporate Engineering","streetAddress":null,"country":null,"state":null,"city":null,"provisioningState":"Succeeded","certificates":[]}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.CodeSigning/codeSigningAccounts/MyAccount/certificateProfiles/profileA","name":"profileA","type":"microsoft.codesigning/codesigningaccounts/certificateprofiles","systemData":{"createdBy":"billtest124476@outlook.com","createdByType":"User","createdAt":"2021-06-02T11:10:06.6020053Z","lastModifiedBy":"billtest124476@outlook.com","lastModifiedByType":"User","lastModifiedAt":"2021-06-02T11:10:06.6020053Z"},"properties":{"profileType":"PublicTrust","rotationPolicy":"30 + Days","commonName":"Contoso Inc","organization":"Contoso Inc","provisioningState":"Succeeded"}}' headers: cache-control: - no-cache content-length: - - '867' + - '733' content-type: - application/json; charset=utf-8 date: - - Fri, 12 Mar 2021 11:22:49 GMT + - Wed, 02 Jun 2021 11:10:09 GMT etag: - - '"0100c67b-0000-0700-0000-604b4f070000"' + - '"05006708-0000-0700-0000-60b767100000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-providerhub-traffic: - 'True' + x-msedge-ref: + - 'Ref A: C61472987504411B906EFEDFB58E5D90 Ref B: MAA01EDGE0621 Ref C: 2021-06-02T11:10:08Z' status: code: 200 message: OK @@ -820,13 +813,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 12 Mar 2021 11:22:48 GMT + - Wed, 02 Jun 2021 11:10:09 GMT p3p: - CP="DSP CUR OTPi IND OTRi ONL FIN" set-cookie: - - fpc=Aq9W0FkD7pdFpXdgM_Yeh10; expires=Sun, 11-Apr-2021 11:22:49 GMT; path=/; + - fpc=AsTKY75RmlRJlBUYKplvyrU; expires=Fri, 02-Jul-2021 11:10:09 GMT; path=/; secure; HttpOnly; SameSite=None - - esctx=AQABAAAAAAD--DLA3VO7QrddgJg7Wevr5QqBrAwfp2OnPbFEhX4KJHoecwU5sDNA5jnnncCVc8TtkN4q-W7_cgiiJAeTMgp_AwP9qsn8n5HYpaOYhjq7Hujr9Pp3PSqL3BvX7rSUbWYgcRYNNlfPOyc6aZ2cBzdy8hP469HpT1PHd_o8GHJjba5HayIhTc3UhTU4y-6RLTogAA; + - esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrixCumsZx0fW6DcvxK1p2GRvVbn2vetDxikt34hSqULq2xLbGKnZhjkdnJjbMg4NrqCi_dEy879qbBxEQf487LD7mjO3kurRmY_25ekyXR6ia-vsnTZ4MAfeLP4nj5fN1kxhLwrW5OsGouZYZ-zEA5gSIy68oN-9aDuARNKvqT4ggAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None - x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly - stsservicecookie=estsfd; path=/; secure; samesite=none; httponly @@ -835,7 +828,7 @@ interactions: x-content-type-options: - nosniff x-ms-ests-server: - - 2.1.11562.6 - KRSLR2 ProdSlices + - 2.1.11722.21 - KRSLR1 ProdSlices status: code: 200 message: OK @@ -855,34 +848,34 @@ interactions: User-Agent: - AZURECLI/2.17.1 azsdk-python-mgmt-codesigning/0.1.0 Python/3.7.9 (Windows-10-10.0.19041-SP0) method: GET - uri: https://api-dogfood.resources.windows-int.net/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.CodeSigning/codeSignAccounts/MyAccount/certificateProfiles?api-version=2020-12-14-preview + uri: https://api-dogfood.resources.windows-int.net/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.CodeSigning/codeSigningAccounts/MyAccount/certificateProfiles?api-version=2020-12-14-preview response: body: - string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.CodeSigning/codeSignAccounts/MyAccount/certificateProfiles/profileA","name":"profileA","type":"Microsoft.CodeSigning/codeSignAccounts/certificateProfiles","systemData":{"createdBy":"billtest124476@outlook.com","createdByType":"User","createdAt":"2021-03-12T11:22:45.9106409Z","lastModifiedBy":"billtest124476@outlook.com","lastModifiedByType":"User","lastModifiedAt":"2021-03-12T11:22:45.9106409Z"},"properties":{"profileType":"PublicTrust","rotationPolicy":"Monthly","authority":null,"commonName":"Contoso","organization":null,"subjectAlternativeName":"Contoso - Corporate Engineering","streetAddress":null,"country":null,"state":null,"city":null,"provisioningState":"Succeeded","certificates":[]}}]}' + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.CodeSigning/codeSigningAccounts/MyAccount/certificateProfiles/profileA","name":"profileA","type":"microsoft.codesigning/codesigningaccounts/certificateprofiles","systemData":{"createdBy":"billtest124476@outlook.com","createdByType":"User","createdAt":"2021-06-02T11:10:06.6020053Z","lastModifiedBy":"billtest124476@outlook.com","lastModifiedByType":"User","lastModifiedAt":"2021-06-02T11:10:06.6020053Z"},"properties":{"profileType":"PublicTrust","rotationPolicy":"30 + Days","commonName":"Contoso Inc","organization":"Contoso Inc","provisioningState":"Succeeded"}}]}' headers: cache-control: - no-cache content-length: - - '879' + - '745' content-type: - application/json; charset=utf-8 date: - - Fri, 12 Mar 2021 11:22:50 GMT + - Wed, 02 Jun 2021 11:10:10 GMT expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-providerhub-traffic: - 'True' + x-msedge-ref: + - 'Ref A: A448170968AC4530BE757FF31304264C Ref B: MAA01EDGE0616 Ref C: 2021-06-02T11:10:10Z' status: code: 200 message: OK @@ -926,13 +919,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 12 Mar 2021 11:22:50 GMT + - Wed, 02 Jun 2021 11:10:10 GMT p3p: - CP="DSP CUR OTPi IND OTRi ONL FIN" set-cookie: - - fpc=Ag0z1Iy7JXJLgQhEjMRZ4_E; expires=Sun, 11-Apr-2021 11:22:51 GMT; path=/; + - fpc=Ak2KlVy26spHk5oekdSL5Ug; expires=Fri, 02-Jul-2021 11:10:10 GMT; path=/; secure; HttpOnly; SameSite=None - - esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrY1cfbMMvgwyynCe7gB-O2cNk-upgNCuwuhuo-piYJXj0owGLVh8yhRZMGOA1T7N57PSKGjVf5iG8smRSm31G9_ifxwNmZfaAoxvg3jjsDuJBFKLgG3UUkNreqwMVAV_bNb-PBZ0fB92ybKPSy66Cvpf9G-xC8qzkqw85l4hkaq0gAA; + - esctx=AQABAAAAAAD--DLA3VO7QrddgJg7Wevr1lq0YD1eqskBa7V38fZyNaFI3ITKVKCm3pI2nuMOMMLbs3bsdwT9o5VvFJBxPgqsR_WNCI7tyR1EiNLYhhv_Wf78o0RFne1FJylX_Wryd2-lS_rf5wRKyYt3486mGe_MYlFXvGy2jvWt8XV1qJm5ZkMb2tHxmMjnnfX1DjMBNkQgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None - x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly - stsservicecookie=estsfd; path=/; secure; samesite=none; httponly @@ -941,64 +934,57 @@ interactions: x-content-type-options: - nosniff x-ms-ests-server: - - 2.1.11562.6 - KRSLR1 ProdSlices + - 2.1.11722.26 - SEASLR1 ProdSlices status: code: 200 message: OK - request: - body: '{"properties": {"profileType": "Test", "rotationPolicy": "Monthly", "commonName": - "Contoso", "subjectAlternativeName": "Contoso Corporate Engineering"}}' + body: null headers: Accept: - application/json Accept-Encoding: - gzip, deflate CommandName: - - codesigning certificate-profile update + - codesigning certificate-profile delete Connection: - keep-alive Content-Length: - - '152' - Content-Type: - - application/json + - '0' ParameterSetName: - - --common-name --profile-type --subject-alternative-name --account-name --profile-name - --resource-group + - -y --account-name --name --resource-group User-Agent: - AZURECLI/2.17.1 azsdk-python-mgmt-codesigning/0.1.0 Python/3.7.9 (Windows-10-10.0.19041-SP0) - method: PATCH - uri: https://api-dogfood.resources.windows-int.net/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.CodeSigning/codeSignAccounts/MyAccount/certificateProfiles/profileA?api-version=2020-12-14-preview + method: DELETE + uri: https://api-dogfood.resources.windows-int.net/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.CodeSigning/codeSigningAccounts/MyAccount/certificateProfiles/profileA?api-version=2020-12-14-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.CodeSigning/codeSignAccounts/MyAccount/certificateProfiles/profileA","name":"profileA","type":"Microsoft.CodeSigning/codeSignAccounts/certificateProfiles","systemData":{"createdBy":"billtest124476@outlook.com","createdByType":"User","createdAt":"2021-03-12T11:22:45.9106409Z","lastModifiedBy":"billtest124476@outlook.com","lastModifiedByType":"User","lastModifiedAt":"2021-03-12T11:22:52.3820988Z"},"properties":{"profileType":"Test","rotationPolicy":"Monthly","authority":null,"commonName":"Contoso","organization":null,"subjectAlternativeName":"Contoso - Corporate Engineering","streetAddress":null,"country":null,"state":null,"city":null,"provisioningState":"Succeeded","certificates":[]}}' + string: '' headers: cache-control: - no-cache content-length: - - '860' - content-type: - - application/json; charset=utf-8 + - '0' date: - - Fri, 12 Mar 2021 11:22:52 GMT - etag: - - '"0100d77b-0000-0700-0000-604b4f0c0000"' + - Wed, 02 Jun 2021 11:10:13 GMT expires: - '-1' pragma: - no-cache + request-context: + - appId= strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-providerhub-traffic: - 'True' - x-ms-ratelimit-remaining-subscription-writes: - - '1199' + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' + x-msedge-ref: + - 'Ref A: D521AE37F0C040F29733E094A3D86E09 Ref B: MAA01EDGE0606 Ref C: 2021-06-02T11:10:11Z' status: code: 200 message: OK @@ -1042,13 +1028,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 12 Mar 2021 11:22:52 GMT + - Wed, 02 Jun 2021 11:10:14 GMT p3p: - CP="DSP CUR OTPi IND OTRi ONL FIN" set-cookie: - - fpc=Ao94VW1YxjlEsHw8CslO4Fs; expires=Sun, 11-Apr-2021 11:22:53 GMT; path=/; + - fpc=Aidk_XMcvu9AvEMCE0-siuQ; expires=Fri, 02-Jul-2021 11:10:14 GMT; path=/; secure; HttpOnly; SameSite=None - - esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrOGyU7qPLbGg8TUAjVXQIHUxCEPkHMaeM58OZzDueoncacf3U7PU8qns6OYkeZky-12_FxjHPl06qQGCfKDsMpyNmgNtEvQu3sXXEfDQX6J13qegzd2DXsGBmF-CR4Vl2r2R9rBjl30Ebpi9zu32o9Wuq8Na5TWy1VUStjNdwwMEgAA; + - esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrSRQu_DV82mVCAHaHKEUCUhlf0emGFghgYsvrYCKTazbTAQCeCr9CRmdzlQOHwduuZV4qJ-LXsic1EztCVle7uPvWMTFr3j5osr-VpNytwHn8-y5YOkEkjGyGzjySG2u8x9_HXHidG__NuqZ8JqsSRSFsQLY4PXBmymHS79HqZmggAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None - x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly - stsservicecookie=estsfd; path=/; secure; samesite=none; httponly @@ -1057,7 +1043,7 @@ interactions: x-content-type-options: - nosniff x-ms-ests-server: - - 2.1.11562.6 - SEASLR1 ProdSlices + - 2.1.11722.21 - KRSLR1 ProdSlices status: code: 200 message: OK @@ -1069,48 +1055,45 @@ interactions: Accept-Encoding: - gzip, deflate CommandName: - - codesigning operation show + - codesigning delete Connection: - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -y --name --resource-group User-Agent: - AZURECLI/2.17.1 azsdk-python-mgmt-codesigning/0.1.0 Python/3.7.9 (Windows-10-10.0.19041-SP0) - method: GET - uri: https://api-dogfood.resources.windows-int.net/providers/Microsoft.CodeSigning/operations?api-version=2020-12-14-preview + method: DELETE + uri: https://api-dogfood.resources.windows-int.net/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.CodeSigning/codeSigningAccounts/MyAccount?api-version=2020-12-14-preview response: body: - string: '{"value":[{"name":"Microsoft.CodeSigning/codeSignAccounts/Read","isDataAction":false,"display":{"provider":"Microsoft.CodeSigning","resource":"codeSignAccounts","operation":"Gets/List - codeSignAccounts resources","description":"Read codeSignAccounts"},"properties":null},{"name":"Microsoft.CodeSigning/codeSignAccounts/Write","isDataAction":false,"display":{"provider":"Microsoft.CodeSigning","resource":"codeSignAccounts","operation":"Create/update - codeSignAccounts resources","description":"Writes codeSignAccounts"},"properties":null},{"name":"Microsoft.CodeSigning/codeSignAccounts/Delete","isDataAction":false,"display":{"provider":"Microsoft.CodeSigning","resource":"codeSignAccounts","operation":"Deletes - codeSignAccounts resource","description":"Deletes codeSignAccounts"},"properties":null},{"name":"Microsoft.CodeSigning/RegisteredSubscriptions/read","isDataAction":false,"display":{"provider":"Microsoft.CodeSigning","resource":"RegisteredSubscriptions","operation":"Gets/Lists - registered subscriptions","description":"Reads registered subscriptions"},"properties":null},{"name":"Microsoft.CodeSigning/certificateProfiles/Read","isDataAction":false,"display":{"provider":"Microsoft.CodeSigning","resource":"certificateProfiles","operation":"Gets/List - certificateProfiles resources","description":"Read certificateProfiles"},"properties":null},{"name":"Microsoft.CodeSigning/certificateProfiles/Write","isDataAction":false,"display":{"provider":"Microsoft.CodeSigning","resource":"certificateProfiles","operation":"Create/update - certificateProfiles resources","description":"Writes certificateProfiles"},"properties":null},{"name":"Microsoft.CodeSigning/certificateProfiles/Delete","isDataAction":false,"display":{"provider":"Microsoft.CodeSigning","resource":"certificateProfiles","operation":"Deletes - certificateProfiles resource","description":"Deletes certificateProfiles"},"properties":null},{"name":"Microsoft.CodeSigning/Locations/OperationStatuses/read","isDataAction":false,"display":{"provider":"Microsoft.CodeSigning","resource":"codeSignAccounts","operation":"Read - operation statuses of codeSignAccounts","description":"Read Operation Statuses"},"properties":null},{"name":"Microsoft.CodeSigning/Locations/OperationStatuses/write","isDataAction":false,"display":{"provider":"Microsoft.CodeSigning","resource":"codeSignAccounts","operation":"Write - operation statuses of codeSignAccounts","description":"Write Operation Statuses"},"properties":null}]}' + string: '' headers: cache-control: - no-cache content-length: - - '2470' - content-type: - - application/json; charset=utf-8 + - '0' date: - - Fri, 12 Mar 2021 11:22:54 GMT + - Wed, 02 Jun 2021 11:10:17 GMT expires: - '-1' pragma: - no-cache + request-context: + - appId= strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-providerhub-traffic: - 'True' + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' + x-msedge-ref: + - 'Ref A: FEDE9F16D9D24F76AEE6A9CE8133784F Ref B: MAA01EDGE0616 Ref C: 2021-06-02T11:10:14Z' status: code: 200 message: OK diff --git a/src/codesigning/azext_codesigning/tests/latest/test_codesigning_scenario.py b/src/codesigning/azext_codesigning/tests/latest/test_codesigning_scenario.py index f1d141cde37..7240790a5e9 100644 --- a/src/codesigning/azext_codesigning/tests/latest/test_codesigning_scenario.py +++ b/src/codesigning/azext_codesigning/tests/latest/test_codesigning_scenario.py @@ -19,8 +19,8 @@ from .example_steps import step_certificate_profile_create from .example_steps import step_certificate_profile_show from .example_steps import step_certificate_profile_list -from .example_steps import step_certificate_profile_update -from .example_steps import step_operation_show +from .example_steps import step_certificate_profile_delete +from .example_steps import step_delete from .. import ( try_manual, raise_if, @@ -55,17 +55,16 @@ def call_scenario(test, rg): step_certificate_profile_create(test, rg, checks=[]) step_certificate_profile_show(test, rg, checks=[]) step_certificate_profile_list(test, rg, checks=[]) - step_certificate_profile_update(test, rg, checks=[]) - # STEP NOT FOUND: Delete a Certificate Profile - # STEP NOT FOUND: Delete a Code Sign Account - step_operation_show(test, rg, checks=[]) + # STEP NOT FOUND: Update Certificate Profile + step_certificate_profile_delete(test, rg, checks=[]) + step_delete(test, rg, checks=[]) + # STEP NOT FOUND: List Code Signing Account operations cleanup_scenario(test, rg) # Test class for Scenario @try_manual class CodesigningScenarioTest(ScenarioTest): - def __init__(self, *args, **kwargs): super(CodesigningScenarioTest, self).__init__(*args, **kwargs) diff --git a/src/codesigning/azext_codesigning/tests/latest/test_codesigning_scenario_coverage.md b/src/codesigning/azext_codesigning/tests/latest/test_codesigning_scenario_coverage.md index 25016d77584..38b427e1356 100644 --- a/src/codesigning/azext_codesigning/tests/latest/test_codesigning_scenario_coverage.md +++ b/src/codesigning/azext_codesigning/tests/latest/test_codesigning_scenario_coverage.md @@ -1,12 +1,12 @@ |Scenario|Result|ErrorMessage|ErrorStack|ErrorNormalized|StartDt|EndDt| -|step_create|successed||||2021-03-12 11:22:26.093042|2021-03-12 11:22:36.122302| -|step_show|successed||||2021-03-12 11:22:36.123301|2021-03-12 11:22:37.829122| -|step_list|successed||||2021-03-12 11:22:37.829122|2021-03-12 11:22:39.336026| -|step_list2|successed||||2021-03-12 11:22:39.336026|2021-03-12 11:22:40.664287| -|step_update|successed||||2021-03-12 11:22:40.664287|2021-03-12 11:22:44.629018| -|step_certificate_profile_create|successed||||2021-03-12 11:22:44.630019|2021-03-12 11:22:47.495356| -|step_certificate_profile_show|successed||||2021-03-12 11:22:47.495356|2021-03-12 11:22:49.020785| -|step_certificate_profile_list|successed||||2021-03-12 11:22:49.020785|2021-03-12 11:22:50.843754| -|step_certificate_profile_update|successed||||2021-03-12 11:22:50.843754|2021-03-12 11:22:53.037149| -|step_operation_show|successed||||2021-03-12 11:22:53.037149|2021-03-12 11:22:54.607716| +|step_create|successed||||2021-06-02 11:09:45.898644|2021-06-02 11:09:56.320676| +|step_show|successed||||2021-06-02 11:09:56.321676|2021-06-02 11:09:57.738642| +|step_list|successed||||2021-06-02 11:09:57.739629|2021-06-02 11:09:59.530042| +|step_list2|successed||||2021-06-02 11:09:59.530042|2021-06-02 11:10:00.709533| +|step_update|successed||||2021-06-02 11:10:00.710534|2021-06-02 11:10:05.372782| +|step_certificate_profile_create|successed||||2021-06-02 11:10:05.372782|2021-06-02 11:10:08.227837| +|step_certificate_profile_show|successed||||2021-06-02 11:10:08.228862|2021-06-02 11:10:09.616964| +|step_certificate_profile_list|successed||||2021-06-02 11:10:09.616964|2021-06-02 11:10:10.519435| +|step_certificate_profile_delete|successed||||2021-06-02 11:10:10.520222|2021-06-02 11:10:14.239729| +|step_delete|successed||||2021-06-02 11:10:14.240777|2021-06-02 11:10:17.941814| Coverage: 10/10 diff --git a/src/codesigning/azext_codesigning/vendored_sdks/codesigning/_code_signing_management_client.py b/src/codesigning/azext_codesigning/vendored_sdks/codesigning/_code_signing_management_client.py index 855a0f911c8..6f8961b6f5e 100644 --- a/src/codesigning/azext_codesigning/vendored_sdks/codesigning/_code_signing_management_client.py +++ b/src/codesigning/azext_codesigning/vendored_sdks/codesigning/_code_signing_management_client.py @@ -18,17 +18,17 @@ from azure.core.credentials import TokenCredential from ._configuration import CodeSigningManagementClientConfiguration -from .operations import CodeSignAccountOperations +from .operations import CodeSigningAccountOperations from .operations import CertificateProfileOperations from .operations import Operations from . import models class CodeSigningManagementClient(object): - """Code Sign Resource Provider Account and Certificate Profile management API. + """Code Signing Resource Provider Account and Certificate Profile management API. - :ivar code_sign_account: CodeSignAccountOperations operations - :vartype code_sign_account: azure.mgmt.codesigning.operations.CodeSignAccountOperations + :ivar code_signing_account: CodeSigningAccountOperations operations + :vartype code_signing_account: azure.mgmt.codesigning.operations.CodeSigningAccountOperations :ivar certificate_profile: CertificateProfileOperations operations :vartype certificate_profile: azure.mgmt.codesigning.operations.CertificateProfileOperations :ivar operations: Operations operations @@ -38,6 +38,7 @@ class CodeSigningManagementClient(object): :param subscription_id: The ID of the target subscription. :type subscription_id: str :param str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ def __init__( @@ -58,7 +59,7 @@ def __init__( self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) - self.code_sign_account = CodeSignAccountOperations( + self.code_signing_account = CodeSigningAccountOperations( self._client, self._config, self._serialize, self._deserialize) self.certificate_profile = CertificateProfileOperations( self._client, self._config, self._serialize, self._deserialize) diff --git a/src/codesigning/azext_codesigning/vendored_sdks/codesigning/aio/_code_signing_management_client.py b/src/codesigning/azext_codesigning/vendored_sdks/codesigning/aio/_code_signing_management_client.py index 5fd1b45609d..cde951fbcee 100644 --- a/src/codesigning/azext_codesigning/vendored_sdks/codesigning/aio/_code_signing_management_client.py +++ b/src/codesigning/azext_codesigning/vendored_sdks/codesigning/aio/_code_signing_management_client.py @@ -16,17 +16,17 @@ from azure.core.credentials_async import AsyncTokenCredential from ._configuration import CodeSigningManagementClientConfiguration -from .operations import CodeSignAccountOperations +from .operations import CodeSigningAccountOperations from .operations import CertificateProfileOperations from .operations import Operations from .. import models class CodeSigningManagementClient(object): - """Code Sign Resource Provider Account and Certificate Profile management API. + """Code Signing Resource Provider Account and Certificate Profile management API. - :ivar code_sign_account: CodeSignAccountOperations operations - :vartype code_sign_account: azure.mgmt.codesigning.aio.operations.CodeSignAccountOperations + :ivar code_signing_account: CodeSigningAccountOperations operations + :vartype code_signing_account: azure.mgmt.codesigning.aio.operations.CodeSigningAccountOperations :ivar certificate_profile: CertificateProfileOperations operations :vartype certificate_profile: azure.mgmt.codesigning.aio.operations.CertificateProfileOperations :ivar operations: Operations operations @@ -36,6 +36,7 @@ class CodeSigningManagementClient(object): :param subscription_id: The ID of the target subscription. :type subscription_id: str :param str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ def __init__( @@ -55,7 +56,7 @@ def __init__( self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) - self.code_sign_account = CodeSignAccountOperations( + self.code_signing_account = CodeSigningAccountOperations( self._client, self._config, self._serialize, self._deserialize) self.certificate_profile = CertificateProfileOperations( self._client, self._config, self._serialize, self._deserialize) diff --git a/src/codesigning/azext_codesigning/vendored_sdks/codesigning/aio/operations/__init__.py b/src/codesigning/azext_codesigning/vendored_sdks/codesigning/aio/operations/__init__.py index b4b2e783f7d..bd81555bcaa 100644 --- a/src/codesigning/azext_codesigning/vendored_sdks/codesigning/aio/operations/__init__.py +++ b/src/codesigning/azext_codesigning/vendored_sdks/codesigning/aio/operations/__init__.py @@ -6,12 +6,12 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._code_sign_account_operations import CodeSignAccountOperations +from ._code_signing_account_operations import CodeSigningAccountOperations from ._certificate_profile_operations import CertificateProfileOperations from ._operations import Operations __all__ = [ - 'CodeSignAccountOperations', + 'CodeSigningAccountOperations', 'CertificateProfileOperations', 'Operations', ] diff --git a/src/codesigning/azext_codesigning/vendored_sdks/codesigning/aio/operations/_certificate_profile_operations.py b/src/codesigning/azext_codesigning/vendored_sdks/codesigning/aio/operations/_certificate_profile_operations.py index 88304673d6e..c64b5c5bcb5 100644 --- a/src/codesigning/azext_codesigning/vendored_sdks/codesigning/aio/operations/_certificate_profile_operations.py +++ b/src/codesigning/azext_codesigning/vendored_sdks/codesigning/aio/operations/_certificate_profile_operations.py @@ -5,14 +5,16 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models @@ -41,13 +43,13 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config - def list_by_code_sign_account( + def list_by_code_signing_account( self, resource_group_name: str, account_name: str, **kwargs ) -> AsyncIterable["models.CertificateProfiles"]: - """List certificate profiles within a code sign account. + """List certificate profiles within a code signing account. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str @@ -73,11 +75,11 @@ def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list_by_code_sign_account.metadata['url'] # type: ignore + url = self.list_by_code_signing_account.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', pattern=r'^[a-zA-Z0-9-]{3,24}$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', pattern=r'^(?=.{3,24}$)[^0-9][A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters @@ -114,31 +116,16 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_by_code_sign_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSignAccounts/{accountName}/certificateProfiles'} # type: ignore + list_by_code_signing_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSigningAccounts/{accountName}/certificateProfiles'} # type: ignore - async def create( + async def _create_initial( self, resource_group_name: str, account_name: str, profile_name: str, - certificate_profile: Optional["models.CertificateProfile"] = None, + certificate_profile: "models.CertificateProfile", **kwargs ) -> "models.CertificateProfile": - """Create a certificate profile. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param account_name: Code Signing account name. - :type account_name: str - :param profile_name: Certificate profile name. - :type profile_name: str - :param certificate_profile: - :type certificate_profile: ~azure.mgmt.codesigning.models.CertificateProfile - :keyword callable cls: A custom type or function that will be passed the direct response - :return: CertificateProfile, or the result of cls(response) - :rtype: ~azure.mgmt.codesigning.models.CertificateProfile - :raises: ~azure.core.exceptions.HttpResponseError - """ cls = kwargs.pop('cls', None) # type: ClsType["models.CertificateProfile"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -149,12 +136,12 @@ async def create( accept = "application/json" # Construct URL - url = self.create.metadata['url'] # type: ignore + url = self._create_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', pattern=r'^[a-zA-Z0-9-]{3,24}$'), - 'profileName': self._serialize.url("profile_name", profile_name, 'str', pattern=r'^[a-zA-Z0-9-]{3,24}$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', pattern=r'^(?=.{3,24}$)[^0-9][A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str', pattern=r'^(?=.{5,100}$)[^0-9][A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$'), } url = self._client.format_url(url, **path_format_arguments) @@ -168,34 +155,111 @@ async def create( header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') body_content_kwargs = {} # type: Dict[str, Any] - if certificate_profile is not None: - body_content = self._serialize.body(certificate_profile, 'CertificateProfile') - else: - body_content = None + body_content = self._serialize.body(certificate_profile, 'CertificateProfile') body_content_kwargs['content'] = body_content request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200]: + if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('CertificateProfile', pipeline_response) + if response.status_code == 200: + deserialized = self._deserialize('CertificateProfile', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('CertificateProfile', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSignAccounts/{accountName}/certificateProfiles/{profileName}'} # type: ignore + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSigningAccounts/{accountName}/certificateProfiles/{profileName}'} # type: ignore + + async def begin_create( + self, + resource_group_name: str, + account_name: str, + profile_name: str, + certificate_profile: "models.CertificateProfile", + **kwargs + ) -> AsyncLROPoller["models.CertificateProfile"]: + """Create a certificate profile. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param account_name: Code Signing account name. + :type account_name: str + :param profile_name: Certificate profile name. + :type profile_name: str + :param certificate_profile: Parameters to create the certificate profile. + :type certificate_profile: ~azure.mgmt.codesigning.models.CertificateProfile + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either CertificateProfile or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.codesigning.models.CertificateProfile] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.CertificateProfile"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_initial( + resource_group_name=resource_group_name, + account_name=account_name, + profile_name=profile_name, + certificate_profile=certificate_profile, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('CertificateProfile', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', pattern=r'^(?=.{3,24}$)[^0-9][A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str', pattern=r'^(?=.{5,100}$)[^0-9][A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSigningAccounts/{accountName}/certificateProfiles/{profileName}'} # type: ignore async def update( self, resource_group_name: str, account_name: str, profile_name: str, - certificate_profile: Optional["models.CertificateProfile"] = None, + certificate_profile_patch: "models.CertificateProfilePatch", **kwargs ) -> "models.CertificateProfile": """Update a certificate profile. @@ -206,8 +270,8 @@ async def update( :type account_name: str :param profile_name: Certificate profile name. :type profile_name: str - :param certificate_profile: - :type certificate_profile: ~azure.mgmt.codesigning.models.CertificateProfile + :param certificate_profile_patch: Parameters supplied to update certificate profile. + :type certificate_profile_patch: ~azure.mgmt.codesigning.models.CertificateProfilePatch :keyword callable cls: A custom type or function that will be passed the direct response :return: CertificateProfile, or the result of cls(response) :rtype: ~azure.mgmt.codesigning.models.CertificateProfile @@ -227,8 +291,8 @@ async def update( path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', pattern=r'^[a-zA-Z0-9-]{3,24}$'), - 'profileName': self._serialize.url("profile_name", profile_name, 'str', pattern=r'^[a-zA-Z0-9-]{3,24}$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', pattern=r'^(?=.{3,24}$)[^0-9][A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str', pattern=r'^(?=.{5,100}$)[^0-9][A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$'), } url = self._client.format_url(url, **path_format_arguments) @@ -242,10 +306,7 @@ async def update( header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') body_content_kwargs = {} # type: Dict[str, Any] - if certificate_profile is not None: - body_content = self._serialize.body(certificate_profile, 'CertificateProfile') - else: - body_content = None + body_content = self._serialize.body(certificate_profile_patch, 'CertificateProfilePatch') body_content_kwargs['content'] = body_content request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) @@ -262,7 +323,7 @@ async def update( return cls(pipeline_response, deserialized, {}) return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSignAccounts/{accountName}/certificateProfiles/{profileName}'} # type: ignore + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSigningAccounts/{accountName}/certificateProfiles/{profileName}'} # type: ignore async def get( self, @@ -297,8 +358,8 @@ async def get( path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', pattern=r'^[a-zA-Z0-9-]{3,24}$'), - 'profileName': self._serialize.url("profile_name", profile_name, 'str', pattern=r'^[a-zA-Z0-9-]{3,24}$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', pattern=r'^(?=.{3,24}$)[^0-9][A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str', pattern=r'^(?=.{5,100}$)[^0-9][A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$'), } url = self._client.format_url(url, **path_format_arguments) @@ -325,28 +386,15 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSignAccounts/{accountName}/certificateProfiles/{profileName}'} # type: ignore + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSigningAccounts/{accountName}/certificateProfiles/{profileName}'} # type: ignore - async def delete( + async def _delete_initial( self, resource_group_name: str, account_name: str, profile_name: str, **kwargs ) -> None: - """Delete a Certificate Profile. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param account_name: Code Signing account name. - :type account_name: str - :param profile_name: Certificate profile name. - :type profile_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -356,12 +404,12 @@ async def delete( accept = "application/json" # Construct URL - url = self.delete.metadata['url'] # type: ignore + url = self._delete_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', pattern=r'^[a-zA-Z0-9-]{3,24}$'), - 'profileName': self._serialize.url("profile_name", profile_name, 'str', pattern=r'^[a-zA-Z0-9-]{3,24}$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', pattern=r'^(?=.{3,24}$)[^0-9][A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str', pattern=r'^(?=.{5,100}$)[^0-9][A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$'), } url = self._client.format_url(url, **path_format_arguments) @@ -377,7 +425,7 @@ async def delete( pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200, 204]: + if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -385,4 +433,73 @@ async def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSignAccounts/{accountName}/certificateProfiles/{profileName}'} # type: ignore + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSigningAccounts/{accountName}/certificateProfiles/{profileName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + account_name: str, + profile_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Delete a Certificate Profile. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param account_name: Code Signing account name. + :type account_name: str + :param profile_name: Certificate profile name. + :type profile_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + account_name=account_name, + profile_name=profile_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', pattern=r'^(?=.{3,24}$)[^0-9][A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str', pattern=r'^(?=.{5,100}$)[^0-9][A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSigningAccounts/{accountName}/certificateProfiles/{profileName}'} # type: ignore diff --git a/src/codesigning/azext_codesigning/vendored_sdks/codesigning/aio/operations/_code_signing_account_operations.py b/src/codesigning/azext_codesigning/vendored_sdks/codesigning/aio/operations/_code_signing_account_operations.py new file mode 100644 index 00000000000..40965c931c9 --- /dev/null +++ b/src/codesigning/azext_codesigning/vendored_sdks/codesigning/aio/operations/_code_signing_account_operations.py @@ -0,0 +1,549 @@ +# 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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class CodeSigningAccountOperations: + """CodeSigningAccountOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.codesigning.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def _create_initial( + self, + resource_group_name: str, + account_name: str, + code_signing_account: Optional["models.CodeSigningAccount"] = None, + **kwargs + ) -> "models.CodeSigningAccount": + cls = kwargs.pop('cls', None) # type: ClsType["models.CodeSigningAccount"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-14-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', pattern=r'^(?=.{3,24}$)[^0-9][A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + if code_signing_account is not None: + body_content = self._serialize.body(code_signing_account, 'CodeSigningAccount') + else: + body_content = None + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('CodeSigningAccount', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('CodeSigningAccount', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSigningAccounts/{accountName}'} # type: ignore + + async def begin_create( + self, + resource_group_name: str, + account_name: str, + code_signing_account: Optional["models.CodeSigningAccount"] = None, + **kwargs + ) -> AsyncLROPoller["models.CodeSigningAccount"]: + """Create a Code Signing Account. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param account_name: Code Signing account name. + :type account_name: str + :param code_signing_account: Parameters to create the code signing account. + :type code_signing_account: ~azure.mgmt.codesigning.models.CodeSigningAccount + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either CodeSigningAccount or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.codesigning.models.CodeSigningAccount] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.CodeSigningAccount"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_initial( + resource_group_name=resource_group_name, + account_name=account_name, + code_signing_account=code_signing_account, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('CodeSigningAccount', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', pattern=r'^(?=.{3,24}$)[^0-9][A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSigningAccounts/{accountName}'} # type: ignore + + async def update( + self, + resource_group_name: str, + account_name: str, + code_signing_account_patch: "models.CodeSigningAccountPatch", + **kwargs + ) -> "models.CodeSigningAccount": + """Update a code signing account. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param account_name: Code Signing account name. + :type account_name: str + :param code_signing_account_patch: Parameters supplied to update code signing account. + :type code_signing_account_patch: ~azure.mgmt.codesigning.models.CodeSigningAccountPatch + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CodeSigningAccount, or the result of cls(response) + :rtype: ~azure.mgmt.codesigning.models.CodeSigningAccount + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.CodeSigningAccount"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-14-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', pattern=r'^(?=.{3,24}$)[^0-9][A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(code_signing_account_patch, 'CodeSigningAccountPatch') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CodeSigningAccount', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSigningAccounts/{accountName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + account_name: str, + **kwargs + ) -> "models.CodeSigningAccount": + """Get a Code Signing Account. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param account_name: Code Signing account name. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CodeSigningAccount, or the result of cls(response) + :rtype: ~azure.mgmt.codesigning.models.CodeSigningAccount + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.CodeSigningAccount"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-14-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', pattern=r'^(?=.{3,24}$)[^0-9][A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CodeSigningAccount', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSigningAccounts/{accountName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + account_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-14-preview" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', pattern=r'^(?=.{3,24}$)[^0-9][A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSigningAccounts/{accountName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + account_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Delete Code Signing Account. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param account_name: Code Signing account name. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + account_name=account_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', pattern=r'^(?=.{3,24}$)[^0-9][A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSigningAccounts/{accountName}'} # type: ignore + + def list_by_subscription( + self, + **kwargs + ) -> AsyncIterable["models.CodeSigningAccounts"]: + """Lists Code Signing Accounts within a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either CodeSigningAccounts or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.codesigning.models.CodeSigningAccounts] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.CodeSigningAccounts"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-14-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_subscription.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('CodeSigningAccounts', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.CodeSigning/codeSigningAccounts'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["models.CodeSigningAccounts"]: + """List Code Signing Accounts within a resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either CodeSigningAccounts or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.codesigning.models.CodeSigningAccounts] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.CodeSigningAccounts"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-14-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('CodeSigningAccounts', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSigningAccounts'} # type: ignore diff --git a/src/codesigning/azext_codesigning/vendored_sdks/codesigning/aio/operations/_operations.py b/src/codesigning/azext_codesigning/vendored_sdks/codesigning/aio/operations/_operations.py index 17d51edc7de..5132ab8e3bf 100644 --- a/src/codesigning/azext_codesigning/vendored_sdks/codesigning/aio/operations/_operations.py +++ b/src/codesigning/azext_codesigning/vendored_sdks/codesigning/aio/operations/_operations.py @@ -41,7 +41,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config - def get( + def list( self, **kwargs ) -> AsyncIterable["models.OperationList"]: @@ -67,7 +67,7 @@ def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.get.metadata['url'] # type: ignore + url = self.list.metadata['url'] # type: ignore # Construct parameters query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') @@ -102,4 +102,4 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - get.metadata = {'url': '/providers/Microsoft.CodeSigning/operations'} # type: ignore + list.metadata = {'url': '/providers/Microsoft.CodeSigning/operations'} # type: ignore diff --git a/src/codesigning/azext_codesigning/vendored_sdks/codesigning/models/__init__.py b/src/codesigning/azext_codesigning/vendored_sdks/codesigning/models/__init__.py index 02d8c88b844..dd6ae2ced0b 100644 --- a/src/codesigning/azext_codesigning/vendored_sdks/codesigning/models/__init__.py +++ b/src/codesigning/azext_codesigning/vendored_sdks/codesigning/models/__init__.py @@ -9,10 +9,11 @@ try: from ._models_py3 import Certificate from ._models_py3 import CertificateProfile + from ._models_py3 import CertificateProfilePatch from ._models_py3 import CertificateProfiles - from ._models_py3 import CodeSignAccount - from ._models_py3 import CodeSignAccountPatch - from ._models_py3 import CodeSignAccounts + from ._models_py3 import CodeSigningAccount + from ._models_py3 import CodeSigningAccountPatch + from ._models_py3 import CodeSigningAccounts from ._models_py3 import ErrorAdditionalInfo from ._models_py3 import ErrorDetail from ._models_py3 import ErrorResponse @@ -26,10 +27,11 @@ except (SyntaxError, ImportError): from ._models import Certificate # type: ignore from ._models import CertificateProfile # type: ignore + from ._models import CertificateProfilePatch # type: ignore from ._models import CertificateProfiles # type: ignore - from ._models import CodeSignAccount # type: ignore - from ._models import CodeSignAccountPatch # type: ignore - from ._models import CodeSignAccounts # type: ignore + from ._models import CodeSigningAccount # type: ignore + from ._models import CodeSigningAccountPatch # type: ignore + from ._models import CodeSigningAccounts # type: ignore from ._models import ErrorAdditionalInfo # type: ignore from ._models import ErrorDetail # type: ignore from ._models import ErrorResponse # type: ignore @@ -46,16 +48,16 @@ ProfileType, ProvisioningState, RotationPolicy, - VerificationStatus, ) __all__ = [ 'Certificate', 'CertificateProfile', + 'CertificateProfilePatch', 'CertificateProfiles', - 'CodeSignAccount', - 'CodeSignAccountPatch', - 'CodeSignAccounts', + 'CodeSigningAccount', + 'CodeSigningAccountPatch', + 'CodeSigningAccounts', 'ErrorAdditionalInfo', 'ErrorDetail', 'ErrorResponse', @@ -70,5 +72,4 @@ 'ProfileType', 'ProvisioningState', 'RotationPolicy', - 'VerificationStatus', ] diff --git a/src/codesigning/azext_codesigning/vendored_sdks/codesigning/models/_code_signing_management_client_enums.py b/src/codesigning/azext_codesigning/vendored_sdks/codesigning/models/_code_signing_management_client_enums.py index f803d1e51f3..f1f59c23980 100644 --- a/src/codesigning/azext_codesigning/vendored_sdks/codesigning/models/_code_signing_management_client_enums.py +++ b/src/codesigning/azext_codesigning/vendored_sdks/codesigning/models/_code_signing_management_client_enums.py @@ -39,9 +39,6 @@ class ProfileType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Profile type of the certificate """ - TEST = "Test" - TRIAL = "Trial" - PRIVATE_TRUST = "PrivateTrust" PUBLIC_TRUST = "PublicTrust" class ProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): @@ -60,12 +57,4 @@ class RotationPolicy(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Rotation policy of the certificate """ - MONTHLY = "Monthly" - -class VerificationStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Vetting status of the code sign account - """ - - COMPLETED = "Completed" - IN_PROGRESS = "InProgress" - NOT_COMPLETED = "NotCompleted" + THIRTY_DAYS = "30 Days" diff --git a/src/codesigning/azext_codesigning/vendored_sdks/codesigning/models/_models.py b/src/codesigning/azext_codesigning/vendored_sdks/codesigning/models/_models.py index 74d722f4436..f27cd799584 100644 --- a/src/codesigning/azext_codesigning/vendored_sdks/codesigning/models/_models.py +++ b/src/codesigning/azext_codesigning/vendored_sdks/codesigning/models/_models.py @@ -13,35 +13,21 @@ class Certificate(msrest.serialization.Model): """Properties of the certificate. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Id of the certificate. - :vartype id: str - :ivar subject_name: Subject name of the certificate. - :vartype subject_name: str - :ivar subject_alternative_name: Subject alternative name of the certificate. - :vartype subject_alternative_name: str - :ivar thumbprint: Thumbprint of the certificate. - :vartype thumbprint: str - :ivar created_date: Certificate created date. - :vartype created_date: str - :ivar expiry_date: Certificate expiry date. - :vartype expiry_date: str + :param serial_number: Id of the certificate. + :type serial_number: str + :param subject_name: Subject name of the certificate. + :type subject_name: str + :param thumbprint: Thumbprint of the certificate. + :type thumbprint: str + :param created_date: Certificate created date. + :type created_date: str + :param expiry_date: Certificate expiry date. + :type expiry_date: str """ - _validation = { - 'id': {'readonly': True}, - 'subject_name': {'readonly': True}, - 'subject_alternative_name': {'readonly': True}, - 'thumbprint': {'readonly': True}, - 'created_date': {'readonly': True}, - 'expiry_date': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, + 'serial_number': {'key': 'serialNumber', 'type': 'str'}, 'subject_name': {'key': 'subjectName', 'type': 'str'}, - 'subject_alternative_name': {'key': 'subjectAlternativeName', 'type': 'str'}, 'thumbprint': {'key': 'thumbprint', 'type': 'str'}, 'created_date': {'key': 'createdDate', 'type': 'str'}, 'expiry_date': {'key': 'expiryDate', 'type': 'str'}, @@ -52,12 +38,11 @@ def __init__( **kwargs ): super(Certificate, self).__init__(**kwargs) - self.id = None - self.subject_name = None - self.subject_alternative_name = None - self.thumbprint = None - self.created_date = None - self.expiry_date = None + self.serial_number = kwargs.get('serial_number', None) + self.subject_name = kwargs.get('subject_name', None) + self.thumbprint = kwargs.get('thumbprint', None) + self.created_date = kwargs.get('created_date', None) + self.expiry_date = kwargs.get('expiry_date', None) class Resource(msrest.serialization.Model): @@ -98,10 +83,12 @@ def __init__( class CertificateProfile(Resource): - """CertificateProfile. + """Certificate profile resource. Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str @@ -112,19 +99,18 @@ class CertificateProfile(Resource): :vartype type: str :ivar system_data: Metadata pertaining to creation and last modification of the resource. :vartype system_data: ~azure.mgmt.codesigning.models.SystemData - :param profile_type: Profile type of the certificate. Possible values include: "Test", "Trial", - "PrivateTrust", "PublicTrust". + :param profile_type: Required. Profile type of the certificate. Possible values include: + "PublicTrust". :type profile_type: str or ~azure.mgmt.codesigning.models.ProfileType - :param rotation_policy: Rotation policy of the certificate. Possible values include: "Monthly". + :param rotation_policy: Required. Rotation policy of the certificate. Possible values include: + "30 Days". :type rotation_policy: str or ~azure.mgmt.codesigning.models.RotationPolicy - :param common_name: Name of the certificate. + :param common_name: Required. Used as CN in the subject name of the certificate. :type common_name: str :ivar authority: Certificate authority of the certificate. :vartype authority: str - :param subject_alternative_name: Subject Alternative Name of the certificate. - :type subject_alternative_name: str - :ivar organization: - :vartype organization: str + :param organization: Required. Used as O in the subject name of the certificate. + :type organization: str :ivar street_address: :vartype street_address: str :ivar country: @@ -145,8 +131,11 @@ class CertificateProfile(Resource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'system_data': {'readonly': True}, + 'profile_type': {'required': True}, + 'rotation_policy': {'required': True}, + 'common_name': {'required': True}, 'authority': {'readonly': True}, - 'organization': {'readonly': True}, + 'organization': {'required': True}, 'street_address': {'readonly': True}, 'country': {'readonly': True}, 'state': {'readonly': True}, @@ -164,7 +153,6 @@ class CertificateProfile(Resource): 'rotation_policy': {'key': 'properties.rotationPolicy', 'type': 'str'}, 'common_name': {'key': 'properties.commonName', 'type': 'str'}, 'authority': {'key': 'properties.authority', 'type': 'str'}, - 'subject_alternative_name': {'key': 'properties.subjectAlternativeName', 'type': 'str'}, 'organization': {'key': 'properties.organization', 'type': 'str'}, 'street_address': {'key': 'properties.streetAddress', 'type': 'str'}, 'country': {'key': 'properties.country', 'type': 'str'}, @@ -180,12 +168,11 @@ def __init__( ): super(CertificateProfile, self).__init__(**kwargs) self.system_data = None - self.profile_type = kwargs.get('profile_type', None) - self.rotation_policy = kwargs.get('rotation_policy', None) - self.common_name = kwargs.get('common_name', None) + self.profile_type = kwargs['profile_type'] + self.rotation_policy = kwargs['rotation_policy'] + self.common_name = kwargs['common_name'] self.authority = None - self.subject_alternative_name = kwargs.get('subject_alternative_name', None) - self.organization = None + self.organization = kwargs['organization'] self.street_address = None self.country = None self.state = None @@ -194,12 +181,37 @@ def __init__( self.provisioning_state = None +class CertificateProfilePatch(msrest.serialization.Model): + """Certificate Profile Patch Properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar certificates: + :vartype certificates: list[~azure.mgmt.codesigning.models.Certificate] + """ + + _validation = { + 'certificates': {'readonly': True}, + } + + _attribute_map = { + 'certificates': {'key': 'properties.certificates', 'type': '[Certificate]'}, + } + + def __init__( + self, + **kwargs + ): + super(CertificateProfilePatch, self).__init__(**kwargs) + self.certificates = None + + class CertificateProfiles(msrest.serialization.Model): - """The paginated list of certifcate profiles. + """The paginated list of certificate profiles. - :param value: The list of certifcate profiless. + :param value: The list of certificate profiles. :type value: list[~azure.mgmt.codesigning.models.CertificateProfile] - :param next_link: The link to fetch the next page of certifcate profile. + :param next_link: The link to fetch the next page of certificate profile. :type next_link: str """ @@ -262,8 +274,8 @@ def __init__( self.location = kwargs['location'] -class CodeSignAccount(TrackedResource): - """CodeSignAccount. +class CodeSigningAccount(TrackedResource): + """Code signing account resource. Variables are only populated by the server, and will be ignored when sending a request. @@ -283,12 +295,9 @@ class CodeSignAccount(TrackedResource): :type location: str :ivar system_data: Metadata pertaining to creation and last modification of the resource. :vartype system_data: ~azure.mgmt.codesigning.models.SystemData - :ivar account_uri: The URI of the code sign account for performing operations on certificate + :ivar account_uri: The URI of the code signing account for performing operations on certificate profiles. This property is readonly. :vartype account_uri: str - :ivar verification_status: Vetting status of the code sign account. Possible values include: - "Completed", "InProgress", "NotCompleted". - :vartype verification_status: str or ~azure.mgmt.codesigning.models.VerificationStatus :ivar provisioning_state: Provisioning state of the vault. Possible values include: "Succeeded", "Failed", "Canceled", "Provisioning", "Updating", "Deleting", "Accepted". :vartype provisioning_state: str or ~azure.mgmt.codesigning.models.ProvisioningState @@ -301,7 +310,6 @@ class CodeSignAccount(TrackedResource): 'location': {'required': True}, 'system_data': {'readonly': True}, 'account_uri': {'readonly': True}, - 'verification_status': {'readonly': True}, 'provisioning_state': {'readonly': True}, } @@ -313,7 +321,6 @@ class CodeSignAccount(TrackedResource): 'location': {'key': 'location', 'type': 'str'}, 'system_data': {'key': 'systemData', 'type': 'SystemData'}, 'account_uri': {'key': 'properties.accountUri', 'type': 'str'}, - 'verification_status': {'key': 'properties.verificationStatus', 'type': 'str'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, } @@ -321,43 +328,52 @@ def __init__( self, **kwargs ): - super(CodeSignAccount, self).__init__(**kwargs) + super(CodeSigningAccount, self).__init__(**kwargs) self.system_data = None self.account_uri = None - self.verification_status = None self.provisioning_state = None -class CodeSignAccountPatch(msrest.serialization.Model): - """Object containing updates for patch operations. +class CodeSigningAccountPatch(msrest.serialization.Model): + """Parameters for creating or updating a code signing account. + + Variables are only populated by the server, and will be ignored when sending a request. :param tags: A set of tags. Resource tags. :type tags: dict[str, str] + :ivar account_uri: Account Uri of the code signing account. + :vartype account_uri: str """ + _validation = { + 'account_uri': {'readonly': True}, + } + _attribute_map = { 'tags': {'key': 'tags', 'type': '{str}'}, + 'account_uri': {'key': 'properties.accountUri', 'type': 'str'}, } def __init__( self, **kwargs ): - super(CodeSignAccountPatch, self).__init__(**kwargs) + super(CodeSigningAccountPatch, self).__init__(**kwargs) self.tags = kwargs.get('tags', None) + self.account_uri = None -class CodeSignAccounts(msrest.serialization.Model): - """The paginated list of code sign accounts. +class CodeSigningAccounts(msrest.serialization.Model): + """The paginated list of code signing accounts. - :param value: List of code sign accounts. - :type value: list[~azure.mgmt.codesigning.models.CodeSignAccount] - :param next_link: The link to fetch the next page of code sign account. + :param value: List of code signing accounts. + :type value: list[~azure.mgmt.codesigning.models.CodeSigningAccount] + :param next_link: The link to fetch the next page of code signing account. :type next_link: str """ _attribute_map = { - 'value': {'key': 'value', 'type': '[CodeSignAccount]'}, + 'value': {'key': 'value', 'type': '[CodeSigningAccount]'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } @@ -365,7 +381,7 @@ def __init__( self, **kwargs ): - super(CodeSignAccounts, self).__init__(**kwargs) + super(CodeSigningAccounts, self).__init__(**kwargs) self.value = kwargs.get('value', None) self.next_link = kwargs.get('next_link', None) @@ -502,7 +518,7 @@ class OperationDisplay(msrest.serialization.Model): :param provider: Resource provider of the operation. :type provider: str - :param resource: Code sign resource on which the operation is performed. + :param resource: Code signing resource on which the operation is performed. :type resource: str :param operation: Localized friendly name for the operation read, write, etc. :type operation: str diff --git a/src/codesigning/azext_codesigning/vendored_sdks/codesigning/models/_models_py3.py b/src/codesigning/azext_codesigning/vendored_sdks/codesigning/models/_models_py3.py index 6942cda7a03..e38c6f7b289 100644 --- a/src/codesigning/azext_codesigning/vendored_sdks/codesigning/models/_models_py3.py +++ b/src/codesigning/azext_codesigning/vendored_sdks/codesigning/models/_models_py3.py @@ -18,35 +18,21 @@ class Certificate(msrest.serialization.Model): """Properties of the certificate. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Id of the certificate. - :vartype id: str - :ivar subject_name: Subject name of the certificate. - :vartype subject_name: str - :ivar subject_alternative_name: Subject alternative name of the certificate. - :vartype subject_alternative_name: str - :ivar thumbprint: Thumbprint of the certificate. - :vartype thumbprint: str - :ivar created_date: Certificate created date. - :vartype created_date: str - :ivar expiry_date: Certificate expiry date. - :vartype expiry_date: str + :param serial_number: Id of the certificate. + :type serial_number: str + :param subject_name: Subject name of the certificate. + :type subject_name: str + :param thumbprint: Thumbprint of the certificate. + :type thumbprint: str + :param created_date: Certificate created date. + :type created_date: str + :param expiry_date: Certificate expiry date. + :type expiry_date: str """ - _validation = { - 'id': {'readonly': True}, - 'subject_name': {'readonly': True}, - 'subject_alternative_name': {'readonly': True}, - 'thumbprint': {'readonly': True}, - 'created_date': {'readonly': True}, - 'expiry_date': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, + 'serial_number': {'key': 'serialNumber', 'type': 'str'}, 'subject_name': {'key': 'subjectName', 'type': 'str'}, - 'subject_alternative_name': {'key': 'subjectAlternativeName', 'type': 'str'}, 'thumbprint': {'key': 'thumbprint', 'type': 'str'}, 'created_date': {'key': 'createdDate', 'type': 'str'}, 'expiry_date': {'key': 'expiryDate', 'type': 'str'}, @@ -54,15 +40,20 @@ class Certificate(msrest.serialization.Model): def __init__( self, + *, + serial_number: Optional[str] = None, + subject_name: Optional[str] = None, + thumbprint: Optional[str] = None, + created_date: Optional[str] = None, + expiry_date: Optional[str] = None, **kwargs ): super(Certificate, self).__init__(**kwargs) - self.id = None - self.subject_name = None - self.subject_alternative_name = None - self.thumbprint = None - self.created_date = None - self.expiry_date = None + self.serial_number = serial_number + self.subject_name = subject_name + self.thumbprint = thumbprint + self.created_date = created_date + self.expiry_date = expiry_date class Resource(msrest.serialization.Model): @@ -103,10 +94,12 @@ def __init__( class CertificateProfile(Resource): - """CertificateProfile. + """Certificate profile resource. Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. :vartype id: str @@ -117,19 +110,18 @@ class CertificateProfile(Resource): :vartype type: str :ivar system_data: Metadata pertaining to creation and last modification of the resource. :vartype system_data: ~azure.mgmt.codesigning.models.SystemData - :param profile_type: Profile type of the certificate. Possible values include: "Test", "Trial", - "PrivateTrust", "PublicTrust". + :param profile_type: Required. Profile type of the certificate. Possible values include: + "PublicTrust". :type profile_type: str or ~azure.mgmt.codesigning.models.ProfileType - :param rotation_policy: Rotation policy of the certificate. Possible values include: "Monthly". + :param rotation_policy: Required. Rotation policy of the certificate. Possible values include: + "30 Days". :type rotation_policy: str or ~azure.mgmt.codesigning.models.RotationPolicy - :param common_name: Name of the certificate. + :param common_name: Required. Used as CN in the subject name of the certificate. :type common_name: str :ivar authority: Certificate authority of the certificate. :vartype authority: str - :param subject_alternative_name: Subject Alternative Name of the certificate. - :type subject_alternative_name: str - :ivar organization: - :vartype organization: str + :param organization: Required. Used as O in the subject name of the certificate. + :type organization: str :ivar street_address: :vartype street_address: str :ivar country: @@ -150,8 +142,11 @@ class CertificateProfile(Resource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'system_data': {'readonly': True}, + 'profile_type': {'required': True}, + 'rotation_policy': {'required': True}, + 'common_name': {'required': True}, 'authority': {'readonly': True}, - 'organization': {'readonly': True}, + 'organization': {'required': True}, 'street_address': {'readonly': True}, 'country': {'readonly': True}, 'state': {'readonly': True}, @@ -169,7 +164,6 @@ class CertificateProfile(Resource): 'rotation_policy': {'key': 'properties.rotationPolicy', 'type': 'str'}, 'common_name': {'key': 'properties.commonName', 'type': 'str'}, 'authority': {'key': 'properties.authority', 'type': 'str'}, - 'subject_alternative_name': {'key': 'properties.subjectAlternativeName', 'type': 'str'}, 'organization': {'key': 'properties.organization', 'type': 'str'}, 'street_address': {'key': 'properties.streetAddress', 'type': 'str'}, 'country': {'key': 'properties.country', 'type': 'str'}, @@ -182,10 +176,10 @@ class CertificateProfile(Resource): def __init__( self, *, - profile_type: Optional[Union[str, "ProfileType"]] = None, - rotation_policy: Optional[Union[str, "RotationPolicy"]] = None, - common_name: Optional[str] = None, - subject_alternative_name: Optional[str] = None, + profile_type: Union[str, "ProfileType"], + rotation_policy: Union[str, "RotationPolicy"], + common_name: str, + organization: str, **kwargs ): super(CertificateProfile, self).__init__(**kwargs) @@ -194,8 +188,7 @@ def __init__( self.rotation_policy = rotation_policy self.common_name = common_name self.authority = None - self.subject_alternative_name = subject_alternative_name - self.organization = None + self.organization = organization self.street_address = None self.country = None self.state = None @@ -204,12 +197,37 @@ def __init__( self.provisioning_state = None +class CertificateProfilePatch(msrest.serialization.Model): + """Certificate Profile Patch Properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar certificates: + :vartype certificates: list[~azure.mgmt.codesigning.models.Certificate] + """ + + _validation = { + 'certificates': {'readonly': True}, + } + + _attribute_map = { + 'certificates': {'key': 'properties.certificates', 'type': '[Certificate]'}, + } + + def __init__( + self, + **kwargs + ): + super(CertificateProfilePatch, self).__init__(**kwargs) + self.certificates = None + + class CertificateProfiles(msrest.serialization.Model): - """The paginated list of certifcate profiles. + """The paginated list of certificate profiles. - :param value: The list of certifcate profiless. + :param value: The list of certificate profiles. :type value: list[~azure.mgmt.codesigning.models.CertificateProfile] - :param next_link: The link to fetch the next page of certifcate profile. + :param next_link: The link to fetch the next page of certificate profile. :type next_link: str """ @@ -278,8 +296,8 @@ def __init__( self.location = location -class CodeSignAccount(TrackedResource): - """CodeSignAccount. +class CodeSigningAccount(TrackedResource): + """Code signing account resource. Variables are only populated by the server, and will be ignored when sending a request. @@ -299,12 +317,9 @@ class CodeSignAccount(TrackedResource): :type location: str :ivar system_data: Metadata pertaining to creation and last modification of the resource. :vartype system_data: ~azure.mgmt.codesigning.models.SystemData - :ivar account_uri: The URI of the code sign account for performing operations on certificate + :ivar account_uri: The URI of the code signing account for performing operations on certificate profiles. This property is readonly. :vartype account_uri: str - :ivar verification_status: Vetting status of the code sign account. Possible values include: - "Completed", "InProgress", "NotCompleted". - :vartype verification_status: str or ~azure.mgmt.codesigning.models.VerificationStatus :ivar provisioning_state: Provisioning state of the vault. Possible values include: "Succeeded", "Failed", "Canceled", "Provisioning", "Updating", "Deleting", "Accepted". :vartype provisioning_state: str or ~azure.mgmt.codesigning.models.ProvisioningState @@ -317,7 +332,6 @@ class CodeSignAccount(TrackedResource): 'location': {'required': True}, 'system_data': {'readonly': True}, 'account_uri': {'readonly': True}, - 'verification_status': {'readonly': True}, 'provisioning_state': {'readonly': True}, } @@ -329,7 +343,6 @@ class CodeSignAccount(TrackedResource): 'location': {'key': 'location', 'type': 'str'}, 'system_data': {'key': 'systemData', 'type': 'SystemData'}, 'account_uri': {'key': 'properties.accountUri', 'type': 'str'}, - 'verification_status': {'key': 'properties.verificationStatus', 'type': 'str'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, } @@ -340,22 +353,30 @@ def __init__( tags: Optional[Dict[str, str]] = None, **kwargs ): - super(CodeSignAccount, self).__init__(tags=tags, location=location, **kwargs) + super(CodeSigningAccount, self).__init__(tags=tags, location=location, **kwargs) self.system_data = None self.account_uri = None - self.verification_status = None self.provisioning_state = None -class CodeSignAccountPatch(msrest.serialization.Model): - """Object containing updates for patch operations. +class CodeSigningAccountPatch(msrest.serialization.Model): + """Parameters for creating or updating a code signing account. + + Variables are only populated by the server, and will be ignored when sending a request. :param tags: A set of tags. Resource tags. :type tags: dict[str, str] + :ivar account_uri: Account Uri of the code signing account. + :vartype account_uri: str """ + _validation = { + 'account_uri': {'readonly': True}, + } + _attribute_map = { 'tags': {'key': 'tags', 'type': '{str}'}, + 'account_uri': {'key': 'properties.accountUri', 'type': 'str'}, } def __init__( @@ -364,32 +385,33 @@ def __init__( tags: Optional[Dict[str, str]] = None, **kwargs ): - super(CodeSignAccountPatch, self).__init__(**kwargs) + super(CodeSigningAccountPatch, self).__init__(**kwargs) self.tags = tags + self.account_uri = None -class CodeSignAccounts(msrest.serialization.Model): - """The paginated list of code sign accounts. +class CodeSigningAccounts(msrest.serialization.Model): + """The paginated list of code signing accounts. - :param value: List of code sign accounts. - :type value: list[~azure.mgmt.codesigning.models.CodeSignAccount] - :param next_link: The link to fetch the next page of code sign account. + :param value: List of code signing accounts. + :type value: list[~azure.mgmt.codesigning.models.CodeSigningAccount] + :param next_link: The link to fetch the next page of code signing account. :type next_link: str """ _attribute_map = { - 'value': {'key': 'value', 'type': '[CodeSignAccount]'}, + 'value': {'key': 'value', 'type': '[CodeSigningAccount]'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } def __init__( self, *, - value: Optional[List["CodeSignAccount"]] = None, + value: Optional[List["CodeSigningAccount"]] = None, next_link: Optional[str] = None, **kwargs ): - super(CodeSignAccounts, self).__init__(**kwargs) + super(CodeSigningAccounts, self).__init__(**kwargs) self.value = value self.next_link = next_link @@ -531,7 +553,7 @@ class OperationDisplay(msrest.serialization.Model): :param provider: Resource provider of the operation. :type provider: str - :param resource: Code sign resource on which the operation is performed. + :param resource: Code signing resource on which the operation is performed. :type resource: str :param operation: Localized friendly name for the operation read, write, etc. :type operation: str diff --git a/src/codesigning/azext_codesigning/vendored_sdks/codesigning/operations/__init__.py b/src/codesigning/azext_codesigning/vendored_sdks/codesigning/operations/__init__.py index b4b2e783f7d..bd81555bcaa 100644 --- a/src/codesigning/azext_codesigning/vendored_sdks/codesigning/operations/__init__.py +++ b/src/codesigning/azext_codesigning/vendored_sdks/codesigning/operations/__init__.py @@ -6,12 +6,12 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._code_sign_account_operations import CodeSignAccountOperations +from ._code_signing_account_operations import CodeSigningAccountOperations from ._certificate_profile_operations import CertificateProfileOperations from ._operations import Operations __all__ = [ - 'CodeSignAccountOperations', + 'CodeSigningAccountOperations', 'CertificateProfileOperations', 'Operations', ] diff --git a/src/codesigning/azext_codesigning/vendored_sdks/codesigning/operations/_certificate_profile_operations.py b/src/codesigning/azext_codesigning/vendored_sdks/codesigning/operations/_certificate_profile_operations.py index 72d08b259b0..25ae9dba59e 100644 --- a/src/codesigning/azext_codesigning/vendored_sdks/codesigning/operations/_certificate_profile_operations.py +++ b/src/codesigning/azext_codesigning/vendored_sdks/codesigning/operations/_certificate_profile_operations.py @@ -12,13 +12,15 @@ from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -45,14 +47,14 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config - def list_by_code_sign_account( + def list_by_code_signing_account( self, resource_group_name, # type: str account_name, # type: str **kwargs # type: Any ): # type: (...) -> Iterable["models.CertificateProfiles"] - """List certificate profiles within a code sign account. + """List certificate profiles within a code signing account. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str @@ -78,11 +80,11 @@ def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list_by_code_sign_account.metadata['url'] # type: ignore + url = self.list_by_code_signing_account.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', pattern=r'^[a-zA-Z0-9-]{3,24}$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', pattern=r'^(?=.{3,24}$)[^0-9][A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters @@ -119,32 +121,17 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_by_code_sign_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSignAccounts/{accountName}/certificateProfiles'} # type: ignore + list_by_code_signing_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSigningAccounts/{accountName}/certificateProfiles'} # type: ignore - def create( + def _create_initial( self, resource_group_name, # type: str account_name, # type: str profile_name, # type: str - certificate_profile=None, # type: Optional["models.CertificateProfile"] + certificate_profile, # type: "models.CertificateProfile" **kwargs # type: Any ): # type: (...) -> "models.CertificateProfile" - """Create a certificate profile. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param account_name: Code Signing account name. - :type account_name: str - :param profile_name: Certificate profile name. - :type profile_name: str - :param certificate_profile: - :type certificate_profile: ~azure.mgmt.codesigning.models.CertificateProfile - :keyword callable cls: A custom type or function that will be passed the direct response - :return: CertificateProfile, or the result of cls(response) - :rtype: ~azure.mgmt.codesigning.models.CertificateProfile - :raises: ~azure.core.exceptions.HttpResponseError - """ cls = kwargs.pop('cls', None) # type: ClsType["models.CertificateProfile"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -155,12 +142,12 @@ def create( accept = "application/json" # Construct URL - url = self.create.metadata['url'] # type: ignore + url = self._create_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', pattern=r'^[a-zA-Z0-9-]{3,24}$'), - 'profileName': self._serialize.url("profile_name", profile_name, 'str', pattern=r'^[a-zA-Z0-9-]{3,24}$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', pattern=r'^(?=.{3,24}$)[^0-9][A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str', pattern=r'^(?=.{5,100}$)[^0-9][A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$'), } url = self._client.format_url(url, **path_format_arguments) @@ -174,34 +161,112 @@ def create( header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') body_content_kwargs = {} # type: Dict[str, Any] - if certificate_profile is not None: - body_content = self._serialize.body(certificate_profile, 'CertificateProfile') - else: - body_content = None + body_content = self._serialize.body(certificate_profile, 'CertificateProfile') body_content_kwargs['content'] = body_content request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200]: + if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('CertificateProfile', pipeline_response) + if response.status_code == 200: + deserialized = self._deserialize('CertificateProfile', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('CertificateProfile', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSignAccounts/{accountName}/certificateProfiles/{profileName}'} # type: ignore + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSigningAccounts/{accountName}/certificateProfiles/{profileName}'} # type: ignore + + def begin_create( + self, + resource_group_name, # type: str + account_name, # type: str + profile_name, # type: str + certificate_profile, # type: "models.CertificateProfile" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["models.CertificateProfile"] + """Create a certificate profile. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param account_name: Code Signing account name. + :type account_name: str + :param profile_name: Certificate profile name. + :type profile_name: str + :param certificate_profile: Parameters to create the certificate profile. + :type certificate_profile: ~azure.mgmt.codesigning.models.CertificateProfile + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either CertificateProfile or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.codesigning.models.CertificateProfile] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.CertificateProfile"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_initial( + resource_group_name=resource_group_name, + account_name=account_name, + profile_name=profile_name, + certificate_profile=certificate_profile, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('CertificateProfile', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', pattern=r'^(?=.{3,24}$)[^0-9][A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str', pattern=r'^(?=.{5,100}$)[^0-9][A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSigningAccounts/{accountName}/certificateProfiles/{profileName}'} # type: ignore def update( self, resource_group_name, # type: str account_name, # type: str profile_name, # type: str - certificate_profile=None, # type: Optional["models.CertificateProfile"] + certificate_profile_patch, # type: "models.CertificateProfilePatch" **kwargs # type: Any ): # type: (...) -> "models.CertificateProfile" @@ -213,8 +278,8 @@ def update( :type account_name: str :param profile_name: Certificate profile name. :type profile_name: str - :param certificate_profile: - :type certificate_profile: ~azure.mgmt.codesigning.models.CertificateProfile + :param certificate_profile_patch: Parameters supplied to update certificate profile. + :type certificate_profile_patch: ~azure.mgmt.codesigning.models.CertificateProfilePatch :keyword callable cls: A custom type or function that will be passed the direct response :return: CertificateProfile, or the result of cls(response) :rtype: ~azure.mgmt.codesigning.models.CertificateProfile @@ -234,8 +299,8 @@ def update( path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', pattern=r'^[a-zA-Z0-9-]{3,24}$'), - 'profileName': self._serialize.url("profile_name", profile_name, 'str', pattern=r'^[a-zA-Z0-9-]{3,24}$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', pattern=r'^(?=.{3,24}$)[^0-9][A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str', pattern=r'^(?=.{5,100}$)[^0-9][A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$'), } url = self._client.format_url(url, **path_format_arguments) @@ -249,10 +314,7 @@ def update( header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') body_content_kwargs = {} # type: Dict[str, Any] - if certificate_profile is not None: - body_content = self._serialize.body(certificate_profile, 'CertificateProfile') - else: - body_content = None + body_content = self._serialize.body(certificate_profile_patch, 'CertificateProfilePatch') body_content_kwargs['content'] = body_content request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) @@ -269,7 +331,7 @@ def update( return cls(pipeline_response, deserialized, {}) return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSignAccounts/{accountName}/certificateProfiles/{profileName}'} # type: ignore + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSigningAccounts/{accountName}/certificateProfiles/{profileName}'} # type: ignore def get( self, @@ -305,8 +367,8 @@ def get( path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', pattern=r'^[a-zA-Z0-9-]{3,24}$'), - 'profileName': self._serialize.url("profile_name", profile_name, 'str', pattern=r'^[a-zA-Z0-9-]{3,24}$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', pattern=r'^(?=.{3,24}$)[^0-9][A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str', pattern=r'^(?=.{5,100}$)[^0-9][A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$'), } url = self._client.format_url(url, **path_format_arguments) @@ -333,9 +395,9 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSignAccounts/{accountName}/certificateProfiles/{profileName}'} # type: ignore + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSigningAccounts/{accountName}/certificateProfiles/{profileName}'} # type: ignore - def delete( + def _delete_initial( self, resource_group_name, # type: str account_name, # type: str @@ -343,19 +405,6 @@ def delete( **kwargs # type: Any ): # type: (...) -> None - """Delete a Certificate Profile. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param account_name: Code Signing account name. - :type account_name: str - :param profile_name: Certificate profile name. - :type profile_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -365,12 +414,12 @@ def delete( accept = "application/json" # Construct URL - url = self.delete.metadata['url'] # type: ignore + url = self._delete_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', pattern=r'^[a-zA-Z0-9-]{3,24}$'), - 'profileName': self._serialize.url("profile_name", profile_name, 'str', pattern=r'^[a-zA-Z0-9-]{3,24}$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', pattern=r'^(?=.{3,24}$)[^0-9][A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str', pattern=r'^(?=.{5,100}$)[^0-9][A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$'), } url = self._client.format_url(url, **path_format_arguments) @@ -386,7 +435,7 @@ def delete( pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200, 204]: + if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -394,4 +443,74 @@ def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSignAccounts/{accountName}/certificateProfiles/{profileName}'} # type: ignore + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSigningAccounts/{accountName}/certificateProfiles/{profileName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + account_name, # type: str + profile_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Delete a Certificate Profile. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param account_name: Code Signing account name. + :type account_name: str + :param profile_name: Certificate profile name. + :type profile_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + account_name=account_name, + profile_name=profile_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', pattern=r'^(?=.{3,24}$)[^0-9][A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$'), + 'profileName': self._serialize.url("profile_name", profile_name, 'str', pattern=r'^(?=.{5,100}$)[^0-9][A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSigningAccounts/{accountName}/certificateProfiles/{profileName}'} # type: ignore diff --git a/src/codesigning/azext_codesigning/vendored_sdks/codesigning/operations/_code_signing_account_operations.py b/src/codesigning/azext_codesigning/vendored_sdks/codesigning/operations/_code_signing_account_operations.py new file mode 100644 index 00000000000..b8b7acd5334 --- /dev/null +++ b/src/codesigning/azext_codesigning/vendored_sdks/codesigning/operations/_code_signing_account_operations.py @@ -0,0 +1,561 @@ +# 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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class CodeSigningAccountOperations(object): + """CodeSigningAccountOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.codesigning.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def _create_initial( + self, + resource_group_name, # type: str + account_name, # type: str + code_signing_account=None, # type: Optional["models.CodeSigningAccount"] + **kwargs # type: Any + ): + # type: (...) -> "models.CodeSigningAccount" + cls = kwargs.pop('cls', None) # type: ClsType["models.CodeSigningAccount"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-14-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', pattern=r'^(?=.{3,24}$)[^0-9][A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + if code_signing_account is not None: + body_content = self._serialize.body(code_signing_account, 'CodeSigningAccount') + else: + body_content = None + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('CodeSigningAccount', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('CodeSigningAccount', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSigningAccounts/{accountName}'} # type: ignore + + def begin_create( + self, + resource_group_name, # type: str + account_name, # type: str + code_signing_account=None, # type: Optional["models.CodeSigningAccount"] + **kwargs # type: Any + ): + # type: (...) -> LROPoller["models.CodeSigningAccount"] + """Create a Code Signing Account. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param account_name: Code Signing account name. + :type account_name: str + :param code_signing_account: Parameters to create the code signing account. + :type code_signing_account: ~azure.mgmt.codesigning.models.CodeSigningAccount + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either CodeSigningAccount or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.codesigning.models.CodeSigningAccount] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.CodeSigningAccount"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_initial( + resource_group_name=resource_group_name, + account_name=account_name, + code_signing_account=code_signing_account, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('CodeSigningAccount', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', pattern=r'^(?=.{3,24}$)[^0-9][A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSigningAccounts/{accountName}'} # type: ignore + + def update( + self, + resource_group_name, # type: str + account_name, # type: str + code_signing_account_patch, # type: "models.CodeSigningAccountPatch" + **kwargs # type: Any + ): + # type: (...) -> "models.CodeSigningAccount" + """Update a code signing account. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param account_name: Code Signing account name. + :type account_name: str + :param code_signing_account_patch: Parameters supplied to update code signing account. + :type code_signing_account_patch: ~azure.mgmt.codesigning.models.CodeSigningAccountPatch + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CodeSigningAccount, or the result of cls(response) + :rtype: ~azure.mgmt.codesigning.models.CodeSigningAccount + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.CodeSigningAccount"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-14-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', pattern=r'^(?=.{3,24}$)[^0-9][A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(code_signing_account_patch, 'CodeSigningAccountPatch') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CodeSigningAccount', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSigningAccounts/{accountName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + account_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.CodeSigningAccount" + """Get a Code Signing Account. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param account_name: Code Signing account name. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CodeSigningAccount, or the result of cls(response) + :rtype: ~azure.mgmt.codesigning.models.CodeSigningAccount + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.CodeSigningAccount"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-14-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', pattern=r'^(?=.{3,24}$)[^0-9][A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CodeSigningAccount', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSigningAccounts/{accountName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + account_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-14-preview" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', pattern=r'^(?=.{3,24}$)[^0-9][A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSigningAccounts/{accountName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + account_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Delete Code Signing Account. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param account_name: Code Signing account name. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + account_name=account_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', pattern=r'^(?=.{3,24}$)[^0-9][A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSigningAccounts/{accountName}'} # type: ignore + + def list_by_subscription( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.CodeSigningAccounts"] + """Lists Code Signing Accounts within a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either CodeSigningAccounts or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.codesigning.models.CodeSigningAccounts] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.CodeSigningAccounts"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-14-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_subscription.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('CodeSigningAccounts', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.CodeSigning/codeSigningAccounts'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.CodeSigningAccounts"] + """List Code Signing Accounts within a resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either CodeSigningAccounts or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.codesigning.models.CodeSigningAccounts] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.CodeSigningAccounts"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-14-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('CodeSigningAccounts', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSigningAccounts'} # type: ignore diff --git a/src/codesigning/azext_codesigning/vendored_sdks/codesigning/operations/_operations.py b/src/codesigning/azext_codesigning/vendored_sdks/codesigning/operations/_operations.py index b90baf816fe..e8764ea193c 100644 --- a/src/codesigning/azext_codesigning/vendored_sdks/codesigning/operations/_operations.py +++ b/src/codesigning/azext_codesigning/vendored_sdks/codesigning/operations/_operations.py @@ -45,7 +45,7 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config - def get( + def list( self, **kwargs # type: Any ): @@ -72,7 +72,7 @@ def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.get.metadata['url'] # type: ignore + url = self.list.metadata['url'] # type: ignore # Construct parameters query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') @@ -107,4 +107,4 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - get.metadata = {'url': '/providers/Microsoft.CodeSigning/operations'} # type: ignore + list.metadata = {'url': '/providers/Microsoft.CodeSigning/operations'} # type: ignore diff --git a/src/codesigning/azext_codesigning/vendored_sdks/codesigning/setup.py b/src/codesigning/azext_codesigning/vendored_sdks/codesigning/setup.py new file mode 100644 index 00000000000..194d2e34a08 --- /dev/null +++ b/src/codesigning/azext_codesigning/vendored_sdks/codesigning/setup.py @@ -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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# coding: utf-8 + +from setuptools import setup, find_packages + +NAME = "azure-mgmt-codesigning" +VERSION = "0.1.0" + +# To install the library, run the following +# +# python setup.py install +# +# prerequisite: setuptools +# http://pypi.python.org/pypi/setuptools + +REQUIRES = ["msrest>=0.6.18", "azure-core<2.0.0,>=1.8.2", "azure-mgmt-core<2.0.0,>=1.2.1"] + +setup( + name=NAME, + version=VERSION, + description="azure-mgmt-codesigning", + author_email="", + url="", + keywords=["Swagger", "CodeSigningManagementClient"], + install_requires=REQUIRES, + packages=find_packages(), + include_package_data=True, + long_description="""\ + Code Signing Resource Provider Account and Certificate Profile management API. + """ +) diff --git a/src/codesigning/report.md b/src/codesigning/report.md index d722fc43dce..81cc8732271 100644 --- a/src/codesigning/report.md +++ b/src/codesigning/report.md @@ -9,118 +9,111 @@ ### Command groups in `az codesigning` extension |CLI Command Group|Group Swagger name|Commands| |---------|------------|--------| -|az codesigning|CodeSignAccount|[commands](#CommandsInCodeSignAccount)| +|az codesigning|CodeSigningAccount|[commands](#CommandsInCodeSigningAccount)| |az codesigning certificate-profile|CertificateProfile|[commands](#CommandsInCertificateProfile)| -|az codesigning operation|Operations|[commands](#CommandsInOperations)| ## COMMANDS -### Commands in `az codesigning` group +### Commands in `az codesigning` group |CLI Command|Operation Swagger name|Parameters|Examples| |---------|------------|--------|-----------| -|[az codesigning list](#CodeSignAccountListByResourceGroup)|ListByResourceGroup|[Parameters](#ParametersCodeSignAccountListByResourceGroup)|[Example](#ExamplesCodeSignAccountListByResourceGroup)| -|[az codesigning list](#CodeSignAccountListBySubscription)|ListBySubscription|[Parameters](#ParametersCodeSignAccountListBySubscription)|[Example](#ExamplesCodeSignAccountListBySubscription)| -|[az codesigning show](#CodeSignAccountGet)|Get|[Parameters](#ParametersCodeSignAccountGet)|[Example](#ExamplesCodeSignAccountGet)| -|[az codesigning create](#CodeSignAccountCreate)|Create|[Parameters](#ParametersCodeSignAccountCreate)|[Example](#ExamplesCodeSignAccountCreate)| -|[az codesigning update](#CodeSignAccountUpdate)|Update|[Parameters](#ParametersCodeSignAccountUpdate)|[Example](#ExamplesCodeSignAccountUpdate)| -|[az codesigning delete](#CodeSignAccountDelete)|Delete|[Parameters](#ParametersCodeSignAccountDelete)|[Example](#ExamplesCodeSignAccountDelete)| +|[az codesigning list](#CodeSigningAccountListByResourceGroup)|ListByResourceGroup|[Parameters](#ParametersCodeSigningAccountListByResourceGroup)|[Example](#ExamplesCodeSigningAccountListByResourceGroup)| +|[az codesigning list](#CodeSigningAccountListBySubscription)|ListBySubscription|[Parameters](#ParametersCodeSigningAccountListBySubscription)|[Example](#ExamplesCodeSigningAccountListBySubscription)| +|[az codesigning show](#CodeSigningAccountGet)|Get|[Parameters](#ParametersCodeSigningAccountGet)|[Example](#ExamplesCodeSigningAccountGet)| +|[az codesigning create](#CodeSigningAccountCreate)|Create|[Parameters](#ParametersCodeSigningAccountCreate)|[Example](#ExamplesCodeSigningAccountCreate)| +|[az codesigning update](#CodeSigningAccountUpdate)|Update|[Parameters](#ParametersCodeSigningAccountUpdate)|[Example](#ExamplesCodeSigningAccountUpdate)| +|[az codesigning delete](#CodeSigningAccountDelete)|Delete|[Parameters](#ParametersCodeSigningAccountDelete)|[Example](#ExamplesCodeSigningAccountDelete)| ### Commands in `az codesigning certificate-profile` group |CLI Command|Operation Swagger name|Parameters|Examples| |---------|------------|--------|-----------| -|[az codesigning certificate-profile list](#CertificateProfileListByCodeSignAccount)|ListByCodeSignAccount|[Parameters](#ParametersCertificateProfileListByCodeSignAccount)|[Example](#ExamplesCertificateProfileListByCodeSignAccount)| +|[az codesigning certificate-profile list](#CertificateProfileListByCodeSigningAccount)|ListByCodeSigningAccount|[Parameters](#ParametersCertificateProfileListByCodeSigningAccount)|[Example](#ExamplesCertificateProfileListByCodeSigningAccount)| |[az codesigning certificate-profile show](#CertificateProfileGet)|Get|[Parameters](#ParametersCertificateProfileGet)|[Example](#ExamplesCertificateProfileGet)| |[az codesigning certificate-profile create](#CertificateProfileCreate)|Create|[Parameters](#ParametersCertificateProfileCreate)|[Example](#ExamplesCertificateProfileCreate)| -|[az codesigning certificate-profile update](#CertificateProfileUpdate)|Update|[Parameters](#ParametersCertificateProfileUpdate)|[Example](#ExamplesCertificateProfileUpdate)| |[az codesigning certificate-profile delete](#CertificateProfileDelete)|Delete|[Parameters](#ParametersCertificateProfileDelete)|[Example](#ExamplesCertificateProfileDelete)| -### Commands in `az codesigning operation` group -|CLI Command|Operation Swagger name|Parameters|Examples| -|---------|------------|--------|-----------| -|[az codesigning operation show](#OperationsGet)|Get|[Parameters](#ParametersOperationsGet)|[Example](#ExamplesOperationsGet)| - ## COMMAND DETAILS ### group `az codesigning` -#### Command `az codesigning list` +#### Command `az codesigning list` -##### Example +##### Example ``` az codesigning list --resource-group "MyResourceGroup" ``` -##### Parameters +##### Parameters |Option|Type|Description|Path (SDK)|Swagger name| |------|----|-----------|----------|------------| |**--resource-group-name**|string|The name of the resource group. The name is case insensitive.|resource_group_name|resourceGroupName| -#### Command `az codesigning list` +#### Command `az codesigning list` -##### Example +##### Example ``` az codesigning list ``` -##### Parameters +##### Parameters |Option|Type|Description|Path (SDK)|Swagger name| |------|----|-----------|----------|------------| -#### Command `az codesigning show` +#### Command `az codesigning show` -##### Example +##### Example ``` -az codesigning show --account-name "MyAccount" --resource-group "MyResourceGroup" +az codesigning show --name "MyAccount" --resource-group "MyResourceGroup" ``` -##### Parameters +##### Parameters |Option|Type|Description|Path (SDK)|Swagger name| |------|----|-----------|----------|------------| |**--resource-group-name**|string|The name of the resource group. The name is case insensitive.|resource_group_name|resourceGroupName| -|**--account-name**|string|Code Signing account name|account_name|accountName| +|**--name**|string|Code Signing account name|name|accountName| -#### Command `az codesigning create` +#### Command `az codesigning create` -##### Example +##### Example ``` -az codesigning create --account-name "MyAccount" --location "eastus" --resource-group "MyResourceGroup" +az codesigning create --name "MyAccount" --location "eastus" --resource-group "MyResourceGroup" ``` -##### Parameters +##### Parameters |Option|Type|Description|Path (SDK)|Swagger name| |------|----|-----------|----------|------------| |**--resource-group-name**|string|The name of the resource group. The name is case insensitive.|resource_group_name|resourceGroupName| -|**--account-name**|string|Code Signing account name|account_name|accountName| +|**--name**|string|Code Signing account name|name|accountName| |**--tags**|dictionary|Resource tags.|tags|tags| |**--location**|string|The geo-location where the resource lives|location|location| -#### Command `az codesigning update` +#### Command `az codesigning update` -##### Example +##### Example ``` -az codesigning update --tags key1="value1" --account-name "MyAccount" --resource-group "MyResourceGroup" +az codesigning update --name "MyAccount" --tags key1="value1" --resource-group "MyResourceGroup" ``` -##### Parameters +##### Parameters |Option|Type|Description|Path (SDK)|Swagger name| |------|----|-----------|----------|------------| |**--resource-group-name**|string|The name of the resource group. The name is case insensitive.|resource_group_name|resourceGroupName| -|**--account-name**|string|Code Signing account name|account_name|accountName| +|**--name**|string|Code Signing account name|name|accountName| |**--tags**|dictionary|Resource tags.|tags|tags| -#### Command `az codesigning delete` +#### Command `az codesigning delete` -##### Example +##### Example ``` -az codesigning delete --account-name "MyAccount" --resource-group "MyResourceGroup" +az codesigning delete --name "MyAccount" --resource-group "MyResourceGroup" ``` -##### Parameters +##### Parameters |Option|Type|Description|Path (SDK)|Swagger name| |------|----|-----------|----------|------------| |**--resource-group-name**|string|The name of the resource group. The name is case insensitive.|resource_group_name|resourceGroupName| -|**--account-name**|string|Code Signing account name|account_name|accountName| +|**--name**|string|Code Signing account name|name|accountName| ### group `az codesigning certificate-profile` -#### Command `az codesigning certificate-profile list` +#### Command `az codesigning certificate-profile list` -##### Example +##### Example ``` az codesigning certificate-profile list --account-name "MyAccount" --resource-group "MyResourceGroup" ``` -##### Parameters +##### Parameters |Option|Type|Description|Path (SDK)|Swagger name| |------|----|-----------|----------|------------| |**--resource-group-name**|string|The name of the resource group. The name is case insensitive.|resource_group_name|resourceGroupName| @@ -130,7 +123,7 @@ az codesigning certificate-profile list --account-name "MyAccount" --resource-gr ##### Example ``` -az codesigning certificate-profile show --account-name "MyAccount" --profile-name "profileA" --resource-group \ +az codesigning certificate-profile show --account-name "MyAccount" --name "profileA" --resource-group \ "MyResourceGroup" ``` ##### Parameters @@ -138,49 +131,29 @@ az codesigning certificate-profile show --account-name "MyAccount" --profile-nam |------|----|-----------|----------|------------| |**--resource-group-name**|string|The name of the resource group. The name is case insensitive.|resource_group_name|resourceGroupName| |**--account-name**|string|Code Signing account name|account_name|accountName| -|**--profile-name**|string|Certificate profile name|profile_name|profileName| +|**--name**|string|Certificate profile name|name|profileName| #### Command `az codesigning certificate-profile create` ##### Example ``` -az codesigning certificate-profile create --account-name "MyAccount" --profile-name "profileA" --common-name "Contoso" \ ---profile-type "PublicTrust" --subject-alternative-name "Contoso Corporate Engineering" --resource-group \ -"MyResourceGroup" +az codesigning certificate-profile create --account-name "MyAccount" --common-name "Contoso Inc" --organization \ +"Contoso Inc" --name "profileA" --resource-group "MyResourceGroup" ``` ##### Parameters |Option|Type|Description|Path (SDK)|Swagger name| |------|----|-----------|----------|------------| |**--resource-group-name**|string|The name of the resource group. The name is case insensitive.|resource_group_name|resourceGroupName| |**--account-name**|string|Code Signing account name|account_name|accountName| -|**--profile-name**|string|Certificate profile name|profile_name|profileName| -|**--profile-type**|choice|Profile type of the certificate|profile_type|profileType| -|**--common-name**|string|Name of the certificate|common_name|commonName| -|**--subject-alternative-name**|string|Subject Alternative Name of the certificate|subject_alternative_name|subjectAlternativeName| - -#### Command `az codesigning certificate-profile update` - -##### Example -``` -az codesigning certificate-profile update --common-name "Contoso" --profile-type "Test" --subject-alternative-name \ -"Contoso Corporate Engineering" --account-name "MyAccount" --profile-name "profileA" --resource-group \ -"MyResourceGroup" -``` -##### Parameters -|Option|Type|Description|Path (SDK)|Swagger name| -|------|----|-----------|----------|------------| -|**--resource-group-name**|string|The name of the resource group. The name is case insensitive.|resource_group_name|resourceGroupName| -|**--account-name**|string|Code Signing account name|account_name|accountName| -|**--profile-name**|string|Certificate profile name|profile_name|profileName| -|**--profile-type**|choice|Profile type of the certificate|profile_type|profileType| -|**--common-name**|string|Name of the certificate|common_name|commonName| -|**--subject-alternative-name**|string|Subject Alternative Name of the certificate|subject_alternative_name|subjectAlternativeName| +|**--name**|string|Certificate profile name|name|profileName| +|**--common-name**|string|Used as CN in the subject name of the certificate|common_name|commonName| +|**--organization**|string|Used as O in the subject name of the certificate|organization|organization| #### Command `az codesigning certificate-profile delete` ##### Example ``` -az codesigning certificate-profile delete --account-name "MyAccount" --profile-name "profileA" --resource-group \ +az codesigning certificate-profile delete --account-name "MyAccount" --name "profileA" --resource-group \ "MyResourceGroup" ``` ##### Parameters @@ -188,15 +161,4 @@ az codesigning certificate-profile delete --account-name "MyAccount" --profile-n |------|----|-----------|----------|------------| |**--resource-group-name**|string|The name of the resource group. The name is case insensitive.|resource_group_name|resourceGroupName| |**--account-name**|string|Code Signing account name|account_name|accountName| -|**--profile-name**|string|Certificate profile name|profile_name|profileName| - -### group `az codesigning operation` -#### Command `az codesigning operation show` - -##### Example -``` -az codesigning operation show -``` -##### Parameters -|Option|Type|Description|Path (SDK)|Swagger name| -|------|----|-----------|----------|------------| \ No newline at end of file +|**--name**|string|Certificate profile name|name|profileName|