cmdop-observations 0.1.0__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 (77) hide show
  1. cmdop_observations-0.1.0/LICENSE +21 -0
  2. cmdop_observations-0.1.0/PKG-INFO +34 -0
  3. cmdop_observations-0.1.0/README.md +20 -0
  4. cmdop_observations-0.1.0/THIRD_PARTY_NOTICES +79 -0
  5. cmdop_observations-0.1.0/cmdop_promo_marketing/__init__.py +8 -0
  6. cmdop_observations-0.1.0/cmdop_promo_marketing/api/__init__.py +1 -0
  7. cmdop_observations-0.1.0/cmdop_promo_marketing/api/marketing/__init__.py +1 -0
  8. cmdop_observations-0.1.0/cmdop_promo_marketing/api/marketing/acquisition_signup.py +127 -0
  9. cmdop_observations-0.1.0/cmdop_promo_marketing/api/marketing/acquisition_touch_report.py +113 -0
  10. cmdop_observations-0.1.0/cmdop_promo_marketing/api/marketing/marketing_ingest_create.py +188 -0
  11. cmdop_observations-0.1.0/cmdop_promo_marketing/api/marketing/marketing_ingest_status.py +140 -0
  12. cmdop_observations-0.1.0/cmdop_promo_marketing/api/marketing/marketing_promo_events_create.py +196 -0
  13. cmdop_observations-0.1.0/cmdop_promo_marketing/api/marketing/marketing_promo_summary.py +186 -0
  14. cmdop_observations-0.1.0/cmdop_promo_marketing/api/marketing/star_account_answer.py +187 -0
  15. cmdop_observations-0.1.0/cmdop_promo_marketing/api/marketing/star_account_shown.py +187 -0
  16. cmdop_observations-0.1.0/cmdop_promo_marketing/api/marketing/star_account_state.py +161 -0
  17. cmdop_observations-0.1.0/cmdop_promo_marketing/api/marketing/star_account_thanked.py +187 -0
  18. cmdop_observations-0.1.0/cmdop_promo_marketing/api/marketing/star_answer.py +166 -0
  19. cmdop_observations-0.1.0/cmdop_promo_marketing/api/marketing/star_shown.py +166 -0
  20. cmdop_observations-0.1.0/cmdop_promo_marketing/api/marketing/star_state.py +128 -0
  21. cmdop_observations-0.1.0/cmdop_promo_marketing/api/marketing/star_thanked.py +166 -0
  22. cmdop_observations-0.1.0/cmdop_promo_marketing/client.py +282 -0
  23. cmdop_observations-0.1.0/cmdop_promo_marketing/errors.py +16 -0
  24. cmdop_observations-0.1.0/cmdop_promo_marketing/models/__init__.py +97 -0
  25. cmdop_observations-0.1.0/cmdop_promo_marketing/models/action_enum.py +15 -0
  26. cmdop_observations-0.1.0/cmdop_promo_marketing/models/answer_enum.py +10 -0
  27. cmdop_observations-0.1.0/cmdop_promo_marketing/models/arch_enum.py +9 -0
  28. cmdop_observations-0.1.0/cmdop_promo_marketing/models/ask_enum.py +10 -0
  29. cmdop_observations-0.1.0/cmdop_promo_marketing/models/author_enum.py +9 -0
  30. cmdop_observations-0.1.0/cmdop_promo_marketing/models/client_kind_enum.py +15 -0
  31. cmdop_observations-0.1.0/cmdop_promo_marketing/models/client_row_request.py +113 -0
  32. cmdop_observations-0.1.0/cmdop_promo_marketing/models/coverage_status_enum.py +9 -0
  33. cmdop_observations-0.1.0/cmdop_promo_marketing/models/day_row_request.py +205 -0
  34. cmdop_observations-0.1.0/cmdop_promo_marketing/models/door_enum.py +10 -0
  35. cmdop_observations-0.1.0/cmdop_promo_marketing/models/error_category_enum.py +21 -0
  36. cmdop_observations-0.1.0/cmdop_promo_marketing/models/event_enum.py +11 -0
  37. cmdop_observations-0.1.0/cmdop_promo_marketing/models/event_row_request.py +98 -0
  38. cmdop_observations-0.1.0/cmdop_promo_marketing/models/forget_row_request.py +72 -0
  39. cmdop_observations-0.1.0/cmdop_promo_marketing/models/machine_row_request.py +165 -0
  40. cmdop_observations-0.1.0/cmdop_promo_marketing/models/marketing_ingest_accepted.py +85 -0
  41. cmdop_observations-0.1.0/cmdop_promo_marketing/models/marketing_ingest_batch_request.py +190 -0
  42. cmdop_observations-0.1.0/cmdop_promo_marketing/models/marketing_ingest_error.py +72 -0
  43. cmdop_observations-0.1.0/cmdop_promo_marketing/models/marketing_ingest_status.py +96 -0
  44. cmdop_observations-0.1.0/cmdop_promo_marketing/models/os_enum.py +10 -0
  45. cmdop_observations-0.1.0/cmdop_promo_marketing/models/platform_enum.py +11 -0
  46. cmdop_observations-0.1.0/cmdop_promo_marketing/models/population_enum.py +8 -0
  47. cmdop_observations-0.1.0/cmdop_promo_marketing/models/promo_accepted.py +69 -0
  48. cmdop_observations-0.1.0/cmdop_promo_marketing/models/promo_action_count.py +84 -0
  49. cmdop_observations-0.1.0/cmdop_promo_marketing/models/promo_batch_request.py +116 -0
  50. cmdop_observations-0.1.0/cmdop_promo_marketing/models/promo_error.py +76 -0
  51. cmdop_observations-0.1.0/cmdop_promo_marketing/models/promo_error_error_enum.py +21 -0
  52. cmdop_observations-0.1.0/cmdop_promo_marketing/models/promo_event_request.py +197 -0
  53. cmdop_observations-0.1.0/cmdop_promo_marketing/models/promo_finish_count.py +81 -0
  54. cmdop_observations-0.1.0/cmdop_promo_marketing/models/promo_package_summary.py +242 -0
  55. cmdop_observations-0.1.0/cmdop_promo_marketing/models/promo_permission_error.py +61 -0
  56. cmdop_observations-0.1.0/cmdop_promo_marketing/models/promo_stage_count.py +98 -0
  57. cmdop_observations-0.1.0/cmdop_promo_marketing/models/promo_summary.py +146 -0
  58. cmdop_observations-0.1.0/cmdop_promo_marketing/models/registry_enum.py +9 -0
  59. cmdop_observations-0.1.0/cmdop_promo_marketing/models/result_enum.py +12 -0
  60. cmdop_observations-0.1.0/cmdop_promo_marketing/models/risk_enum.py +14 -0
  61. cmdop_observations-0.1.0/cmdop_promo_marketing/models/runtime_enum.py +9 -0
  62. cmdop_observations-0.1.0/cmdop_promo_marketing/models/signup_request_request.py +145 -0
  63. cmdop_observations-0.1.0/cmdop_promo_marketing/models/source_enum.py +8 -0
  64. cmdop_observations-0.1.0/cmdop_promo_marketing/models/stage_enum.py +16 -0
  65. cmdop_observations-0.1.0/cmdop_promo_marketing/models/star_answer_request.py +77 -0
  66. cmdop_observations-0.1.0/cmdop_promo_marketing/models/star_error.py +61 -0
  67. cmdop_observations-0.1.0/cmdop_promo_marketing/models/star_shown_request.py +66 -0
  68. cmdop_observations-0.1.0/cmdop_promo_marketing/models/star_state.py +109 -0
  69. cmdop_observations-0.1.0/cmdop_promo_marketing/models/surface_enum.py +11 -0
  70. cmdop_observations-0.1.0/cmdop_promo_marketing/models/touch_request_request.py +126 -0
  71. cmdop_observations-0.1.0/cmdop_promo_marketing/openapi.json +1947 -0
  72. cmdop_observations-0.1.0/cmdop_promo_marketing/types.py +54 -0
  73. cmdop_observations-0.1.0/cmdop_promo_marketing/wrapper.py +146 -0
  74. cmdop_observations-0.1.0/cmdop_promo_observations/__init__.py +6 -0
  75. cmdop_observations-0.1.0/cmdop_promo_observations/adapter.py +193 -0
  76. cmdop_observations-0.1.0/cmdop_promo_observations/session.py +148 -0
  77. cmdop_observations-0.1.0/pyproject.toml +25 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 CMDOP
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,34 @@
1
+ Metadata-Version: 2.4
2
+ Name: cmdop-observations
3
+ Version: 0.1.0
4
+ Summary: Shared opt-in CMDOP launcher observations with bounded best-effort delivery
5
+ Project-URL: Homepage, https://cmdop.ai
6
+ License-Expression: MIT
7
+ License-File: LICENSE
8
+ License-File: THIRD_PARTY_NOTICES
9
+ Requires-Python: >=3.10
10
+ Requires-Dist: attrs==25.4.0
11
+ Requires-Dist: httpx==0.28.1
12
+ Requires-Dist: python-dateutil==2.9.0.post0
13
+ Description-Content-Type: text/markdown
14
+
15
+ # CMDOP Observations
16
+
17
+ Shared Python and JavaScript client for optional usage analytics from CMDOP launchers. CMDOP: https://cmdop.ai.
18
+
19
+ This is an optional usage-event reporting client, not the official CMDOP SDK and not a launcher installer. Official SDK packages are `@cmdop/sdk` and `cmdop`. Launchers supply an exact enrolled identity and receiver origin.
20
+
21
+ Nothing is sent on installation or import. The handwritten observation session requires explicit one-run consent, respects DNT, buffers only bounded closed event values in memory and attempts one credential-free send with a total 500 ms budget. No retry or disk queue. The caller must preserve its useful result and exit status when sharing fails. Missing observations do not mean no usage.
22
+
23
+ Node requires 20 or newer and exports `ObservationSession`, `shareObservations`, the event-report and summary operations and DTO schemas. Python requires 3.10 or newer and keeps `cmdop_promo_marketing` and `cmdop_promo_observations` imports. The generated Python package also contains protected marketing methods; their presence grants no permission and does not enable anonymous activation/account writes. Use the observation session for launcher sharing rather than constructing arbitrary event properties.
24
+
25
+ The server accepts only exact enabled package identities and enforces schema, replay, age, body, rate and daily quota limits. Client labels can be spoofed and are never proof of installations, unique people or trusted product activation. Summary access requires the backend's operator permission.
26
+
27
+ For the SDK action, a session can report caller-supplied install, import and example-file outcomes.
28
+ It projects only closed stage/result values; project paths, changes and diagnostics are excluded.
29
+ Creating an example means writing a file, not running it, authorizing access or connecting a machine.
30
+ The receiver must support the SDK stage contract before an integrated launcher enables those events.
31
+
32
+ Installing this library does not enroll a package identity or enable event collection. Production package profiles and reviewed enrollment are separate. No machine connection, SDK installation, account login or product activation is performed by this client.
33
+
34
+ License: MIT, with template notices in THIRD_PARTY_NOTICES. Runtime dependencies retain their own licenses.
@@ -0,0 +1,20 @@
1
+ # CMDOP Observations
2
+
3
+ Shared Python and JavaScript client for optional usage analytics from CMDOP launchers. CMDOP: https://cmdop.ai.
4
+
5
+ This is an optional usage-event reporting client, not the official CMDOP SDK and not a launcher installer. Official SDK packages are `@cmdop/sdk` and `cmdop`. Launchers supply an exact enrolled identity and receiver origin.
6
+
7
+ Nothing is sent on installation or import. The handwritten observation session requires explicit one-run consent, respects DNT, buffers only bounded closed event values in memory and attempts one credential-free send with a total 500 ms budget. No retry or disk queue. The caller must preserve its useful result and exit status when sharing fails. Missing observations do not mean no usage.
8
+
9
+ Node requires 20 or newer and exports `ObservationSession`, `shareObservations`, the event-report and summary operations and DTO schemas. Python requires 3.10 or newer and keeps `cmdop_promo_marketing` and `cmdop_promo_observations` imports. The generated Python package also contains protected marketing methods; their presence grants no permission and does not enable anonymous activation/account writes. Use the observation session for launcher sharing rather than constructing arbitrary event properties.
10
+
11
+ The server accepts only exact enabled package identities and enforces schema, replay, age, body, rate and daily quota limits. Client labels can be spoofed and are never proof of installations, unique people or trusted product activation. Summary access requires the backend's operator permission.
12
+
13
+ For the SDK action, a session can report caller-supplied install, import and example-file outcomes.
14
+ It projects only closed stage/result values; project paths, changes and diagnostics are excluded.
15
+ Creating an example means writing a file, not running it, authorizing access or connecting a machine.
16
+ The receiver must support the SDK stage contract before an integrated launcher enables those events.
17
+
18
+ Installing this library does not enroll a package identity or enable event collection. Production package profiles and reviewed enrollment are separate. No machine connection, SDK installation, account login or product activation is performed by this client.
19
+
20
+ License: MIT, with template notices in THIRD_PARTY_NOTICES. Runtime dependencies retain their own licenses.
@@ -0,0 +1,79 @@
1
+ Third-party template notices
2
+
3
+ This package includes client code derived from the following MIT-licensed generator templates. Runtime dependencies are distributed separately under their own licenses. These notices do not license unrelated Promo aliases or SDK implementations.
4
+
5
+ django-cfg
6
+ ==========
7
+
8
+ MIT License
9
+
10
+ Copyright (c) 2025 ReformsAI Team
11
+
12
+ Permission is hereby granted, free of charge, to any person obtaining a copy
13
+ of this software and associated documentation files (the "Software"), to deal
14
+ in the Software without restriction, including without limitation the rights
15
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
16
+ copies of the Software, and to permit persons to whom the Software is
17
+ furnished to do so, subject to the following conditions:
18
+
19
+ The above copyright notice and this permission notice shall be included in all
20
+ copies or substantial portions of the Software.
21
+
22
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28
+ SOFTWARE.
29
+
30
+ Orval 8.48.0
31
+ ============
32
+
33
+ MIT License
34
+
35
+ Copyright (c) 2022-present Victor Bury
36
+
37
+ Permission is hereby granted, free of charge, to any person obtaining a copy
38
+ of this software and associated documentation files (the "Software"), to deal
39
+ in the Software without restriction, including without limitation the rights
40
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
41
+ copies of the Software, and to permit persons to whom the Software is
42
+ furnished to do so, subject to the following conditions:
43
+
44
+ The above copyright notice and this permission notice shall be included in all
45
+ copies or substantial portions of the Software.
46
+
47
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
48
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
49
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
50
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
51
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
52
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
53
+ SOFTWARE.
54
+
55
+ openapi-python-client 0.28.4
56
+ ============================
57
+
58
+ MIT License
59
+
60
+ Copyright (c) 2020 Triax Technologies
61
+
62
+ Permission is hereby granted, free of charge, to any person obtaining a copy
63
+ of this software and associated documentation files (the "Software"), to deal
64
+ in the Software without restriction, including without limitation the rights
65
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
66
+ copies of the Software, and to permit persons to whom the Software is
67
+ furnished to do so, subject to the following conditions:
68
+
69
+ The above copyright notice and this permission notice shall be included in all
70
+ copies or substantial portions of the Software.
71
+
72
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
73
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
74
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
75
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
76
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
77
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
78
+ SOFTWARE.
79
+
@@ -0,0 +1,8 @@
1
+ """A client library for accessing CMDOP API"""
2
+
3
+ from .client import AuthenticatedClient, Client
4
+
5
+ __all__ = (
6
+ "AuthenticatedClient",
7
+ "Client",
8
+ )
@@ -0,0 +1 @@
1
+ """Contains methods for accessing the API"""
@@ -0,0 +1 @@
1
+ """Contains endpoint functions for accessing the API"""
@@ -0,0 +1,127 @@
1
+ from http import HTTPStatus
2
+ from typing import Any
3
+
4
+ import httpx
5
+
6
+ from ... import errors
7
+ from ...client import AuthenticatedClient, Client
8
+ from ...models.signup_request_request import SignupRequestRequest
9
+ from ...types import Response
10
+
11
+
12
+ def _get_kwargs(
13
+ *,
14
+ body: SignupRequestRequest,
15
+ ) -> dict[str, Any]:
16
+ headers: dict[str, Any] = {}
17
+
18
+ _kwargs: dict[str, Any] = {
19
+ "method": "post",
20
+ "url": "/apix/marketing/signup/",
21
+ }
22
+
23
+ _kwargs["json"] = body.to_dict()
24
+
25
+ headers["Content-Type"] = "application/json"
26
+
27
+ _kwargs["headers"] = headers
28
+ return _kwargs
29
+
30
+
31
+ def _parse_response(
32
+ *, client: AuthenticatedClient | Client, response: httpx.Response
33
+ ) -> Any | None:
34
+ if response.status_code == 204:
35
+ return None
36
+
37
+ if response.status_code == 400:
38
+ return None
39
+
40
+ if response.status_code == 429:
41
+ return None
42
+
43
+ if client.raise_on_unexpected_status:
44
+ raise errors.UnexpectedStatus(response.status_code, response.content)
45
+ else:
46
+ return None
47
+
48
+
49
+ def _build_response(
50
+ *, client: AuthenticatedClient | Client, response: httpx.Response
51
+ ) -> Response[Any]:
52
+ return Response(
53
+ status_code=HTTPStatus(response.status_code),
54
+ content=response.content,
55
+ headers=response.headers,
56
+ parsed=_parse_response(client=client, response=response),
57
+ )
58
+
59
+
60
+ def sync_detailed(
61
+ *,
62
+ client: AuthenticatedClient,
63
+ body: SignupRequestRequest,
64
+ ) -> Response[Any]:
65
+ """Make the account for an email typed on the Download page
66
+
67
+ The Download page's sign-up: the email makes the account at once, with no code and no letter (the
68
+ first real
69
+ sign-in asks for the code). Open, limited per IP; the answer is 204 for a new or an existing account
70
+ alike, so it tells
71
+ nobody whether an address has an account. 400 only for an address that is not a real mailbox.
72
+
73
+ Args:
74
+ body (SignupRequestRequest): The email typed on the Download page, and the touch the visit
75
+ carried (the same fields as `TouchRequest`).
76
+
77
+ Raises:
78
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
79
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
80
+
81
+ Returns:
82
+ Response[Any]
83
+ """
84
+
85
+ kwargs = _get_kwargs(
86
+ body=body,
87
+ )
88
+
89
+ response = client.get_httpx_client().request(
90
+ **kwargs,
91
+ )
92
+
93
+ return _build_response(client=client, response=response)
94
+
95
+
96
+ async def asyncio_detailed(
97
+ *,
98
+ client: AuthenticatedClient,
99
+ body: SignupRequestRequest,
100
+ ) -> Response[Any]:
101
+ """Make the account for an email typed on the Download page
102
+
103
+ The Download page's sign-up: the email makes the account at once, with no code and no letter (the
104
+ first real
105
+ sign-in asks for the code). Open, limited per IP; the answer is 204 for a new or an existing account
106
+ alike, so it tells
107
+ nobody whether an address has an account. 400 only for an address that is not a real mailbox.
108
+
109
+ Args:
110
+ body (SignupRequestRequest): The email typed on the Download page, and the touch the visit
111
+ carried (the same fields as `TouchRequest`).
112
+
113
+ Raises:
114
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
115
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
116
+
117
+ Returns:
118
+ Response[Any]
119
+ """
120
+
121
+ kwargs = _get_kwargs(
122
+ body=body,
123
+ )
124
+
125
+ response = await client.get_async_httpx_client().request(**kwargs)
126
+
127
+ return _build_response(client=client, response=response)
@@ -0,0 +1,113 @@
1
+ from http import HTTPStatus
2
+ from typing import Any
3
+
4
+ import httpx
5
+
6
+ from ... import errors
7
+ from ...client import AuthenticatedClient, Client
8
+ from ...models.touch_request_request import TouchRequestRequest
9
+ from ...types import UNSET, Response, Unset
10
+
11
+
12
+ def _get_kwargs(
13
+ *,
14
+ body: TouchRequestRequest | Unset = UNSET,
15
+ ) -> dict[str, Any]:
16
+ headers: dict[str, Any] = {}
17
+
18
+ _kwargs: dict[str, Any] = {
19
+ "method": "post",
20
+ "url": "/apix/marketing/touch/",
21
+ }
22
+
23
+ if not isinstance(body, Unset):
24
+ _kwargs["json"] = body.to_dict()
25
+
26
+ headers["Content-Type"] = "application/json"
27
+
28
+ _kwargs["headers"] = headers
29
+ return _kwargs
30
+
31
+
32
+ def _parse_response(
33
+ *, client: AuthenticatedClient | Client, response: httpx.Response
34
+ ) -> Any | None:
35
+ if response.status_code == 204:
36
+ return None
37
+
38
+ if response.status_code == 400:
39
+ return None
40
+
41
+ if client.raise_on_unexpected_status:
42
+ raise errors.UnexpectedStatus(response.status_code, response.content)
43
+ else:
44
+ return None
45
+
46
+
47
+ def _build_response(
48
+ *, client: AuthenticatedClient | Client, response: httpx.Response
49
+ ) -> Response[Any]:
50
+ return Response(
51
+ status_code=HTTPStatus(response.status_code),
52
+ content=response.content,
53
+ headers=response.headers,
54
+ parsed=_parse_response(client=client, response=response),
55
+ )
56
+
57
+
58
+ def sync_detailed(
59
+ *,
60
+ client: AuthenticatedClient,
61
+ body: TouchRequestRequest | Unset = UNSET,
62
+ ) -> Response[Any]:
63
+ """Report the first campaign touch of the signed-in account
64
+
65
+ Args:
66
+ body (TouchRequestRequest | Unset): The first touch the browser carried. Every field is
67
+ optional; values outside the allowed shapes are dropped, not refused.
68
+
69
+ Raises:
70
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
71
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
72
+
73
+ Returns:
74
+ Response[Any]
75
+ """
76
+
77
+ kwargs = _get_kwargs(
78
+ body=body,
79
+ )
80
+
81
+ response = client.get_httpx_client().request(
82
+ **kwargs,
83
+ )
84
+
85
+ return _build_response(client=client, response=response)
86
+
87
+
88
+ async def asyncio_detailed(
89
+ *,
90
+ client: AuthenticatedClient,
91
+ body: TouchRequestRequest | Unset = UNSET,
92
+ ) -> Response[Any]:
93
+ """Report the first campaign touch of the signed-in account
94
+
95
+ Args:
96
+ body (TouchRequestRequest | Unset): The first touch the browser carried. Every field is
97
+ optional; values outside the allowed shapes are dropped, not refused.
98
+
99
+ Raises:
100
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
101
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
102
+
103
+ Returns:
104
+ Response[Any]
105
+ """
106
+
107
+ kwargs = _get_kwargs(
108
+ body=body,
109
+ )
110
+
111
+ response = await client.get_async_httpx_client().request(**kwargs)
112
+
113
+ return _build_response(client=client, response=response)
@@ -0,0 +1,188 @@
1
+ from http import HTTPStatus
2
+ from typing import Any
3
+
4
+ import httpx
5
+
6
+ from ... import errors
7
+ from ...client import AuthenticatedClient, Client
8
+ from ...models.marketing_ingest_accepted import MarketingIngestAccepted
9
+ from ...models.marketing_ingest_batch_request import MarketingIngestBatchRequest
10
+ from ...models.marketing_ingest_error import MarketingIngestError
11
+ from ...types import Response
12
+
13
+
14
+ def _get_kwargs(
15
+ *,
16
+ body: MarketingIngestBatchRequest,
17
+ ) -> dict[str, Any]:
18
+ headers: dict[str, Any] = {}
19
+
20
+ _kwargs: dict[str, Any] = {
21
+ "method": "post",
22
+ "url": "/apix/marketing/ingest/",
23
+ }
24
+
25
+ _kwargs["json"] = body.to_dict()
26
+
27
+ headers["Content-Type"] = "application/json"
28
+
29
+ _kwargs["headers"] = headers
30
+ return _kwargs
31
+
32
+
33
+ def _parse_response(
34
+ *, client: AuthenticatedClient | Client, response: httpx.Response
35
+ ) -> MarketingIngestAccepted | MarketingIngestError | None:
36
+ if response.status_code == 200:
37
+ response_200 = MarketingIngestAccepted.from_dict(response.json())
38
+
39
+ return response_200
40
+
41
+ if response.status_code == 400:
42
+ response_400 = MarketingIngestError.from_dict(response.json())
43
+
44
+ return response_400
45
+
46
+ if response.status_code == 409:
47
+ response_409 = MarketingIngestError.from_dict(response.json())
48
+
49
+ return response_409
50
+
51
+ if response.status_code == 413:
52
+ response_413 = MarketingIngestError.from_dict(response.json())
53
+
54
+ return response_413
55
+
56
+ if client.raise_on_unexpected_status:
57
+ raise errors.UnexpectedStatus(response.status_code, response.content)
58
+ else:
59
+ return None
60
+
61
+
62
+ def _build_response(
63
+ *, client: AuthenticatedClient | Client, response: httpx.Response
64
+ ) -> Response[MarketingIngestAccepted | MarketingIngestError]:
65
+ return Response(
66
+ status_code=HTTPStatus(response.status_code),
67
+ content=response.content,
68
+ headers=response.headers,
69
+ parsed=_parse_response(client=client, response=response),
70
+ )
71
+
72
+
73
+ def sync_detailed(
74
+ *,
75
+ client: AuthenticatedClient,
76
+ body: MarketingIngestBatchRequest,
77
+ ) -> Response[MarketingIngestAccepted | MarketingIngestError]:
78
+ """Send a batch of activation rollups
79
+
80
+ Daily rollups from the Rust server. Authenticated by the server key; the server is the key, never
81
+ the body.
82
+
83
+ Args:
84
+ body (MarketingIngestBatchRequest):
85
+
86
+ Raises:
87
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
88
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
89
+
90
+ Returns:
91
+ Response[MarketingIngestAccepted | MarketingIngestError]
92
+ """
93
+
94
+ kwargs = _get_kwargs(
95
+ body=body,
96
+ )
97
+
98
+ response = client.get_httpx_client().request(
99
+ **kwargs,
100
+ )
101
+
102
+ return _build_response(client=client, response=response)
103
+
104
+
105
+ def sync(
106
+ *,
107
+ client: AuthenticatedClient,
108
+ body: MarketingIngestBatchRequest,
109
+ ) -> MarketingIngestAccepted | MarketingIngestError | None:
110
+ """Send a batch of activation rollups
111
+
112
+ Daily rollups from the Rust server. Authenticated by the server key; the server is the key, never
113
+ the body.
114
+
115
+ Args:
116
+ body (MarketingIngestBatchRequest):
117
+
118
+ Raises:
119
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
120
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
121
+
122
+ Returns:
123
+ MarketingIngestAccepted | MarketingIngestError
124
+ """
125
+
126
+ return sync_detailed(
127
+ client=client,
128
+ body=body,
129
+ ).parsed
130
+
131
+
132
+ async def asyncio_detailed(
133
+ *,
134
+ client: AuthenticatedClient,
135
+ body: MarketingIngestBatchRequest,
136
+ ) -> Response[MarketingIngestAccepted | MarketingIngestError]:
137
+ """Send a batch of activation rollups
138
+
139
+ Daily rollups from the Rust server. Authenticated by the server key; the server is the key, never
140
+ the body.
141
+
142
+ Args:
143
+ body (MarketingIngestBatchRequest):
144
+
145
+ Raises:
146
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
147
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
148
+
149
+ Returns:
150
+ Response[MarketingIngestAccepted | MarketingIngestError]
151
+ """
152
+
153
+ kwargs = _get_kwargs(
154
+ body=body,
155
+ )
156
+
157
+ response = await client.get_async_httpx_client().request(**kwargs)
158
+
159
+ return _build_response(client=client, response=response)
160
+
161
+
162
+ async def asyncio(
163
+ *,
164
+ client: AuthenticatedClient,
165
+ body: MarketingIngestBatchRequest,
166
+ ) -> MarketingIngestAccepted | MarketingIngestError | None:
167
+ """Send a batch of activation rollups
168
+
169
+ Daily rollups from the Rust server. Authenticated by the server key; the server is the key, never
170
+ the body.
171
+
172
+ Args:
173
+ body (MarketingIngestBatchRequest):
174
+
175
+ Raises:
176
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
177
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
178
+
179
+ Returns:
180
+ MarketingIngestAccepted | MarketingIngestError
181
+ """
182
+
183
+ return (
184
+ await asyncio_detailed(
185
+ client=client,
186
+ body=body,
187
+ )
188
+ ).parsed