зеркало из https://github.com/Azure/autorest.az.git
fix-issue-443 (#465)
This commit is contained in:
Родитель
86c0d66982
Коммит
3aa71d108f
|
@ -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 [];
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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 => {
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
|
@ -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"
|
||||
|
||||
```
|
|
@ -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
|
||||
```
|
|
@ -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)
|
|
@ -0,0 +1,26 @@
|
|||
## Python
|
||||
|
||||
These settings apply only when `--python` is specified on the command line.
|
||||
Please also specify `--python-sdks-folder=<path to the root directory of your azure-sdk-for-python clone>`.
|
||||
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
|
||||
```
|
|
@ -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"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
.. :changelog:
|
||||
|
||||
Release History
|
||||
===============
|
||||
|
||||
0.1.0
|
||||
++++++
|
||||
* Initial release.
|
|
@ -0,0 +1,5 @@
|
|||
Microsoft Azure CLI 'boolean' Extension
|
||||
==========================================
|
||||
|
||||
This package is for the 'boolean' extension.
|
||||
i.e. 'az boolean'
|
|
@ -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
|
|
@ -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
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"azext.isExperimental": true,
|
||||
"azext.minCliCoreVersion": "2.3.1"
|
||||
}
|
|
@ -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
|
|
@ -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__)
|
|
@ -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
|
|
@ -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
|
||||
"""
|
|
@ -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
|
|
@ -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.
|
||||
# --------------------------------------------------------------------------
|
|
@ -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
|
|
@ -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')
|
|
@ -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()
|
|
@ -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__)
|
|
@ -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])
|
|
@ -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__)
|
|
@ -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()
|
|
@ -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__)
|
|
@ -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
|
|
@ -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)
|
|
@ -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)
|
|
@ -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']
|
|
@ -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)
|
|
@ -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)
|
|
@ -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',
|
||||
]
|
|
@ -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
|
|
@ -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',
|
||||
]
|
|
@ -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)
|
|
@ -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
|
|
@ -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',
|
||||
]
|
|
@ -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
|
|
@ -0,0 +1 @@
|
|||
# Marker file for PEP 561.
|
|
@ -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|
|
||||
|------|----|-----------|----------|------------|
|
|
@ -0,0 +1 @@
|
|||
#setup.cfg
|
|
@ -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']},
|
||||
)
|
Загрузка…
Ссылка в новой задаче