diracx-client 0.0.1a45__py3-none-any.whl → 0.0.1a46__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -9,9 +9,7 @@ from azure.core import MatchConditions
9
9
 
10
10
 
11
11
  def raise_if_not_implemented(cls, abstract_methods):
12
- not_implemented = [
13
- f for f in abstract_methods if not callable(getattr(cls, f, None))
14
- ]
12
+ not_implemented = [f for f in abstract_methods if not callable(getattr(cls, f, None))]
15
13
  if not_implemented:
16
14
  raise NotImplementedError(
17
15
  "The following methods on operation group '{}' are not implemented: '{}'."
@@ -33,9 +31,7 @@ def quote_etag(etag: Optional[str]) -> Optional[str]:
33
31
  return '"' + etag + '"'
34
32
 
35
33
 
36
- def prep_if_match(
37
- etag: Optional[str], match_condition: Optional[MatchConditions]
38
- ) -> Optional[str]:
34
+ def prep_if_match(etag: Optional[str], match_condition: Optional[MatchConditions]) -> Optional[str]:
39
35
  if match_condition == MatchConditions.IfNotModified:
40
36
  if_match = quote_etag(etag) if etag else None
41
37
  return if_match
@@ -44,9 +40,7 @@ def prep_if_match(
44
40
  return None
45
41
 
46
42
 
47
- def prep_if_none_match(
48
- etag: Optional[str], match_condition: Optional[MatchConditions]
49
- ) -> Optional[str]:
43
+ def prep_if_none_match(etag: Optional[str], match_condition: Optional[MatchConditions]) -> Optional[str]:
50
44
  if match_condition == MatchConditions.IfModified:
51
45
  if_none_match = quote_etag(etag) if etag else None
52
46
  return if_none_match
@@ -15,12 +15,7 @@ from azure.core.rest import AsyncHttpResponse, HttpRequest
15
15
  from .. import models as _models
16
16
  from .._utils.serialization import Deserializer, Serializer
17
17
  from ._configuration import DiracConfiguration
18
- from .operations import (
19
- AuthOperations,
20
- ConfigOperations,
21
- JobsOperations,
22
- WellKnownOperations,
23
- )
18
+ from .operations import AuthOperations, ConfigOperations, JobsOperations, WellKnownOperations
24
19
 
25
20
 
26
21
  class Dirac: # pylint: disable=client-accepts-api-version-keyword
@@ -57,35 +52,19 @@ class Dirac: # pylint: disable=client-accepts-api-version-keyword
57
52
  self._config.custom_hook_policy,
58
53
  self._config.logging_policy,
59
54
  policies.DistributedTracingPolicy(**kwargs),
60
- (
61
- policies.SensitiveHeaderCleanupPolicy(**kwargs)
62
- if self._config.redirect_policy
63
- else None
64
- ),
55
+ policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
65
56
  self._config.http_logging_policy,
66
57
  ]
67
- self._client: AsyncPipelineClient = AsyncPipelineClient(
68
- base_url=endpoint, policies=_policies, **kwargs
69
- )
58
+ self._client: AsyncPipelineClient = AsyncPipelineClient(base_url=endpoint, policies=_policies, **kwargs)
70
59
 
71
- client_models = {
72
- k: v for k, v in _models.__dict__.items() if isinstance(v, type)
73
- }
60
+ client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)}
74
61
  self._serialize = Serializer(client_models)
75
62
  self._deserialize = Deserializer(client_models)
76
63
  self._serialize.client_side_validation = False
77
- self.well_known = WellKnownOperations(
78
- self._client, self._config, self._serialize, self._deserialize
79
- )
80
- self.auth = AuthOperations(
81
- self._client, self._config, self._serialize, self._deserialize
82
- )
83
- self.config = ConfigOperations(
84
- self._client, self._config, self._serialize, self._deserialize
85
- )
86
- self.jobs = JobsOperations(
87
- self._client, self._config, self._serialize, self._deserialize
88
- )
64
+ self.well_known = WellKnownOperations(self._client, self._config, self._serialize, self._deserialize)
65
+ self.auth = AuthOperations(self._client, self._config, self._serialize, self._deserialize)
66
+ self.config = ConfigOperations(self._client, self._config, self._serialize, self._deserialize)
67
+ self.jobs = JobsOperations(self._client, self._config, self._serialize, self._deserialize)
89
68
 
90
69
  def send_request(
91
70
  self, request: HttpRequest, *, stream: bool = False, **kwargs: Any
@@ -25,26 +25,12 @@ class DiracConfiguration: # pylint: disable=too-many-instance-attributes
25
25
  self._configure(**kwargs)
26
26
 
27
27
  def _configure(self, **kwargs: Any) -> None:
28
- self.user_agent_policy = kwargs.get(
29
- "user_agent_policy"
30
- ) or policies.UserAgentPolicy(**kwargs)
31
- self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(
32
- **kwargs
33
- )
28
+ self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs)
29
+ self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs)
34
30
  self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs)
35
- self.logging_policy = kwargs.get(
36
- "logging_policy"
37
- ) or policies.NetworkTraceLoggingPolicy(**kwargs)
38
- self.http_logging_policy = kwargs.get(
39
- "http_logging_policy"
40
- ) or policies.HttpLoggingPolicy(**kwargs)
41
- self.custom_hook_policy = kwargs.get(
42
- "custom_hook_policy"
43
- ) or policies.CustomHookPolicy(**kwargs)
44
- self.redirect_policy = kwargs.get(
45
- "redirect_policy"
46
- ) or policies.AsyncRedirectPolicy(**kwargs)
47
- self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(
48
- **kwargs
49
- )
31
+ self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs)
32
+ self.http_logging_policy = kwargs.get("http_logging_policy") or policies.HttpLoggingPolicy(**kwargs)
33
+ self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs)
34
+ self.redirect_policy = kwargs.get("redirect_policy") or policies.AsyncRedirectPolicy(**kwargs)
35
+ self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs)
50
36
  self.authentication_policy = kwargs.get("authentication_policy")
@@ -6,9 +6,7 @@
6
6
 
7
7
  Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize
8
8
  """
9
- __all__ = [
10
- "Dirac"
11
- ] # Add all objects you want publicly available to users at this package level
9
+ __all__ = ["Dirac"] # Add all objects you want publicly available to users at this package level
12
10
 
13
11
  from ...patches.client.aio import Dirac
14
12