|
| 1 | +# coding=utf-8 |
| 2 | +# -------------------------------------------------------------------------- |
| 3 | +# Copyright (c) Microsoft Corporation. All rights reserved. |
| 4 | +# Licensed under the MIT License. See License.txt in the project root for license information. |
| 5 | +# Code generated by Microsoft (R) Python Code Generator. |
| 6 | +# Changes may cause incorrect behavior and will be lost if the code is regenerated. |
| 7 | +# -------------------------------------------------------------------------- |
| 8 | + |
| 9 | +from typing import Any, TYPE_CHECKING |
| 10 | + |
| 11 | +from azure.core.pipeline import policies |
| 12 | + |
| 13 | +from ._version import VERSION |
| 14 | + |
| 15 | +if TYPE_CHECKING: |
| 16 | + from azure.core.credentials import TokenCredential |
| 17 | + |
| 18 | + |
| 19 | +class LoadTestAdministrationClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long |
| 20 | + """Configuration for LoadTestAdministrationClient. |
| 21 | +
|
| 22 | + Note that all parameters used to create this instance are saved as instance |
| 23 | + attributes. |
| 24 | +
|
| 25 | + :param endpoint: Required. |
| 26 | + :type endpoint: str |
| 27 | + :param credential: Credential used to authenticate requests to the service. Required. |
| 28 | + :type credential: ~azure.core.credentials.TokenCredential |
| 29 | + :keyword api_version: The API version to use for this operation. Default value is |
| 30 | + "2024-12-01-preview". Note that overriding this default value may result in unsupported |
| 31 | + behavior. |
| 32 | + :paramtype api_version: str |
| 33 | + """ |
| 34 | + |
| 35 | + def __init__(self, endpoint: str, credential: "TokenCredential", **kwargs: Any) -> None: |
| 36 | + api_version: str = kwargs.pop("api_version", "2024-12-01-preview") |
| 37 | + |
| 38 | + if endpoint is None: |
| 39 | + raise ValueError("Parameter 'endpoint' must not be None.") |
| 40 | + if credential is None: |
| 41 | + raise ValueError("Parameter 'credential' must not be None.") |
| 42 | + |
| 43 | + self.endpoint = endpoint |
| 44 | + self.credential = credential |
| 45 | + self.api_version = api_version |
| 46 | + self.credential_scopes = kwargs.pop("credential_scopes", ["https://cnt-prod.loadtesting.azure.com/.default"]) |
| 47 | + kwargs.setdefault("sdk_moniker", "developer-loadtesting/{}".format(VERSION)) |
| 48 | + self.polling_interval = kwargs.get("polling_interval", 30) |
| 49 | + self._configure(**kwargs) |
| 50 | + |
| 51 | + def _configure(self, **kwargs: Any) -> None: |
| 52 | + self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) |
| 53 | + self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) |
| 54 | + self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) |
| 55 | + self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) |
| 56 | + self.http_logging_policy = kwargs.get("http_logging_policy") or policies.HttpLoggingPolicy(**kwargs) |
| 57 | + self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) |
| 58 | + self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs) |
| 59 | + self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) |
| 60 | + self.authentication_policy = kwargs.get("authentication_policy") |
| 61 | + if self.credential and not self.authentication_policy: |
| 62 | + self.authentication_policy = policies.BearerTokenCredentialPolicy( |
| 63 | + self.credential, *self.credential_scopes, **kwargs |
| 64 | + ) |
| 65 | + |
| 66 | + |
| 67 | +class LoadTestRunClientConfiguration: # pylint: disable=too-many-instance-attributes |
| 68 | + """Configuration for LoadTestRunClient. |
| 69 | +
|
| 70 | + Note that all parameters used to create this instance are saved as instance |
| 71 | + attributes. |
| 72 | +
|
| 73 | + :param endpoint: Required. |
| 74 | + :type endpoint: str |
| 75 | + :param credential: Credential used to authenticate requests to the service. Required. |
| 76 | + :type credential: ~azure.core.credentials.TokenCredential |
| 77 | + :keyword api_version: The API version to use for this operation. Default value is |
| 78 | + "2024-12-01-preview". Note that overriding this default value may result in unsupported |
| 79 | + behavior. |
| 80 | + :paramtype api_version: str |
| 81 | + """ |
| 82 | + |
| 83 | + def __init__(self, endpoint: str, credential: "TokenCredential", **kwargs: Any) -> None: |
| 84 | + api_version: str = kwargs.pop("api_version", "2024-12-01-preview") |
| 85 | + |
| 86 | + if endpoint is None: |
| 87 | + raise ValueError("Parameter 'endpoint' must not be None.") |
| 88 | + if credential is None: |
| 89 | + raise ValueError("Parameter 'credential' must not be None.") |
| 90 | + |
| 91 | + self.endpoint = endpoint |
| 92 | + self.credential = credential |
| 93 | + self.api_version = api_version |
| 94 | + self.credential_scopes = kwargs.pop("credential_scopes", ["https://cnt-prod.loadtesting.azure.com/.default"]) |
| 95 | + kwargs.setdefault("sdk_moniker", "developer-loadtesting/{}".format(VERSION)) |
| 96 | + self.polling_interval = kwargs.get("polling_interval", 30) |
| 97 | + self._configure(**kwargs) |
| 98 | + |
| 99 | + def _configure(self, **kwargs: Any) -> None: |
| 100 | + self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) |
| 101 | + self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) |
| 102 | + self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) |
| 103 | + self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) |
| 104 | + self.http_logging_policy = kwargs.get("http_logging_policy") or policies.HttpLoggingPolicy(**kwargs) |
| 105 | + self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) |
| 106 | + self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs) |
| 107 | + self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) |
| 108 | + self.authentication_policy = kwargs.get("authentication_policy") |
| 109 | + if self.credential and not self.authentication_policy: |
| 110 | + self.authentication_policy = policies.BearerTokenCredentialPolicy( |
| 111 | + self.credential, *self.credential_scopes, **kwargs |
| 112 | + ) |
| 113 | + |
| 114 | + |
| 115 | +class LoadTestAdministrationClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long |
| 116 | + """Configuration for LoadTestAdministrationClient. |
| 117 | +
|
| 118 | + Note that all parameters used to create this instance are saved as instance |
| 119 | + attributes. |
| 120 | +
|
| 121 | + :param endpoint: Required. |
| 122 | + :type endpoint: str |
| 123 | + :param credential: Credential used to authenticate requests to the service. Required. |
| 124 | + :type credential: ~azure.core.credentials.TokenCredential |
| 125 | + :keyword api_version: The API version to use for this operation. Default value is |
| 126 | + "2024-12-01-preview". Note that overriding this default value may result in unsupported |
| 127 | + behavior. |
| 128 | + :paramtype api_version: str |
| 129 | + """ |
| 130 | + |
| 131 | + def __init__(self, endpoint: str, credential: "TokenCredential", **kwargs: Any) -> None: |
| 132 | + api_version: str = kwargs.pop("api_version", "2024-12-01-preview") |
| 133 | + |
| 134 | + if endpoint is None: |
| 135 | + raise ValueError("Parameter 'endpoint' must not be None.") |
| 136 | + if credential is None: |
| 137 | + raise ValueError("Parameter 'credential' must not be None.") |
| 138 | + |
| 139 | + self.endpoint = endpoint |
| 140 | + self.credential = credential |
| 141 | + self.api_version = api_version |
| 142 | + self.credential_scopes = kwargs.pop("credential_scopes", ["https://cnt-prod.loadtesting.azure.com/.default"]) |
| 143 | + kwargs.setdefault("sdk_moniker", "developer-loadtesting/{}".format(VERSION)) |
| 144 | + self.polling_interval = kwargs.get("polling_interval", 30) |
| 145 | + self._configure(**kwargs) |
| 146 | + |
| 147 | + def _configure(self, **kwargs: Any) -> None: |
| 148 | + self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) |
| 149 | + self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) |
| 150 | + self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) |
| 151 | + self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) |
| 152 | + self.http_logging_policy = kwargs.get("http_logging_policy") or policies.HttpLoggingPolicy(**kwargs) |
| 153 | + self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) |
| 154 | + self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs) |
| 155 | + self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) |
| 156 | + self.authentication_policy = kwargs.get("authentication_policy") |
| 157 | + if self.credential and not self.authentication_policy: |
| 158 | + self.authentication_policy = policies.BearerTokenCredentialPolicy( |
| 159 | + self.credential, *self.credential_scopes, **kwargs |
| 160 | + ) |
| 161 | + |
| 162 | + |
| 163 | +class LoadTestRunClientConfiguration: # pylint: disable=too-many-instance-attributes |
| 164 | + """Configuration for LoadTestRunClient. |
| 165 | +
|
| 166 | + Note that all parameters used to create this instance are saved as instance |
| 167 | + attributes. |
| 168 | +
|
| 169 | + :param endpoint: Required. |
| 170 | + :type endpoint: str |
| 171 | + :param credential: Credential used to authenticate requests to the service. Required. |
| 172 | + :type credential: ~azure.core.credentials.TokenCredential |
| 173 | + :keyword api_version: The API version to use for this operation. Default value is |
| 174 | + "2024-12-01-preview". Note that overriding this default value may result in unsupported |
| 175 | + behavior. |
| 176 | + :paramtype api_version: str |
| 177 | + """ |
| 178 | + |
| 179 | + def __init__(self, endpoint: str, credential: "TokenCredential", **kwargs: Any) -> None: |
| 180 | + api_version: str = kwargs.pop("api_version", "2024-12-01-preview") |
| 181 | + |
| 182 | + if endpoint is None: |
| 183 | + raise ValueError("Parameter 'endpoint' must not be None.") |
| 184 | + if credential is None: |
| 185 | + raise ValueError("Parameter 'credential' must not be None.") |
| 186 | + |
| 187 | + self.endpoint = endpoint |
| 188 | + self.credential = credential |
| 189 | + self.api_version = api_version |
| 190 | + self.credential_scopes = kwargs.pop("credential_scopes", ["https://cnt-prod.loadtesting.azure.com/.default"]) |
| 191 | + kwargs.setdefault("sdk_moniker", "developer-loadtesting/{}".format(VERSION)) |
| 192 | + self.polling_interval = kwargs.get("polling_interval", 30) |
| 193 | + self._configure(**kwargs) |
| 194 | + |
| 195 | + def _configure(self, **kwargs: Any) -> None: |
| 196 | + self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) |
| 197 | + self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) |
| 198 | + self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) |
| 199 | + self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) |
| 200 | + self.http_logging_policy = kwargs.get("http_logging_policy") or policies.HttpLoggingPolicy(**kwargs) |
| 201 | + self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) |
| 202 | + self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs) |
| 203 | + self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) |
| 204 | + self.authentication_policy = kwargs.get("authentication_policy") |
| 205 | + if self.credential and not self.authentication_policy: |
| 206 | + self.authentication_policy = policies.BearerTokenCredentialPolicy( |
| 207 | + self.credential, *self.credential_scopes, **kwargs |
| 208 | + ) |
0 commit comments