cliV1 0.1.4__tar.gz → 0.1.5__tar.gz

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.
Files changed (60) hide show
  1. cliv1-0.1.5/PKG-INFO +99 -0
  2. cliv1-0.1.5/README.md +84 -0
  3. {cliv1-0.1.4/swaggerpetstoreopenapi30 → cliv1-0.1.5/apimaticcalculator}/__init__.py +2 -3
  4. {cliv1-0.1.4/swaggerpetstoreopenapi30 → cliv1-0.1.5/apimaticcalculator}/api_helper.py +1 -1
  5. cliv1-0.1.5/apimaticcalculator/apimaticcalculator_client.py +63 -0
  6. {cliv1-0.1.4/swaggerpetstoreopenapi30 → cliv1-0.1.5/apimaticcalculator}/configuration.py +12 -52
  7. {cliv1-0.1.4/swaggerpetstoreopenapi30/http/auth → cliv1-0.1.5/apimaticcalculator/controllers}/__init__.py +2 -2
  8. cliv1-0.1.4/swaggerpetstoreopenapi30/apis/base_api.py → cliv1-0.1.5/apimaticcalculator/controllers/base_controller.py +7 -12
  9. cliv1-0.1.5/apimaticcalculator/controllers/simple_calculator_controller.py +69 -0
  10. {cliv1-0.1.4/swaggerpetstoreopenapi30 → cliv1-0.1.5/apimaticcalculator}/exceptions/__init__.py +0 -1
  11. {cliv1-0.1.4/swaggerpetstoreopenapi30 → cliv1-0.1.5/apimaticcalculator}/exceptions/api_exception.py +4 -4
  12. {cliv1-0.1.4/swaggerpetstoreopenapi30 → cliv1-0.1.5/apimaticcalculator}/http/__init__.py +0 -1
  13. {cliv1-0.1.4/swaggerpetstoreopenapi30 → cliv1-0.1.5/apimaticcalculator}/http/http_call_back.py +1 -1
  14. {cliv1-0.1.4/swaggerpetstoreopenapi30 → cliv1-0.1.5/apimaticcalculator}/http/http_client_provider.py +1 -1
  15. {cliv1-0.1.4/swaggerpetstoreopenapi30 → cliv1-0.1.5/apimaticcalculator}/http/http_method_enum.py +1 -1
  16. {cliv1-0.1.4/swaggerpetstoreopenapi30 → cliv1-0.1.5/apimaticcalculator}/http/http_request.py +1 -1
  17. {cliv1-0.1.4/swaggerpetstoreopenapi30 → cliv1-0.1.5/apimaticcalculator}/http/http_response.py +1 -1
  18. {cliv1-0.1.4/swaggerpetstoreopenapi30 → cliv1-0.1.5/apimaticcalculator}/http/proxy_settings.py +1 -1
  19. {cliv1-0.1.4/swaggerpetstoreopenapi30/logging/configuration → cliv1-0.1.5/apimaticcalculator/models}/__init__.py +1 -1
  20. cliv1-0.1.4/swaggerpetstoreopenapi30/models/order_status.py → cliv1-0.1.5/apimaticcalculator/models/operation_type_enum.py +13 -10
  21. {cliv1-0.1.4/swaggerpetstoreopenapi30 → cliv1-0.1.5/apimaticcalculator}/utilities/__init__.py +0 -1
  22. {cliv1-0.1.4/swaggerpetstoreopenapi30 → cliv1-0.1.5/apimaticcalculator}/utilities/file_wrapper.py +1 -1
  23. cliv1-0.1.5/cliV1.egg-info/PKG-INFO +99 -0
  24. cliv1-0.1.5/cliV1.egg-info/SOURCES.txt +30 -0
  25. cliv1-0.1.5/cliV1.egg-info/top_level.txt +3 -0
  26. {cliv1-0.1.4 → cliv1-0.1.5}/pyproject.toml +3 -6
  27. cliv1-0.1.4/PKG-INFO +0 -166
  28. cliv1-0.1.4/README.md +0 -150
  29. cliv1-0.1.4/cliV1.egg-info/PKG-INFO +0 -166
  30. cliv1-0.1.4/cliV1.egg-info/SOURCES.txt +0 -52
  31. cliv1-0.1.4/cliV1.egg-info/top_level.txt +0 -3
  32. cliv1-0.1.4/swaggerpetstoreopenapi30/apis/__init__.py +0 -8
  33. cliv1-0.1.4/swaggerpetstoreopenapi30/apis/pet_api.py +0 -453
  34. cliv1-0.1.4/swaggerpetstoreopenapi30/apis/store_api.py +0 -213
  35. cliv1-0.1.4/swaggerpetstoreopenapi30/apis/user_api.py +0 -378
  36. cliv1-0.1.4/swaggerpetstoreopenapi30/exceptions/oauth_provider_exception.py +0 -75
  37. cliv1-0.1.4/swaggerpetstoreopenapi30/http/api_response.py +0 -67
  38. cliv1-0.1.4/swaggerpetstoreopenapi30/http/auth/api_key.py +0 -100
  39. cliv1-0.1.4/swaggerpetstoreopenapi30/http/auth/petstore_auth.py +0 -247
  40. cliv1-0.1.4/swaggerpetstoreopenapi30/logging/__init__.py +0 -6
  41. cliv1-0.1.4/swaggerpetstoreopenapi30/logging/configuration/api_logging_configuration.py +0 -398
  42. cliv1-0.1.4/swaggerpetstoreopenapi30/logging/sdk_logger.py +0 -28
  43. cliv1-0.1.4/swaggerpetstoreopenapi30/models/__init__.py +0 -15
  44. cliv1-0.1.4/swaggerpetstoreopenapi30/models/api_response.py +0 -185
  45. cliv1-0.1.4/swaggerpetstoreopenapi30/models/category.py +0 -159
  46. cliv1-0.1.4/swaggerpetstoreopenapi30/models/oauth_provider_error.py +0 -67
  47. cliv1-0.1.4/swaggerpetstoreopenapi30/models/oauth_scope_petstore_auth.py +0 -45
  48. cliv1-0.1.4/swaggerpetstoreopenapi30/models/oauth_token.py +0 -157
  49. cliv1-0.1.4/swaggerpetstoreopenapi30/models/order.py +0 -265
  50. cliv1-0.1.4/swaggerpetstoreopenapi30/models/pet.py +0 -258
  51. cliv1-0.1.4/swaggerpetstoreopenapi30/models/pet_status.py +0 -48
  52. cliv1-0.1.4/swaggerpetstoreopenapi30/models/tag.py +0 -159
  53. cliv1-0.1.4/swaggerpetstoreopenapi30/models/user.py +0 -315
  54. cliv1-0.1.4/swaggerpetstoreopenapi30/swaggerpetstoreopenapi_30_client.py +0 -104
  55. cliv1-0.1.4/swaggerpetstoreopenapi30/utilities/xml_utilities.py +0 -12
  56. {cliv1-0.1.4 → cliv1-0.1.5}/LICENSE +0 -0
  57. {cliv1-0.1.4 → cliv1-0.1.5}/MANIFEST.in +0 -0
  58. {cliv1-0.1.4 → cliv1-0.1.5}/cliV1.egg-info/dependency_links.txt +0 -0
  59. {cliv1-0.1.4 → cliv1-0.1.5}/cliV1.egg-info/requires.txt +0 -0
  60. {cliv1-0.1.4 → cliv1-0.1.5}/setup.cfg +0 -0
cliv1-0.1.5/PKG-INFO ADDED
@@ -0,0 +1,99 @@
1
+ Metadata-Version: 2.4
2
+ Name: cliV1
3
+ Version: 0.1.5
4
+ Summary: The official Python library for the APIMATIC Calculator API
5
+ Requires-Python: >=3.7
6
+ Description-Content-Type: text/markdown
7
+ License-File: LICENSE
8
+ Requires-Dist: apimatic-core>=0.2.24,~=0.2.0
9
+ Requires-Dist: apimatic-core-interfaces>=0.1.8,~=0.1.0
10
+ Requires-Dist: apimatic-requests-client-adapter>=0.1.10,~=0.1.0
11
+ Requires-Dist: python-dotenv<2.0,>=0.21
12
+ Provides-Extra: testutils
13
+ Requires-Dist: pytest>=7.2.2; extra == "testutils"
14
+ Dynamic: license-file
15
+
16
+
17
+ # Getting Started with APIMATIC Calculator
18
+
19
+ ## Introduction
20
+
21
+ Simple calculator API hosted on APIMATIC
22
+
23
+ ## Install the Package
24
+
25
+ The package is compatible with Python versions `3.7+`.
26
+ Install the package from PyPi using the following pip command:
27
+
28
+ ```bash
29
+ pip install cliV1==0.1.5
30
+ ```
31
+
32
+ You can also view the package at:
33
+ https://pypi.python.org/pypi/cliV1/0.1.5
34
+
35
+ ## Initialize the API Client
36
+
37
+ **_Note:_** Documentation for the client can be found [here.](https://www.github.com/WasifMatic/acme-python-sdk/tree/0.1.5/doc/client.md)
38
+
39
+ The following parameters are configurable for the API Client:
40
+
41
+ | Parameter | Type | Description |
42
+ | --- | --- | --- |
43
+ | http_client_instance | `Union[Session, HttpClientProvider]` | The Http Client passed from the sdk user for making requests |
44
+ | override_http_client_configuration | `bool` | The value which determines to override properties of the passed Http Client from the sdk user |
45
+ | http_call_back | `HttpCallBack` | The callback value that is invoked before and after an HTTP call is made to an endpoint |
46
+ | timeout | `float` | The value to use for connection timeout. <br> **Default: 60** |
47
+ | max_retries | `int` | The number of times to retry an endpoint call if it fails. <br> **Default: 0** |
48
+ | backoff_factor | `float` | A backoff factor to apply between attempts after the second try. <br> **Default: 2** |
49
+ | retry_statuses | `Array of int` | The http statuses on which retry is to be done. <br> **Default: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524]** |
50
+ | retry_methods | `Array of string` | The http methods on which retry is to be done. <br> **Default: ["GET", "PUT"]** |
51
+ | proxy_settings | [`ProxySettings`](https://www.github.com/WasifMatic/acme-python-sdk/tree/0.1.5/doc/proxy-settings.md) | Optional proxy configuration to route HTTP requests through a proxy server. |
52
+
53
+ The API client can be initialized as follows:
54
+
55
+ ### Code-Based Client Initialization
56
+
57
+ ```python
58
+ from apimaticcalculator.apimaticcalculator_client import ApimaticcalculatorClient
59
+ from apimaticcalculator.configuration import Environment
60
+
61
+ client = ApimaticcalculatorClient(
62
+ environment=Environment.PRODUCTION
63
+ )
64
+ ```
65
+
66
+ ### Environment-Based Client Initialization
67
+
68
+ ```python
69
+ from apimaticcalculator.apimaticcalculator_client import ApimaticcalculatorClient
70
+
71
+ # Specify the path to your .env file if it’s located outside the project’s root directory.
72
+ client = ApimaticcalculatorClient.from_environment(dotenv_path='/path/to/.env')
73
+ ```
74
+
75
+ See the [Environment-Based Client Initialization](https://www.github.com/WasifMatic/acme-python-sdk/tree/0.1.5/doc/environment-based-client-initialization.md) section for details.
76
+
77
+ ## List of APIs
78
+
79
+ * [Simple Calculator](https://www.github.com/WasifMatic/acme-python-sdk/tree/0.1.5/doc/controllers/simple-calculator.md)
80
+
81
+ ## SDK Infrastructure
82
+
83
+ ### Configuration
84
+
85
+ * [ProxySettings](https://www.github.com/WasifMatic/acme-python-sdk/tree/0.1.5/doc/proxy-settings.md)
86
+ * [Environment-Based Client Initialization](https://www.github.com/WasifMatic/acme-python-sdk/tree/0.1.5/doc/environment-based-client-initialization.md)
87
+
88
+ ### HTTP
89
+
90
+ * [HttpResponse](https://www.github.com/WasifMatic/acme-python-sdk/tree/0.1.5/doc/http-response.md)
91
+ * [HttpRequest](https://www.github.com/WasifMatic/acme-python-sdk/tree/0.1.5/doc/http-request.md)
92
+
93
+ ### Utilities
94
+
95
+ * [ApiHelper](https://www.github.com/WasifMatic/acme-python-sdk/tree/0.1.5/doc/api-helper.md)
96
+ * [HttpDateTime](https://www.github.com/WasifMatic/acme-python-sdk/tree/0.1.5/doc/http-date-time.md)
97
+ * [RFC3339DateTime](https://www.github.com/WasifMatic/acme-python-sdk/tree/0.1.5/doc/rfc3339-date-time.md)
98
+ * [UnixDateTime](https://www.github.com/WasifMatic/acme-python-sdk/tree/0.1.5/doc/unix-date-time.md)
99
+
cliv1-0.1.5/README.md ADDED
@@ -0,0 +1,84 @@
1
+
2
+ # Getting Started with APIMATIC Calculator
3
+
4
+ ## Introduction
5
+
6
+ Simple calculator API hosted on APIMATIC
7
+
8
+ ## Install the Package
9
+
10
+ The package is compatible with Python versions `3.7+`.
11
+ Install the package from PyPi using the following pip command:
12
+
13
+ ```bash
14
+ pip install cliV1==0.1.5
15
+ ```
16
+
17
+ You can also view the package at:
18
+ https://pypi.python.org/pypi/cliV1/0.1.5
19
+
20
+ ## Initialize the API Client
21
+
22
+ **_Note:_** Documentation for the client can be found [here.](https://www.github.com/WasifMatic/acme-python-sdk/tree/0.1.5/doc/client.md)
23
+
24
+ The following parameters are configurable for the API Client:
25
+
26
+ | Parameter | Type | Description |
27
+ | --- | --- | --- |
28
+ | http_client_instance | `Union[Session, HttpClientProvider]` | The Http Client passed from the sdk user for making requests |
29
+ | override_http_client_configuration | `bool` | The value which determines to override properties of the passed Http Client from the sdk user |
30
+ | http_call_back | `HttpCallBack` | The callback value that is invoked before and after an HTTP call is made to an endpoint |
31
+ | timeout | `float` | The value to use for connection timeout. <br> **Default: 60** |
32
+ | max_retries | `int` | The number of times to retry an endpoint call if it fails. <br> **Default: 0** |
33
+ | backoff_factor | `float` | A backoff factor to apply between attempts after the second try. <br> **Default: 2** |
34
+ | retry_statuses | `Array of int` | The http statuses on which retry is to be done. <br> **Default: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524]** |
35
+ | retry_methods | `Array of string` | The http methods on which retry is to be done. <br> **Default: ["GET", "PUT"]** |
36
+ | proxy_settings | [`ProxySettings`](https://www.github.com/WasifMatic/acme-python-sdk/tree/0.1.5/doc/proxy-settings.md) | Optional proxy configuration to route HTTP requests through a proxy server. |
37
+
38
+ The API client can be initialized as follows:
39
+
40
+ ### Code-Based Client Initialization
41
+
42
+ ```python
43
+ from apimaticcalculator.apimaticcalculator_client import ApimaticcalculatorClient
44
+ from apimaticcalculator.configuration import Environment
45
+
46
+ client = ApimaticcalculatorClient(
47
+ environment=Environment.PRODUCTION
48
+ )
49
+ ```
50
+
51
+ ### Environment-Based Client Initialization
52
+
53
+ ```python
54
+ from apimaticcalculator.apimaticcalculator_client import ApimaticcalculatorClient
55
+
56
+ # Specify the path to your .env file if it’s located outside the project’s root directory.
57
+ client = ApimaticcalculatorClient.from_environment(dotenv_path='/path/to/.env')
58
+ ```
59
+
60
+ See the [Environment-Based Client Initialization](https://www.github.com/WasifMatic/acme-python-sdk/tree/0.1.5/doc/environment-based-client-initialization.md) section for details.
61
+
62
+ ## List of APIs
63
+
64
+ * [Simple Calculator](https://www.github.com/WasifMatic/acme-python-sdk/tree/0.1.5/doc/controllers/simple-calculator.md)
65
+
66
+ ## SDK Infrastructure
67
+
68
+ ### Configuration
69
+
70
+ * [ProxySettings](https://www.github.com/WasifMatic/acme-python-sdk/tree/0.1.5/doc/proxy-settings.md)
71
+ * [Environment-Based Client Initialization](https://www.github.com/WasifMatic/acme-python-sdk/tree/0.1.5/doc/environment-based-client-initialization.md)
72
+
73
+ ### HTTP
74
+
75
+ * [HttpResponse](https://www.github.com/WasifMatic/acme-python-sdk/tree/0.1.5/doc/http-response.md)
76
+ * [HttpRequest](https://www.github.com/WasifMatic/acme-python-sdk/tree/0.1.5/doc/http-request.md)
77
+
78
+ ### Utilities
79
+
80
+ * [ApiHelper](https://www.github.com/WasifMatic/acme-python-sdk/tree/0.1.5/doc/api-helper.md)
81
+ * [HttpDateTime](https://www.github.com/WasifMatic/acme-python-sdk/tree/0.1.5/doc/http-date-time.md)
82
+ * [RFC3339DateTime](https://www.github.com/WasifMatic/acme-python-sdk/tree/0.1.5/doc/rfc3339-date-time.md)
83
+ * [UnixDateTime](https://www.github.com/WasifMatic/acme-python-sdk/tree/0.1.5/doc/unix-date-time.md)
84
+
@@ -2,12 +2,11 @@
2
2
  # ruff: noqa: RUF022 | `__all__` is not sorted
3
3
  __all__ = [
4
4
  "api_helper",
5
- "apis",
5
+ "apimaticcalculator_client",
6
6
  "configuration",
7
+ "controllers",
7
8
  "exceptions",
8
9
  "http",
9
- "logging",
10
10
  "models",
11
- "swaggerpetstoreopenapi_30_client",
12
11
  "utilities",
13
12
  ]
@@ -1,5 +1,5 @@
1
1
  """
2
- swaggerpetstoreopenapi30
2
+ apimaticcalculator
3
3
 
4
4
  This file was automatically generated by APIMATIC v3.0 (
5
5
  https://www.apimatic.io ).
@@ -0,0 +1,63 @@
1
+ """apimaticcalculator.
2
+
3
+ This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
4
+ """
5
+
6
+ # ruff: noqa: E501
7
+ from apimatic_core.configurations.global_configuration import (
8
+ GlobalConfiguration,
9
+ )
10
+ from apimatic_core.decorators.lazy_property import (
11
+ LazyProperty,
12
+ )
13
+
14
+ from apimaticcalculator.configuration import (
15
+ Configuration,
16
+ Environment,
17
+ )
18
+ from apimaticcalculator.controllers.base_controller import (
19
+ BaseController,
20
+ )
21
+ from apimaticcalculator.controllers.simple_calculator_controller import (
22
+ SimpleCalculatorController,
23
+ )
24
+
25
+
26
+ class ApimaticcalculatorClient(object):
27
+ """Client that provide access to the ApimaticcalculatorClient APIs."""
28
+
29
+ @LazyProperty
30
+ def simple_calculator(self):
31
+ """Provide access to the SimpleCalculatorController endpoints."""
32
+ return SimpleCalculatorController(self.global_configuration)
33
+
34
+ def __init__(self, http_client_instance=None,
35
+ override_http_client_configuration=False, http_call_back=None,
36
+ timeout=60, max_retries=0, backoff_factor=2,
37
+ retry_statuses=None, retry_methods=None, proxy_settings=None,
38
+ environment=Environment.PRODUCTION, config=None):
39
+ """Initialize a new instance of ApimaticcalculatorClient."""
40
+ self.config = config or Configuration(
41
+ http_client_instance=http_client_instance,
42
+ override_http_client_configuration=override_http_client_configuration,
43
+ http_call_back=http_call_back, timeout=timeout,
44
+ max_retries=max_retries, backoff_factor=backoff_factor,
45
+ retry_statuses=retry_statuses, retry_methods=retry_methods,
46
+ proxy_settings=proxy_settings, environment=environment)
47
+
48
+ self.global_configuration = GlobalConfiguration(self.config)\
49
+ .global_errors(BaseController.global_errors())\
50
+ .base_uri_executor(self.config.get_base_uri)\
51
+ .user_agent(BaseController.user_agent(),
52
+ BaseController.user_agent_parameters())
53
+
54
+ @classmethod
55
+ def from_environment(cls, dotenv_path=None, **overrides):
56
+ """Create a client instance using environment variables.
57
+
58
+ Returns:
59
+ ApimaticcalculatorClient instance.
60
+
61
+ """
62
+ return cls(config=Configuration
63
+ .from_environment(dotenv_path=dotenv_path, **overrides))
@@ -1,4 +1,4 @@
1
- """swaggerpetstoreopenapi30.
1
+ """apimaticcalculator.
2
2
 
3
3
  This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
4
4
  """
@@ -15,17 +15,15 @@ from apimatic_requests_client_adapter.requests_client import (
15
15
  )
16
16
  from dotenv import load_dotenv
17
17
 
18
- from swaggerpetstoreopenapi30.http.proxy_settings import (
18
+ from apimaticcalculator.http.proxy_settings import (
19
19
  ProxySettings,
20
20
  )
21
- from swaggerpetstoreopenapi30.logging.configuration.api_logging_configuration import (
22
- LoggingConfiguration,
23
- )
24
21
 
25
22
 
26
23
  class Environment(Enum):
27
24
  """An enum for SDK environments."""
28
25
 
26
+ # This environment connect to the LIVE calculator API
29
27
  PRODUCTION = 0
30
28
 
31
29
  @classmethod
@@ -61,7 +59,6 @@ class Server(Enum):
61
59
  """An enum for API servers."""
62
60
 
63
61
  DEFAULT = 0
64
- AUTH_SERVER = 1
65
62
 
66
63
  @classmethod
67
64
  def from_value(cls, value, default=None):
@@ -100,29 +97,18 @@ class Configuration(HttpClientConfiguration):
100
97
  """Return current environment."""
101
98
  return self._environment
102
99
 
103
- @property
104
- def petstore_auth_credentials(self):
105
- """Return current petstore_auth_credentials."""
106
- return self._petstore_auth_credentials
107
-
108
- @property
109
- def api_key_credentials(self):
110
- """Return current api_key_credentials."""
111
- return self._api_key_credentials
112
-
113
100
  def __init__(self, http_client_instance=None,
114
101
  override_http_client_configuration=False, http_call_back=None,
115
- timeout=30, max_retries=0, backoff_factor=2, retry_statuses=None,
116
- retry_methods=None, proxy_settings=None, logging_configuration=None,
117
- environment=Environment.PRODUCTION, petstore_auth_credentials=None,
118
- api_key_credentials=None):
102
+ timeout=60, max_retries=0, backoff_factor=2, retry_statuses=None,
103
+ retry_methods=None, proxy_settings=None,
104
+ environment=Environment.PRODUCTION):
119
105
  """Initialize Configuration object."""
120
106
  if retry_methods is None:
121
- retry_methods = ["GET", "PUT", "GET", "PUT"]
107
+ retry_methods = ["GET", "PUT"]
122
108
 
123
109
  if retry_statuses is None:
124
110
  retry_statuses = [408, 413, 429, 500, 502, 503, 504, 521,
125
- 522, 524, 408, 413, 429, 500, 502, 503, 504, 521, 522, 524]
111
+ 522, 524]
126
112
 
127
113
  super().__init__(
128
114
  http_client_instance=http_client_instance,
@@ -131,18 +117,11 @@ class Configuration(HttpClientConfiguration):
131
117
  max_retries=max_retries, backoff_factor=backoff_factor,
132
118
  retry_statuses=retry_statuses, retry_methods=retry_methods,
133
119
  proxy_settings=proxy_settings,
134
- logging_configuration=logging_configuration,
135
120
  )
136
121
 
137
122
  # Current API environment
138
123
  self._environment = environment
139
124
 
140
- # The object holding OAuth 2 Implicit Grant credentials
141
- self._petstore_auth_credentials = petstore_auth_credentials
142
-
143
- # The object holding Custom Header Signature credentials
144
- self._api_key_credentials = api_key_credentials
145
-
146
125
  # The Http Client to use for making requests.
147
126
  self.set_http_client(self.create_http_client())
148
127
 
@@ -150,8 +129,7 @@ class Configuration(HttpClientConfiguration):
150
129
  override_http_client_configuration=None, http_call_back=None,
151
130
  timeout=None, max_retries=None, backoff_factor=None,
152
131
  retry_statuses=None, retry_methods=None, proxy_settings=None,
153
- logging_configuration=None, environment=None,
154
- petstore_auth_credentials=None, api_key_credentials=None):
132
+ environment=None):
155
133
  """Clone configuration with overrides."""
156
134
  http_client_instance = http_client_instance or self.http_client_instance
157
135
  override_http_client_configuration =\
@@ -164,21 +142,14 @@ class Configuration(HttpClientConfiguration):
164
142
  retry_statuses = retry_statuses or self.retry_statuses
165
143
  retry_methods = retry_methods or self.retry_methods
166
144
  proxy_settings = proxy_settings or self.proxy_settings
167
- logging_configuration = logging_configuration or self.logging_configuration
168
145
  environment = environment or self.environment
169
- petstore_auth_credentials =\
170
- (petstore_auth_credentials
171
- or self.petstore_auth_credentials)
172
- api_key_credentials = api_key_credentials or self.api_key_credentials
173
146
  return Configuration(
174
147
  http_client_instance=http_client_instance,
175
148
  override_http_client_configuration=override_http_client_configuration,
176
149
  http_call_back=http_call_back, timeout=timeout, max_retries=max_retries,
177
150
  backoff_factor=backoff_factor, retry_statuses=retry_statuses,
178
151
  retry_methods=retry_methods, proxy_settings=proxy_settings,
179
- logging_configuration=logging_configuration, environment=environment,
180
- petstore_auth_credentials=petstore_auth_credentials,
181
- api_key_credentials=api_key_credentials,
152
+ environment=environment,
182
153
  )
183
154
 
184
155
  def create_http_client(self):
@@ -196,8 +167,7 @@ class Configuration(HttpClientConfiguration):
196
167
  # All the environments the SDK can run in
197
168
  environments = {
198
169
  Environment.PRODUCTION: {
199
- Server.DEFAULT: "https://petstore3.swagger.io/api/v3",
200
- Server.AUTH_SERVER: "https://petstore3.swagger.io/oauth",
170
+ Server.DEFAULT: "https://examples.apimatic.io/apps/calculator",
201
171
  },
202
172
  }
203
173
 
@@ -232,7 +202,7 @@ class Configuration(HttpClientConfiguration):
232
202
 
233
203
  override_http_client_configuration = os.getenv(
234
204
  "OVERRIDE_HTTP_CLIENT_CONFIGURATION", "false").lower() == "true"
235
- timeout = int(os.getenv("TIMEOUT", "30"))
205
+ timeout = int(os.getenv("TIMEOUT", "60"))
236
206
  max_retries = int(os.getenv("MAX_RETRIES", "0"))
237
207
  backoff_factor = float(os.getenv("BACKOFF_FACTOR", "2"))
238
208
  statuses = os.getenv("RETRY_STATUSES", None)
@@ -244,13 +214,6 @@ class Configuration(HttpClientConfiguration):
244
214
  environment = Environment.from_value(
245
215
  os.getenv("ENVIRONMENT"), Environment.PRODUCTION)
246
216
 
247
- from swaggerpetstoreopenapi30.http.auth.api_key import (
248
- ApiKeyCredentials,
249
- )
250
- from swaggerpetstoreopenapi30.http.auth.petstore_auth import (
251
- PetstoreAuthCredentials,
252
- )
253
-
254
217
  # Preparing default configuration
255
218
  default_config = cls(
256
219
  override_http_client_configuration=override_http_client_configuration,
@@ -261,9 +224,6 @@ class Configuration(HttpClientConfiguration):
261
224
  retry_methods=retry_methods,
262
225
  environment=environment,
263
226
  proxy_settings=ProxySettings.from_environment(),
264
- logging_configuration=LoggingConfiguration.from_environment(),
265
- petstore_auth_credentials=PetstoreAuthCredentials.from_environment(),
266
- api_key_credentials=ApiKeyCredentials.from_environment(),
267
227
  )
268
228
 
269
229
  return default_config.clone_with(**overrides)
@@ -1,6 +1,6 @@
1
1
  # ruff: noqa: D104 | Missing docstring in public package
2
2
  # ruff: noqa: RUF022 | `__all__` is not sorted
3
3
  __all__ = [
4
- "api_key",
5
- "petstore_auth",
4
+ "base_controller",
5
+ "simple_calculator_controller",
6
6
  ]
@@ -1,19 +1,17 @@
1
- """swaggerpetstoreopenapi30.
1
+ """apimaticcalculator.
2
2
 
3
3
  This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
4
4
  """
5
5
 
6
- import platform
7
-
8
6
  from apimatic_core.api_call import ApiCall
9
7
  from apimatic_core.types.error_case import ErrorCase
10
8
 
11
- from swaggerpetstoreopenapi30.exceptions.api_exception import (
12
- ApiException,
9
+ from apimaticcalculator.exceptions.api_exception import (
10
+ APIException,
13
11
  )
14
12
 
15
13
 
16
- class BaseApi(object):
14
+ class BaseController(object):
17
15
  """All controllers inherit from this base class.
18
16
 
19
17
  Attributes:
@@ -30,15 +28,12 @@ class BaseApi(object):
30
28
  @staticmethod
31
29
  def user_agent():
32
30
  """Return UserAgent value."""
33
- return "Python-SDK/0.1.4 (OS: {os-info}, Engine: {engine}/{engine-version})"
31
+ return "APIMATIC 3.0"
34
32
 
35
33
  @staticmethod
36
34
  def user_agent_parameters():
37
35
  """Return UserAgentParameters value."""
38
36
  return {
39
- "engine": {"value": platform.python_implementation(), "encode": False},
40
- "engine-version": {"value": platform.python_version(), "encode": False},
41
- "os-info": {"value": platform.system(), "encode": False},
42
37
  }
43
38
 
44
39
  @staticmethod
@@ -47,11 +42,11 @@ class BaseApi(object):
47
42
  return {
48
43
  "default": ErrorCase()
49
44
  .error_message("HTTP response not OK.")
50
- .exception_type(ApiException),
45
+ .exception_type(APIException),
51
46
  }
52
47
 
53
48
  def __init__(self, config):
54
- """Initialize BaseApi object."""
49
+ """Initialize BaseController object."""
55
50
  self._config = config.get_http_client_configuration()
56
51
  self._http_call_back = self.config.http_callback
57
52
  self.api_call = ApiCall(config)
@@ -0,0 +1,69 @@
1
+ """apimaticcalculator.
2
+
3
+ This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
4
+ """
5
+
6
+ # ruff: noqa: D410, E501, E101, D206
7
+ from apimatic_core.request_builder import RequestBuilder
8
+ from apimatic_core.response_handler import ResponseHandler
9
+ from apimatic_core.types.parameter import Parameter
10
+
11
+ from apimaticcalculator.api_helper import APIHelper
12
+ from apimaticcalculator.configuration import (
13
+ Server,
14
+ )
15
+ from apimaticcalculator.controllers.base_controller import (
16
+ BaseController,
17
+ )
18
+ from apimaticcalculator.http.http_method_enum import (
19
+ HttpMethodEnum,
20
+ )
21
+
22
+
23
+ class SimpleCalculatorController(BaseController):
24
+ """A Controller to access Endpoints in the apimaticcalculator API."""
25
+
26
+ def __init__(self, config):
27
+ """Initialize SimpleCalculatorController object."""
28
+ super(SimpleCalculatorController, self).__init__(config)
29
+
30
+ def calculate(self,
31
+ operation,
32
+ x,
33
+ y):
34
+ """Perform a GET request to /{operation}.
35
+
36
+ Calculates the expression using the specified operation.
37
+
38
+ Args:
39
+ operation (OperationTypeEnum): The operator to apply on the variables
40
+ x (float): The LHS value
41
+ y (float): The RHS value
42
+
43
+ Returns:
44
+ float: Response from the API.
45
+
46
+ Raises:
47
+ APIException: When an error occurs while fetching the data from the
48
+ remote API. This exception includes the HTTP Response code, an error
49
+ message, and the HTTP body that was received in the request.
50
+
51
+ """
52
+ return super().new_api_call_builder.request(
53
+ RequestBuilder().server(Server.DEFAULT)
54
+ .path("/{operation}")
55
+ .http_method(HttpMethodEnum.GET)
56
+ .template_param(Parameter()
57
+ .key("operation")
58
+ .value(operation)
59
+ .should_encode(True))
60
+ .query_param(Parameter()
61
+ .key("x")
62
+ .value(x))
63
+ .query_param(Parameter()
64
+ .key("y")
65
+ .value(y)),
66
+ ).response(
67
+ ResponseHandler()
68
+ .deserializer(APIHelper.json_deserialize),
69
+ ).execute()
@@ -2,5 +2,4 @@
2
2
  # ruff: noqa: RUF022 | `__all__` is not sorted
3
3
  __all__ = [
4
4
  "api_exception",
5
- "oauth_provider_exception",
6
5
  ]
@@ -1,10 +1,10 @@
1
- """swaggerpetstoreopenapi30.
1
+ """apimaticcalculator.
2
2
 
3
3
  This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
4
4
  """
5
5
 
6
6
 
7
- class ApiException(Exception):
7
+ class APIException(Exception):
8
8
  """Class that handles HTTP Exceptions when fetching API Endpoints.
9
9
 
10
10
  Attributes:
@@ -16,7 +16,7 @@ class ApiException(Exception):
16
16
  def __init__(self,
17
17
  reason,
18
18
  response):
19
- """Initialize ApiException object.
19
+ """Initialize APIException object.
20
20
 
21
21
  Args:
22
22
  reason (string): The reason (or error message) for the Exception
@@ -24,7 +24,7 @@ class ApiException(Exception):
24
24
  response (HttpResponse): The HttpResponse of the API call.
25
25
 
26
26
  """
27
- super(ApiException, self).__init__(reason)
27
+ super(APIException, self).__init__(reason)
28
28
  self.reason = reason
29
29
  self.response = response
30
30
  self.response_code = response.status_code
@@ -1,7 +1,6 @@
1
1
  # ruff: noqa: D104 | Missing docstring in public package
2
2
  # ruff: noqa: RUF022 | `__all__` is not sorted
3
3
  __all__ = [
4
- "auth",
5
4
  "http_call_back",
6
5
  "http_client_provider",
7
6
  "http_method_enum",
@@ -1,6 +1,6 @@
1
1
 
2
2
  """
3
- swaggerpetstoreopenapi30
3
+ apimaticcalculator
4
4
 
5
5
  This file was automatically generated by APIMATIC v3.0 (
6
6
  https://www.apimatic.io ).
@@ -1,5 +1,5 @@
1
1
  """
2
- swaggerpetstoreopenapi30
2
+ apimaticcalculator
3
3
 
4
4
  This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
5
5
  """
@@ -1,6 +1,6 @@
1
1
 
2
2
  """
3
- swaggerpetstoreopenapi30
3
+ apimaticcalculator
4
4
 
5
5
  This file was automatically generated by APIMATIC v3.0 (
6
6
  https://www.apimatic.io ).
@@ -1,6 +1,6 @@
1
1
 
2
2
  """
3
- swaggerpetstoreopenapi30
3
+ apimaticcalculator
4
4
 
5
5
  This file was automatically generated by APIMATIC v3.0 (
6
6
  https://www.apimatic.io ).
@@ -1,6 +1,6 @@
1
1
 
2
2
  """
3
- swaggerpetstoreopenapi30
3
+ apimaticcalculator
4
4
 
5
5
  This file was automatically generated by APIMATIC v3.0 (
6
6
  https://www.apimatic.io ).
@@ -1,5 +1,5 @@
1
1
  """
2
- swaggerpetstoreopenapi30
2
+ apimaticcalculator
3
3
 
4
4
  This file was automatically generated by APIMATIC v3.0 (
5
5
  https://www.apimatic.io ).