/
auto_rest_url_test_service.py
91 lines (73 loc) · 3.63 KB
/
auto_rest_url_test_service.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# 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 msrest.service_client import ServiceClient
from msrest import Configuration, Serializer, Deserializer
from .version import VERSION
from .operations.paths_operations import PathsOperations
from .operations.queries_operations import QueriesOperations
from .operations.path_items_operations import PathItemsOperations
from . import models
class AutoRestUrlTestServiceConfiguration(Configuration):
"""Configuration for AutoRestUrlTestService
Note that all parameters used to create this instance are saved as instance
attributes.
:param global_string_path: A string value 'globalItemStringPath' that
appears in the path
:type global_string_path: str
:param global_string_query: should contain value null
:type global_string_query: str
:param str base_url: Service URL
"""
def __init__(
self, global_string_path, global_string_query=None, base_url=None):
if global_string_path is None:
raise ValueError("Parameter 'global_string_path' must not be None.")
if not isinstance(global_string_path, str):
raise TypeError("Parameter 'global_string_path' must be str.")
if global_string_query is not None and not isinstance(global_string_query, str):
raise TypeError("Optional parameter 'global_string_query' must be str.")
if not base_url:
base_url = 'http://localhost'
super(AutoRestUrlTestServiceConfiguration, self).__init__(base_url)
self.add_user_agent('autoresturltestservice/{}'.format(VERSION))
self.global_string_path = global_string_path
self.global_string_query = global_string_query
class AutoRestUrlTestService(object):
"""Test Infrastructure for AutoRest
:ivar config: Configuration for client.
:vartype config: AutoRestUrlTestServiceConfiguration
:ivar paths: Paths operations
:vartype paths: .operations.PathsOperations
:ivar queries: Queries operations
:vartype queries: .operations.QueriesOperations
:ivar path_items: PathItems operations
:vartype path_items: .operations.PathItemsOperations
:param global_string_path: A string value 'globalItemStringPath' that
appears in the path
:type global_string_path: str
:param global_string_query: should contain value null
:type global_string_query: str
:param str base_url: Service URL
"""
def __init__(
self, global_string_path, global_string_query=None, base_url=None):
self.config = AutoRestUrlTestServiceConfiguration(global_string_path, global_string_query, base_url)
self._client = ServiceClient(None, self.config)
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
self.api_version = '1.0.0'
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)
self.paths = PathsOperations(
self._client, self.config, self._serialize, self._deserialize)
self.queries = QueriesOperations(
self._client, self.config, self._serialize, self._deserialize)
self.path_items = PathItemsOperations(
self._client, self.config, self._serialize, self._deserialize)