diff --git a/src/plugins/azgenerator/TemplateAzureCliParams.ts b/src/plugins/azgenerator/TemplateAzureCliParams.ts index 63d55af9..eb6208dd 100644 --- a/src/plugins/azgenerator/TemplateAzureCliParams.ts +++ b/src/plugins/azgenerator/TemplateAzureCliParams.ts @@ -26,7 +26,8 @@ export function GenerateAzureCliParams(model: CodeModelAz, debug: boolean): stri output_args.push(""); output_args.push(""); output_args.push("def load_arguments(self, _):"); - + let hasCommandParamContent = false; + let header: HeaderGenerator = new HeaderGenerator(); if (model.SelectFirstCommandGroup()) { do { //let methods: string[] = model.CommandGroup_Commands; @@ -41,7 +42,10 @@ export function GenerateAzureCliParams(model: CodeModelAz, debug: boolean): stri let command_output = getCommandBody(model, needGeneric, debug); if (model.Command_MethodName == "show") { show_output = command_output - } + } + if (command_output.length > 0) { + hasCommandParamContent = true; + } output_args = output_args.concat(command_output); } @@ -53,10 +57,14 @@ export function GenerateAzureCliParams(model: CodeModelAz, debug: boolean): stri } } while (model.SelectNextCommandGroup()); } + if (!hasCommandParamContent) { + output_args.push(" pass"); + header.disableUnusedArgument = true; + } else { + header.disableTooManyLines = true; + header.disableTooManyStatements = true; + } - let header: HeaderGenerator = new HeaderGenerator(); - header.disableTooManyLines = true; - header.disableTooManyStatements = true; let parameterImports: string[] = []; if (hasTags) parameterImports.push("tags_type"); @@ -64,8 +72,10 @@ export function GenerateAzureCliParams(model: CodeModelAz, debug: boolean): stri if (hasEnum) parameterImports.push("get_enum_type"); if (hasResourceGroup) parameterImports.push("resource_group_name_type"); if (hasLocation) parameterImports.push("get_location_type"); - - header.addFromImport(model.CliCoreLib + ".commands.parameters", parameterImports); + if (parameterImports.length > 0) { + header.addFromImport(model.CliCoreLib + ".commands.parameters", parameterImports); + } + let validatorImports: string[] = []; if (hasLocationValidator) { validatorImports.push("get_default_location_from_resource_group"); @@ -87,6 +97,7 @@ export function GenerateAzureCliParams(model: CodeModelAz, debug: boolean): stri output = output.concat(output_args); output.push(""); + output.forEach(element => { if (element.length > 120) header.disableLineTooLong = true; @@ -343,7 +354,7 @@ function getCommandBody(model: CodeModelAz, needGeneric: boolean = false, debug: } if (!hasParam) { - output_args.push(" pass"); + return []; } diff --git a/src/test/scenario-test.ts b/src/test/scenario-test.ts index ad659b56..cfaa9600 100644 --- a/src/test/scenario-test.ts +++ b/src/test/scenario-test.ts @@ -49,7 +49,7 @@ require('source-map-support').install(); let msg = ""; let finalResult = true; for (const each of folders) { - if (each != 'testserver') { + if (each != "testserver") { console.log(`Processing: ${each}`); try { await this.runAz(dir + each, each).then(res => { diff --git a/src/test/scenarios/attestation/output/src/attestation/azext_attestation/generated/_params.py b/src/test/scenarios/attestation/output/src/attestation/azext_attestation/generated/_params.py index 1d7d1f4d..c1e7e454 100644 --- a/src/test/scenarios/attestation/output/src/attestation/azext_attestation/generated/_params.py +++ b/src/test/scenarios/attestation/output/src/attestation/azext_attestation/generated/_params.py @@ -33,9 +33,6 @@ def load_arguments(self, _): 'within the array does not imply an order of preference among them, although applications of JWK ' 'Sets can choose to assign a meaning to the order for their purposes, if desired.') - with self.argument_context('attestation list-operation') as c: - pass - with self.argument_context('attestation attestation-provider provider list') as c: c.argument('resource_group_name', resource_group_name_type) diff --git a/src/test/scenarios/boolean/configuration/readme.az.md b/src/test/scenarios/boolean/configuration/readme.az.md new file mode 100644 index 00000000..30cd32c4 --- /dev/null +++ b/src/test/scenarios/boolean/configuration/readme.az.md @@ -0,0 +1,16 @@ +## CLI + +These settings apply only when `--az` is specified on the command line. + +``` yaml $(az) +az: + extensions: boolean + package-name: azure-mgmt-boolean + namespace: azure.mgmt.boolean + client-subscription-bound: false + client-base-url-bound: false + client-authentication-policy: SansIOHTTPPolicy +az-output-folder: $(azure-cli-extension-folder)/src/boolean +python-sdk-output-folder: "$(az-output-folder)/azext_boolean/vendored_sdks/boolean" + +``` diff --git a/src/test/scenarios/boolean/configuration/readme.cli.md b/src/test/scenarios/boolean/configuration/readme.cli.md new file mode 100644 index 00000000..a9e918ee --- /dev/null +++ b/src/test/scenarios/boolean/configuration/readme.cli.md @@ -0,0 +1,9 @@ + CLI + +These settings apply only when `--cli` is specified on the command line. + +``` yaml $(cli) +#cli: +# test-scenario: +# - name: Factories_CreateOrUpdate +``` diff --git a/src/test/scenarios/boolean/configuration/readme.md b/src/test/scenarios/boolean/configuration/readme.md new file mode 100644 index 00000000..4eb90db4 --- /dev/null +++ b/src/test/scenarios/boolean/configuration/readme.md @@ -0,0 +1,60 @@ +# Managed Network + +> see https://aka.ms/autorest + +This is the AutoRest configuration file for Managed Network. + + + +--- +## Getting Started +To build the SDK for Managed Network, simply [Install AutoRest](https://aka.ms/autorest/install) and in this folder, run: + +> `autorest` + +To see additional help and options, run: + +> `autorest --help` +--- + +## Configuration + + + +### Basic Information +These are the global settings for the Managed Network API. + +``` yaml +openapi-type: arm +tag: testserver-local +override-info: + title: AutoRest Test Service + description: Test Infrastructure for AutoRest. +``` + +### Tag: testserver-local + +These settings apply only when `--tag=testserver-local` is specified on the command line. + +``` yaml $(tag) == 'testserver-local' +input-file: +- ../input/body-boolean.json +``` + +# Code Generation + + +## Swagger to SDK + +This section describes what SDK should be generated by the automatic system. +This is not used by Autorest itself. + +``` yaml $(swagger-to-sdk) +swagger-to-sdk: + - repo: azure-sdk-for-python +``` + + +## CLI + +See configuration in [readme.cli.md](./readme.cli.md) diff --git a/src/test/scenarios/boolean/configuration/readme.python.md b/src/test/scenarios/boolean/configuration/readme.python.md new file mode 100644 index 00000000..272fea80 --- /dev/null +++ b/src/test/scenarios/boolean/configuration/readme.python.md @@ -0,0 +1,26 @@ +## Python + +These settings apply only when `--python` is specified on the command line. +Please also specify `--python-sdks-folder=`. +Use `--python-mode=update` if you already have a setup.py and just want to update the code itself. + +``` yaml $(python) +python: + azure-arm: true + license-header: MICROSOFT_MIT_NO_VERSION + payload-flattening-threshold: 2 + namespace: azure.mgmt.boolean + package-name: azure-mgmt-boolean + package-version: 0.1.0 + clear-output-folder: true +``` +``` yaml $(python) && $(python-mode) == 'update' +python: + no-namespace-folders: true + output-folder: $(python-sdks-folder)/boolean/azure-mgmt-boolean/azure/mgmt/boolean +``` +``` yaml $(python) && $(python-mode) == 'create' +python: + basic-setup-py: true + output-folder: $(python-sdks-folder)/boolean/azure-mgmt-boolean +``` diff --git a/src/test/scenarios/boolean/input/body-boolean.json b/src/test/scenarios/boolean/input/body-boolean.json new file mode 100644 index 00000000..c2a515d9 --- /dev/null +++ b/src/test/scenarios/boolean/input/body-boolean.json @@ -0,0 +1,208 @@ +{ + "swagger": "2.0", + "info": { + "title": "AutoRest Bool Test Service", + "description": "Test Infrastructure for AutoRest", + "version": "1.0.0" + }, + "host": "localhost:3000", + "schemes": [ + "http" + ], + "produces": [ "application/json"], + "consumes": [ "application/json"], + "paths": { + "/bool/true": { + "get": { + "operationId": "bool_getTrue", + "description": "Get true Boolean value", + "x-ms-examples": { + "bool_getTrue": { + "$ref": "./examples/bool_getTrue.json" + } + }, + "tags": [ + "Bool Operations" + ], + "responses": { + "200": { + "description": "The true Boolean value", + "schema": { + "type": "boolean", + "enum": [true] + } + }, + "default": { + "description": "Unexpected error", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + }, + "put": { + "operationId": "bool_putTrue", + "description": "Set Boolean value true", + "x-ms-examples": { + "bool_putTrue": { + "$ref": "./examples/bool_putTrue.json" + } + }, + "parameters": [ + { + "name": "boolBody", + "in": "body", + "schema" : { + "type": "boolean", + "enum": [true] + }, + "required": true + } + ], + "tags": [ + "Bool Operations" + ], + "responses": { + "200": { + "description": "Empty Response" + }, + "default": { + "description": "Unexpected error", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + } + }, + "/bool/false": { + "get": { + "operationId": "bool_getFalse", + "description": "Get false Boolean value", + "x-ms-examples": { + "bool_getFalse": { + "$ref": "./examples/bool_getFalse.json" + } + }, + "tags": [ + "Bool Operations" + ], + "responses": { + "200": { + "description": "The false Boolean value", + "schema": { + "type": "boolean", + "enum": [false] + } + }, + "default": { + "description": "Unexpected error", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + }, + "put": { + "operationId": "bool_putFalse", + "description": "Set Boolean value false", + "x-ms-examples": { + "bool_putFalse": { + "$ref": "./examples/bool_putFalse.json" + } + }, + "parameters": [ + { + "name": "boolBody", + "in": "body", + "schema" : { + "type": "boolean", + "enum": [false] + }, + "required": true + } + ], + "tags": [ + "Bool Operations" + ], + "responses": { + "200": { + "description": "Empty Response" + }, + "default": { + "description": "Unexpected error", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + } + }, + "/bool/null": { + "get": { + "operationId": "bool_getNull", + "description": "Get null Boolean value", + "x-ms-examples": { + "bool_getNull": { + "$ref": "./examples/bool_getNull.json" + } + }, + "tags": [ + "Bool Operations" + ], + "responses": { + "200": { + "description": "The null Boolean value", + "schema": { + "type": "boolean", + "x-nullable": true + } + }, + "default": { + "description": "Unexpected error", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + } + }, + "/bool/invalid": { + "get": { + "operationId": "bool_getInvalid", + "description": "Get invalid Boolean value", + "tags": [ + "Bool Operations" + ], + "responses": { + "200": { + "description": "The invalid Boolean value", + "schema": { + "type": "boolean" + } + }, + "default": { + "description": "Unexpected error", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + } + } + }, + "definitions": { + "Error": { + "type": "object", + "properties": { + "status": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + } + } + } + } +} diff --git a/src/test/scenarios/boolean/output/src/boolean/HISTORY.rst b/src/test/scenarios/boolean/output/src/boolean/HISTORY.rst new file mode 100644 index 00000000..1c139576 --- /dev/null +++ b/src/test/scenarios/boolean/output/src/boolean/HISTORY.rst @@ -0,0 +1,8 @@ +.. :changelog: + +Release History +=============== + +0.1.0 +++++++ +* Initial release. diff --git a/src/test/scenarios/boolean/output/src/boolean/README.md b/src/test/scenarios/boolean/output/src/boolean/README.md new file mode 100644 index 00000000..9c28e0f1 --- /dev/null +++ b/src/test/scenarios/boolean/output/src/boolean/README.md @@ -0,0 +1,5 @@ +Microsoft Azure CLI 'boolean' Extension +========================================== + +This package is for the 'boolean' extension. +i.e. 'az boolean' diff --git a/src/test/scenarios/boolean/output/src/boolean/azext_boolean/__init__.py b/src/test/scenarios/boolean/output/src/boolean/azext_boolean/__init__.py new file mode 100644 index 00000000..60aa1630 --- /dev/null +++ b/src/test/scenarios/boolean/output/src/boolean/azext_boolean/__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_boolean.generated._help import helps # pylint: disable=unused-import +try: + from azext_boolean.manual._help import helps # pylint: disable=reimported +except ImportError: + pass + + +class AutoRestTestServiceCommandsLoader(AzCommandsLoader): + + def __init__(self, cli_ctx=None): + from azure.cli.core.commands import CliCommandType + from azext_boolean.generated._client_factory import cf_boolean_cl + boolean_custom = CliCommandType( + operations_tmpl='azext_boolean.custom#{}', + client_factory=cf_boolean_cl) + parent = super(AutoRestTestServiceCommandsLoader, self) + parent.__init__(cli_ctx=cli_ctx, custom_command_type=boolean_custom) + + def load_command_table(self, args): + from azext_boolean.generated.commands import load_command_table + load_command_table(self, args) + try: + from azext_boolean.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_boolean.generated._params import load_arguments + load_arguments(self, command) + try: + from azext_boolean.manual._params import load_arguments as load_arguments_manual + load_arguments_manual(self, command) + except ImportError: + pass + + +COMMAND_LOADER_CLS = AutoRestTestServiceCommandsLoader diff --git a/src/test/scenarios/boolean/output/src/boolean/azext_boolean/action.py b/src/test/scenarios/boolean/output/src/boolean/azext_boolean/action.py new file mode 100644 index 00000000..d95d53bf --- /dev/null +++ b/src/test/scenarios/boolean/output/src/boolean/azext_boolean/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/test/scenarios/boolean/output/src/boolean/azext_boolean/azext_metadata.json b/src/test/scenarios/boolean/output/src/boolean/azext_boolean/azext_metadata.json new file mode 100644 index 00000000..13025150 --- /dev/null +++ b/src/test/scenarios/boolean/output/src/boolean/azext_boolean/azext_metadata.json @@ -0,0 +1,4 @@ +{ + "azext.isExperimental": true, + "azext.minCliCoreVersion": "2.3.1" +} \ No newline at end of file diff --git a/src/test/scenarios/boolean/output/src/boolean/azext_boolean/custom.py b/src/test/scenarios/boolean/output/src/boolean/azext_boolean/custom.py new file mode 100644 index 00000000..dbe9d5f9 --- /dev/null +++ b/src/test/scenarios/boolean/output/src/boolean/azext_boolean/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/test/scenarios/boolean/output/src/boolean/azext_boolean/generated/__init__.py b/src/test/scenarios/boolean/output/src/boolean/azext_boolean/generated/__init__.py new file mode 100644 index 00000000..c9cfdc73 --- /dev/null +++ b/src/test/scenarios/boolean/output/src/boolean/azext_boolean/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/test/scenarios/boolean/output/src/boolean/azext_boolean/generated/_client_factory.py b/src/test/scenarios/boolean/output/src/boolean/azext_boolean/generated/_client_factory.py new file mode 100644 index 00000000..9eeca994 --- /dev/null +++ b/src/test/scenarios/boolean/output/src/boolean/azext_boolean/generated/_client_factory.py @@ -0,0 +1,24 @@ +# -------------------------------------------------------------------------- +# 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_boolean_cl(cli_ctx, *_): + from azure.cli.core.commands.client_factory import get_mgmt_service_client + from ..vendored_sdks.boolean import AutoRestTestService + from azure.core.pipeline.policies import SansIOHTTPPolicy + return get_mgmt_service_client(cli_ctx, + AutoRestTestService, + subscription_bound=False, + base_url_bound=False, + authentication_policy=SansIOHTTPPolicy()) + + +def cf_bool(cli_ctx, *_): + return cf_boolean_cl(cli_ctx).bool diff --git a/src/test/scenarios/boolean/output/src/boolean/azext_boolean/generated/_help.py b/src/test/scenarios/boolean/output/src/boolean/azext_boolean/generated/_help.py new file mode 100644 index 00000000..aa8b6729 --- /dev/null +++ b/src/test/scenarios/boolean/output/src/boolean/azext_boolean/generated/_help.py @@ -0,0 +1,48 @@ +# -------------------------------------------------------------------------- +# 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['boolean bool'] = """ + type: group + short-summary: boolean bool +""" + +helps['boolean bool get-false'] = """ + type: command + short-summary: Get false Boolean value +""" + +helps['boolean bool get-invalid'] = """ + type: command + short-summary: Get invalid Boolean value +""" + +helps['boolean bool get-null'] = """ + type: command + short-summary: Get null Boolean value +""" + +helps['boolean bool get-true'] = """ + type: command + short-summary: Get true Boolean value +""" + +helps['boolean bool put-false'] = """ + type: command + short-summary: Set Boolean value false +""" + +helps['boolean bool put-true'] = """ + type: command + short-summary: Set Boolean value true +""" diff --git a/src/test/scenarios/boolean/output/src/boolean/azext_boolean/generated/_params.py b/src/test/scenarios/boolean/output/src/boolean/azext_boolean/generated/_params.py new file mode 100644 index 00000000..632870ee --- /dev/null +++ b/src/test/scenarios/boolean/output/src/boolean/azext_boolean/generated/_params.py @@ -0,0 +1,14 @@ +# -------------------------------------------------------------------------- +# 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=unused-argument + + +def load_arguments(self, _): + pass diff --git a/src/test/scenarios/boolean/output/src/boolean/azext_boolean/generated/_validators.py b/src/test/scenarios/boolean/output/src/boolean/azext_boolean/generated/_validators.py new file mode 100644 index 00000000..b33a44c1 --- /dev/null +++ b/src/test/scenarios/boolean/output/src/boolean/azext_boolean/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/test/scenarios/boolean/output/src/boolean/azext_boolean/generated/action.py b/src/test/scenarios/boolean/output/src/boolean/azext_boolean/generated/action.py new file mode 100644 index 00000000..b49bfaee --- /dev/null +++ b/src/test/scenarios/boolean/output/src/boolean/azext_boolean/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/test/scenarios/boolean/output/src/boolean/azext_boolean/generated/commands.py b/src/test/scenarios/boolean/output/src/boolean/azext_boolean/generated/commands.py new file mode 100644 index 00000000..8526e66b --- /dev/null +++ b/src/test/scenarios/boolean/output/src/boolean/azext_boolean/generated/commands.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. +# -------------------------------------------------------------------------- +# pylint: disable=too-many-statements +# pylint: disable=too-many-locals + +from azure.cli.core.commands import CliCommandType + + +def load_command_table(self, _): + + from azext_boolean.generated._client_factory import cf_bool + boolean_bool = CliCommandType( + operations_tmpl='azext_boolean.vendored_sdks.boolean.operations._bool_operations#BoolOperations.{}', + client_factory=cf_bool) + with self.command_group('boolean bool', boolean_bool, client_factory=cf_bool, is_experimental=True) as g: + g.custom_command('get-false', 'boolean_bool_get_false') + g.custom_command('get-invalid', 'boolean_bool_get_invalid') + g.custom_command('get-null', 'boolean_bool_get_null') + g.custom_command('get-true', 'boolean_bool_get_true') + g.custom_command('put-false', 'boolean_bool_put_false') + g.custom_command('put-true', 'boolean_bool_put_true') diff --git a/src/test/scenarios/boolean/output/src/boolean/azext_boolean/generated/custom.py b/src/test/scenarios/boolean/output/src/boolean/azext_boolean/generated/custom.py new file mode 100644 index 00000000..27a2390d --- /dev/null +++ b/src/test/scenarios/boolean/output/src/boolean/azext_boolean/generated/custom.py @@ -0,0 +1,34 @@ +# -------------------------------------------------------------------------- +# 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 boolean_bool_get_false(client): + return client.get_false() + + +def boolean_bool_get_invalid(client): + return client.get_invalid() + + +def boolean_bool_get_null(client): + return client.get_null() + + +def boolean_bool_get_true(client): + return client.get_true() + + +def boolean_bool_put_false(client): + return client.put_false() + + +def boolean_bool_put_true(client): + return client.put_true() diff --git a/src/test/scenarios/boolean/output/src/boolean/azext_boolean/manual/__init__.py b/src/test/scenarios/boolean/output/src/boolean/azext_boolean/manual/__init__.py new file mode 100644 index 00000000..c9cfdc73 --- /dev/null +++ b/src/test/scenarios/boolean/output/src/boolean/azext_boolean/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/test/scenarios/boolean/output/src/boolean/azext_boolean/tests/__init__.py b/src/test/scenarios/boolean/output/src/boolean/azext_boolean/tests/__init__.py new file mode 100644 index 00000000..9b7ec942 --- /dev/null +++ b/src/test/scenarios/boolean/output/src/boolean/azext_boolean/tests/__init__.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. +# -------------------------------------------------------------------------- +import inspect +import os +import sys +import traceback +from azure.core.exceptions import AzureError +from azure.cli.testsdk.exceptions import CliTestError, CliExecutionError, JMESPathCheckAssertionError + + +__path__ = __import__('pkgutil').extend_path(__path__, __name__) +exceptions = [] + + +def try_manual(func): + def import_manual_function(origin_func): + from importlib import import_module + decorated_path = inspect.getfile(origin_func) + module_path = __path__[0] + 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) + print("Found manual override for {}(...)".format(func.__name__)) + except (ImportError, AttributeError): + pass + return func_to_call + + def wrapper(*args, **kwargs): + func_to_call = get_func_to_call() + print("running {}()...".format(func.__name__)) + try: + return func_to_call(*args, **kwargs) + except (AssertionError, AzureError, CliTestError, CliExecutionError, JMESPathCheckAssertionError) as e: + print("--------------------------------------") + print("step exception: ", e) + print("--------------------------------------", file=sys.stderr) + print("step exception in {}: {}".format(func.__name__, e), file=sys.stderr) + traceback.print_exc() + exceptions.append((func.__name__, sys.exc_info())) + + if inspect.isclass(func): + return get_func_to_call() + return wrapper + + +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/test/scenarios/boolean/output/src/boolean/azext_boolean/tests/latest/__init__.py b/src/test/scenarios/boolean/output/src/boolean/azext_boolean/tests/latest/__init__.py new file mode 100644 index 00000000..c9cfdc73 --- /dev/null +++ b/src/test/scenarios/boolean/output/src/boolean/azext_boolean/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/test/scenarios/boolean/output/src/boolean/azext_boolean/tests/latest/test_boolean_scenario.py b/src/test/scenarios/boolean/output/src/boolean/azext_boolean/tests/latest/test_boolean_scenario.py new file mode 100644 index 00000000..db248090 --- /dev/null +++ b/src/test/scenarios/boolean/output/src/boolean/azext_boolean/tests/latest/test_boolean_scenario.py @@ -0,0 +1,41 @@ +# -------------------------------------------------------------------------- +# 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 .. import try_manual, raise_if + + +TEST_DIR = os.path.abspath(os.path.join(os.path.abspath(__file__), '..')) + + +@try_manual +def setup(test): + pass + + +@try_manual +def cleanup(test): + pass + + +@try_manual +def call_scenario(test): + setup(test) + cleanup(test) + + +@try_manual +class AutoRestTestServiceScenarioTest(ScenarioTest): + + def test_boolean(self): + + call_scenario(self) + raise_if() diff --git a/src/test/scenarios/boolean/output/src/boolean/azext_boolean/vendored_sdks/__init__.py b/src/test/scenarios/boolean/output/src/boolean/azext_boolean/vendored_sdks/__init__.py new file mode 100644 index 00000000..c9cfdc73 --- /dev/null +++ b/src/test/scenarios/boolean/output/src/boolean/azext_boolean/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/test/scenarios/boolean/output/src/boolean/azext_boolean/vendored_sdks/boolean/__init__.py b/src/test/scenarios/boolean/output/src/boolean/azext_boolean/vendored_sdks/boolean/__init__.py new file mode 100644 index 00000000..92580dac --- /dev/null +++ b/src/test/scenarios/boolean/output/src/boolean/azext_boolean/vendored_sdks/boolean/__init__.py @@ -0,0 +1,16 @@ +# 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 ._auto_rest_test_service import AutoRestTestService +__all__ = ['AutoRestTestService'] + +try: + from ._patch import patch_sdk + patch_sdk() +except ImportError: + pass diff --git a/src/test/scenarios/boolean/output/src/boolean/azext_boolean/vendored_sdks/boolean/_auto_rest_test_service.py b/src/test/scenarios/boolean/output/src/boolean/azext_boolean/vendored_sdks/boolean/_auto_rest_test_service.py new file mode 100644 index 00000000..de03df9a --- /dev/null +++ b/src/test/scenarios/boolean/output/src/boolean/azext_boolean/vendored_sdks/boolean/_auto_rest_test_service.py @@ -0,0 +1,66 @@ +# 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 AutoRestTestServiceConfiguration +from .operations import BoolOperations +from . import models + + +class AutoRestTestService(object): + """Test Infrastructure for AutoRest. + + :ivar bool: BoolOperations operations + :vartype bool: auto_rest_test_service.operations.BoolOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials.TokenCredential + :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__( + self, + credential, # type: "TokenCredential" + base_url=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> None + if not base_url: + base_url = 'http://localhost:3000' + self._config = AutoRestTestServiceConfiguration(credential, **kwargs) + self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.bool = BoolOperations( + self._client, self._config, self._serialize, self._deserialize) + + def close(self): + # type: () -> None + self._client.close() + + def __enter__(self): + # type: () -> AutoRestTestService + self._client.__enter__() + return self + + def __exit__(self, *exc_details): + # type: (Any) -> None + self._client.__exit__(*exc_details) diff --git a/src/test/scenarios/boolean/output/src/boolean/azext_boolean/vendored_sdks/boolean/_configuration.py b/src/test/scenarios/boolean/output/src/boolean/azext_boolean/vendored_sdks/boolean/_configuration.py new file mode 100644 index 00000000..56135de9 --- /dev/null +++ b/src/test/scenarios/boolean/output/src/boolean/azext_boolean/vendored_sdks/boolean/_configuration.py @@ -0,0 +1,62 @@ +# 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 + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any + + from azure.core.credentials import TokenCredential + +VERSION = "unknown" + +class AutoRestTestServiceConfiguration(Configuration): + """Configuration for AutoRestTestService. + + 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 + """ + + def __init__( + self, + credential, # type: "TokenCredential" + **kwargs # type: Any + ): + # type: (...) -> None + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + super(AutoRestTestServiceConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.credential_scopes = ['https://management.azure.com/.default'] + self.credential_scopes.extend(kwargs.pop('credential_scopes', [])) + kwargs.setdefault('sdk_moniker', 'autoresttestservice/{}'.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.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/test/scenarios/boolean/output/src/boolean/azext_boolean/vendored_sdks/boolean/aio/__init__.py b/src/test/scenarios/boolean/output/src/boolean/azext_boolean/vendored_sdks/boolean/aio/__init__.py new file mode 100644 index 00000000..d4c0187b --- /dev/null +++ b/src/test/scenarios/boolean/output/src/boolean/azext_boolean/vendored_sdks/boolean/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 ._auto_rest_test_service_async import AutoRestTestService +__all__ = ['AutoRestTestService'] diff --git a/src/test/scenarios/boolean/output/src/boolean/azext_boolean/vendored_sdks/boolean/aio/_auto_rest_test_service_async.py b/src/test/scenarios/boolean/output/src/boolean/azext_boolean/vendored_sdks/boolean/aio/_auto_rest_test_service_async.py new file mode 100644 index 00000000..381b7694 --- /dev/null +++ b/src/test/scenarios/boolean/output/src/boolean/azext_boolean/vendored_sdks/boolean/aio/_auto_rest_test_service_async.py @@ -0,0 +1,60 @@ +# 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_async import AutoRestTestServiceConfiguration +from .operations_async import BoolOperations +from .. import models + + +class AutoRestTestService(object): + """Test Infrastructure for AutoRest. + + :ivar bool: BoolOperations operations + :vartype bool: auto_rest_test_service.aio.operations_async.BoolOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :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__( + self, + credential: "AsyncTokenCredential", + base_url: Optional[str] = None, + **kwargs: Any + ) -> None: + if not base_url: + base_url = 'http://localhost:3000' + self._config = AutoRestTestServiceConfiguration(credential, **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._deserialize = Deserializer(client_models) + + self.bool = BoolOperations( + self._client, self._config, self._serialize, self._deserialize) + + async def close(self) -> None: + await self._client.close() + + async def __aenter__(self) -> "AutoRestTestService": + await self._client.__aenter__() + return self + + async def __aexit__(self, *exc_details) -> None: + await self._client.__aexit__(*exc_details) diff --git a/src/test/scenarios/boolean/output/src/boolean/azext_boolean/vendored_sdks/boolean/aio/_configuration_async.py b/src/test/scenarios/boolean/output/src/boolean/azext_boolean/vendored_sdks/boolean/aio/_configuration_async.py new file mode 100644 index 00000000..c718e120 --- /dev/null +++ b/src/test/scenarios/boolean/output/src/boolean/azext_boolean/vendored_sdks/boolean/aio/_configuration_async.py @@ -0,0 +1,58 @@ +# 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 + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +VERSION = "unknown" + +class AutoRestTestServiceConfiguration(Configuration): + """Configuration for AutoRestTestService. + + 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 + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + **kwargs: Any + ) -> None: + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + super(AutoRestTestServiceConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.credential_scopes = ['https://management.azure.com/.default'] + self.credential_scopes.extend(kwargs.pop('credential_scopes', [])) + kwargs.setdefault('sdk_moniker', 'autoresttestservice/{}'.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.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/test/scenarios/boolean/output/src/boolean/azext_boolean/vendored_sdks/boolean/aio/operations_async/__init__.py b/src/test/scenarios/boolean/output/src/boolean/azext_boolean/vendored_sdks/boolean/aio/operations_async/__init__.py new file mode 100644 index 00000000..b6a09563 --- /dev/null +++ b/src/test/scenarios/boolean/output/src/boolean/azext_boolean/vendored_sdks/boolean/aio/operations_async/__init__.py @@ -0,0 +1,13 @@ +# 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 ._bool_operations_async import BoolOperations + +__all__ = [ + 'BoolOperations', +] diff --git a/src/test/scenarios/boolean/output/src/boolean/azext_boolean/vendored_sdks/boolean/aio/operations_async/_bool_operations_async.py b/src/test/scenarios/boolean/output/src/boolean/azext_boolean/vendored_sdks/boolean/aio/operations_async/_bool_operations_async.py new file mode 100644 index 00000000..6f5b1d34 --- /dev/null +++ b/src/test/scenarios/boolean/output/src/boolean/azext_boolean/vendored_sdks/boolean/aio/operations_async/_bool_operations_async.py @@ -0,0 +1,305 @@ +# 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, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import 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 BoolOperations: + """BoolOperations 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: ~auto_rest_test_service.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 get_true( + self, + **kwargs + ) -> bool: + """Get true Boolean value. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: bool, or the result of cls(response) + :rtype: bool + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[bool] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_true.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + 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.Error, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('bool', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_true.metadata = {'url': '/bool/true'} # type: ignore + + async def put_true( + self, + **kwargs + ) -> None: + """Set Boolean value true. + + :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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + content_type = kwargs.pop("content_type", "application/json") + bool_body = True + + # Construct URL + url = self.put_true.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(bool_body, 'bool') + 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.Error, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + put_true.metadata = {'url': '/bool/true'} # type: ignore + + async def get_false( + self, + **kwargs + ) -> bool: + """Get false Boolean value. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: bool, or the result of cls(response) + :rtype: bool + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[bool] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_false.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + 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.Error, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('bool', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_false.metadata = {'url': '/bool/false'} # type: ignore + + async def put_false( + self, + **kwargs + ) -> None: + """Set Boolean value false. + + :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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + content_type = kwargs.pop("content_type", "application/json") + bool_body = False + + # Construct URL + url = self.put_false.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(bool_body, 'bool') + 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.Error, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + put_false.metadata = {'url': '/bool/false'} # type: ignore + + async def get_null( + self, + **kwargs + ) -> bool: + """Get null Boolean value. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: bool, or the result of cls(response) + :rtype: bool + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[bool] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_null.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + 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.Error, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('bool', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_null.metadata = {'url': '/bool/null'} # type: ignore + + async def get_invalid( + self, + **kwargs + ) -> bool: + """Get invalid Boolean value. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: bool, or the result of cls(response) + :rtype: bool + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[bool] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_invalid.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + 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.Error, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('bool', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_invalid.metadata = {'url': '/bool/invalid'} # type: ignore diff --git a/src/test/scenarios/boolean/output/src/boolean/azext_boolean/vendored_sdks/boolean/models/__init__.py b/src/test/scenarios/boolean/output/src/boolean/azext_boolean/vendored_sdks/boolean/models/__init__.py new file mode 100644 index 00000000..9c7dad4f --- /dev/null +++ b/src/test/scenarios/boolean/output/src/boolean/azext_boolean/vendored_sdks/boolean/models/__init__.py @@ -0,0 +1,16 @@ +# 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 Error +except (SyntaxError, ImportError): + from ._models import Error # type: ignore + +__all__ = [ + 'Error', +] diff --git a/src/test/scenarios/boolean/output/src/boolean/azext_boolean/vendored_sdks/boolean/models/_models.py b/src/test/scenarios/boolean/output/src/boolean/azext_boolean/vendored_sdks/boolean/models/_models.py new file mode 100644 index 00000000..ae542355 --- /dev/null +++ b/src/test/scenarios/boolean/output/src/boolean/azext_boolean/vendored_sdks/boolean/models/_models.py @@ -0,0 +1,33 @@ +# 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 Error(msrest.serialization.Model): + """Error. + + :param status: + :type status: int + :param message: + :type message: str + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'int'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Error, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + self.message = kwargs.get('message', None) diff --git a/src/test/scenarios/boolean/output/src/boolean/azext_boolean/vendored_sdks/boolean/models/_models_py3.py b/src/test/scenarios/boolean/output/src/boolean/azext_boolean/vendored_sdks/boolean/models/_models_py3.py new file mode 100644 index 00000000..443ed73a --- /dev/null +++ b/src/test/scenarios/boolean/output/src/boolean/azext_boolean/vendored_sdks/boolean/models/_models_py3.py @@ -0,0 +1,38 @@ +# 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 Optional + +from azure.core.exceptions import HttpResponseError +import msrest.serialization + + +class Error(msrest.serialization.Model): + """Error. + + :param status: + :type status: int + :param message: + :type message: str + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'int'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + *, + status: Optional[int] = None, + message: Optional[str] = None, + **kwargs + ): + super(Error, self).__init__(**kwargs) + self.status = status + self.message = message diff --git a/src/test/scenarios/boolean/output/src/boolean/azext_boolean/vendored_sdks/boolean/operations/__init__.py b/src/test/scenarios/boolean/output/src/boolean/azext_boolean/vendored_sdks/boolean/operations/__init__.py new file mode 100644 index 00000000..2e89438b --- /dev/null +++ b/src/test/scenarios/boolean/output/src/boolean/azext_boolean/vendored_sdks/boolean/operations/__init__.py @@ -0,0 +1,13 @@ +# 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 ._bool_operations import BoolOperations + +__all__ = [ + 'BoolOperations', +] diff --git a/src/test/scenarios/boolean/output/src/boolean/azext_boolean/vendored_sdks/boolean/operations/_bool_operations.py b/src/test/scenarios/boolean/output/src/boolean/azext_boolean/vendored_sdks/boolean/operations/_bool_operations.py new file mode 100644 index 00000000..ec699143 --- /dev/null +++ b/src/test/scenarios/boolean/output/src/boolean/azext_boolean/vendored_sdks/boolean/operations/_bool_operations.py @@ -0,0 +1,315 @@ +# 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 HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class BoolOperations(object): + """BoolOperations 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: ~auto_rest_test_service.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_true( + self, + **kwargs # type: Any + ): + # type: (...) -> bool + """Get true Boolean value. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: bool, or the result of cls(response) + :rtype: bool + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[bool] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_true.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + 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.Error, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('bool', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_true.metadata = {'url': '/bool/true'} # type: ignore + + def put_true( + self, + **kwargs # type: Any + ): + # type: (...) -> None + """Set Boolean value true. + + :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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + content_type = kwargs.pop("content_type", "application/json") + bool_body = True + + # Construct URL + url = self.put_true.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(bool_body, 'bool') + 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.Error, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + put_true.metadata = {'url': '/bool/true'} # type: ignore + + def get_false( + self, + **kwargs # type: Any + ): + # type: (...) -> bool + """Get false Boolean value. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: bool, or the result of cls(response) + :rtype: bool + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[bool] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_false.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + 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.Error, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('bool', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_false.metadata = {'url': '/bool/false'} # type: ignore + + def put_false( + self, + **kwargs # type: Any + ): + # type: (...) -> None + """Set Boolean value false. + + :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 = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + content_type = kwargs.pop("content_type", "application/json") + bool_body = False + + # Construct URL + url = self.put_false.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(bool_body, 'bool') + 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.Error, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + put_false.metadata = {'url': '/bool/false'} # type: ignore + + def get_null( + self, + **kwargs # type: Any + ): + # type: (...) -> bool + """Get null Boolean value. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: bool, or the result of cls(response) + :rtype: bool + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[bool] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_null.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + 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.Error, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('bool', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_null.metadata = {'url': '/bool/null'} # type: ignore + + def get_invalid( + self, + **kwargs # type: Any + ): + # type: (...) -> bool + """Get invalid Boolean value. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: bool, or the result of cls(response) + :rtype: bool + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[bool] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_invalid.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + 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.Error, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('bool', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_invalid.metadata = {'url': '/bool/invalid'} # type: ignore diff --git a/src/test/scenarios/boolean/output/src/boolean/azext_boolean/vendored_sdks/boolean/py.typed b/src/test/scenarios/boolean/output/src/boolean/azext_boolean/vendored_sdks/boolean/py.typed new file mode 100644 index 00000000..e5aff4f8 --- /dev/null +++ b/src/test/scenarios/boolean/output/src/boolean/azext_boolean/vendored_sdks/boolean/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file diff --git a/src/test/scenarios/boolean/output/src/boolean/report.md b/src/test/scenarios/boolean/output/src/boolean/report.md new file mode 100644 index 00000000..cbb456b3 --- /dev/null +++ b/src/test/scenarios/boolean/output/src/boolean/report.md @@ -0,0 +1,109 @@ +# Azure CLI Module Creation Report + +### boolean bool get-false + +get-false a boolean bool. + +#### Command group +|Name (az)|Swagger name| +|---------|------------| +|boolean bool|bool| + +#### Methods +|Name (az)|Swagger name| +|---------|------------| +|get-false|getFalse| + +#### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| + +### boolean bool get-invalid + +get-invalid a boolean bool. + +#### Command group +|Name (az)|Swagger name| +|---------|------------| +|boolean bool|bool| + +#### Methods +|Name (az)|Swagger name| +|---------|------------| +|get-invalid|getInvalid| + +#### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| + +### boolean bool get-null + +get-null a boolean bool. + +#### Command group +|Name (az)|Swagger name| +|---------|------------| +|boolean bool|bool| + +#### Methods +|Name (az)|Swagger name| +|---------|------------| +|get-null|getNull| + +#### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| + +### boolean bool get-true + +get-true a boolean bool. + +#### Command group +|Name (az)|Swagger name| +|---------|------------| +|boolean bool|bool| + +#### Methods +|Name (az)|Swagger name| +|---------|------------| +|get-true|getTrue| + +#### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| + +### boolean bool put-false + +put-false a boolean bool. + +#### Command group +|Name (az)|Swagger name| +|---------|------------| +|boolean bool|bool| + +#### Methods +|Name (az)|Swagger name| +|---------|------------| +|put-false|putFalse| + +#### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| + +### boolean bool put-true + +put-true a boolean bool. + +#### Command group +|Name (az)|Swagger name| +|---------|------------| +|boolean bool|bool| + +#### Methods +|Name (az)|Swagger name| +|---------|------------| +|put-true|putTrue| + +#### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| diff --git a/src/test/scenarios/boolean/output/src/boolean/setup.cfg b/src/test/scenarios/boolean/output/src/boolean/setup.cfg new file mode 100644 index 00000000..2fdd96e5 --- /dev/null +++ b/src/test/scenarios/boolean/output/src/boolean/setup.cfg @@ -0,0 +1 @@ +#setup.cfg \ No newline at end of file diff --git a/src/test/scenarios/boolean/output/src/boolean/setup.py b/src/test/scenarios/boolean/output/src/boolean/setup.py new file mode 100644 index 00000000..dc0132d0 --- /dev/null +++ b/src/test/scenarios/boolean/output/src/boolean/setup.py @@ -0,0 +1,57 @@ +#!/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_boolean.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 .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='boolean', + version=VERSION, + description='Microsoft Azure Command-Line Tools AutoRestTestService Extension', + author='Microsoft Corporation', + author_email='azpycli@microsoft.com', + url='https://github.com/Azure/azure-cli-extensions/tree/master/src/boolean', + long_description=README + '\n\n' + HISTORY, + license='MIT', + classifiers=CLASSIFIERS, + packages=find_packages(), + install_requires=DEPENDENCIES, + package_data={'azext_boolean': ['azext_metadata.json']}, +)