getlurk 0.2.1__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.
getlurk/__init__.py ADDED
@@ -0,0 +1,32 @@
1
+ """The Lurk API for Python.
2
+
3
+ >>> from getlurk import Lurk
4
+ >>> lurk = Lurk() # reads the key from LURK_KEY
5
+ >>> receipt = lurk.events.send({"event": "checkin.scanned", "user": "maya@example.com"})
6
+ """
7
+
8
+ from ._generated import schema, types
9
+ from .aio import AsyncLurk
10
+ from .client import DEFAULT_BASE_URL, SDK_VERSION, Lurk, Response, Transport
11
+ from .errors import LurkConnectionError, LurkError, WebhookVerificationError
12
+ from .options import RequestOptions
13
+ from .webhooks import ActivityCreatedEvent, RuleLiveEvent, WebhookEvent, construct_event
14
+
15
+ __all__ = [
16
+ "ActivityCreatedEvent",
17
+ "AsyncLurk",
18
+ "DEFAULT_BASE_URL",
19
+ "Lurk",
20
+ "LurkConnectionError",
21
+ "LurkError",
22
+ "RequestOptions",
23
+ "Response",
24
+ "RuleLiveEvent",
25
+ "SDK_VERSION",
26
+ "Transport",
27
+ "WebhookEvent",
28
+ "WebhookVerificationError",
29
+ "construct_event",
30
+ "schema",
31
+ "types",
32
+ ]
@@ -0,0 +1 @@
1
+ """Generated from openapi/openapi.json by scripts/generate.ts. Do not edit."""
@@ -0,0 +1,122 @@
1
+ """Generated from openapi/openapi.json by scripts/generate.ts. Do not edit."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing import Dict, Literal, NamedTuple, Optional, Tuple
6
+
7
+
8
+ class Operation(NamedTuple):
9
+ method: Literal["GET", "POST", "PATCH", "DELETE"]
10
+ path: str
11
+ path_params: Tuple[str, ...]
12
+ query_params: Tuple[str, ...]
13
+ body: bool
14
+ #: Where the idempotency key goes. An operation without one is never retried once the request may have been processed.
15
+ idempotency: Optional[Literal["header", "body"]]
16
+
17
+
18
+ OPERATIONS: Dict[str, Operation] = {
19
+ "activity.explain": Operation("GET", "/v1/activity/{id}", ("id",), (), False, None),
20
+ "activity.export": Operation("GET", "/v1/activity/export", (), ("user", "rule", "unit", "since", "until",), False, None),
21
+ "activity.feed": Operation("GET", "/v1/activity-feed", (), ("limit", "cursor", "kind", "user", "rule", "unit", "since", "until",), False, None),
22
+ "activity.list": Operation("GET", "/v1/activity", (), ("limit", "cursor", "user", "rule", "unit", "cause", "transfer", "since", "until",), False, None),
23
+ "activity.undo": Operation("POST", "/v1/activity/{id}/undo", ("id",), (), True, None),
24
+ "agent_keys.create": Operation("POST", "/v1/agent-keys", (), (), True, None),
25
+ "agent_keys.list": Operation("GET", "/v1/agent-keys", (), ("limit", "cursor",), False, None),
26
+ "agent_keys.revoke": Operation("POST", "/v1/agent-keys/{id}/revoke", ("id",), (), True, None),
27
+ "api_keys.create": Operation("POST", "/v1/api-keys", (), (), True, None),
28
+ "api_keys.list": Operation("GET", "/v1/api-keys", (), ("limit", "cursor",), False, None),
29
+ "api_keys.revoke": Operation("POST", "/v1/api-keys/{id}/revoke", ("id",), (), True, None),
30
+ "audiences.add_users": Operation("POST", "/v1/audiences/{id}/users", ("id",), (), True, "header"),
31
+ "audiences.create": Operation("POST", "/v1/audiences", (), (), True, "header"),
32
+ "audiences.list": Operation("GET", "/v1/audiences", (), ("limit", "cursor", "kind",), False, None),
33
+ "budgets.list": Operation("GET", "/v1/budgets", (), ("limit", "cursor", "rule", "nearly_used",), False, None),
34
+ "clocks.advance": Operation("POST", "/v1/clock/advance", (), (), True, "header"),
35
+ "clocks.get": Operation("GET", "/v1/clock", (), (), False, None),
36
+ "clocks.reset": Operation("POST", "/v1/clock/reset", (), (), True, "header"),
37
+ "clocks.set": Operation("POST", "/v1/clock/set", (), (), True, "header"),
38
+ "dashboards.create": Operation("POST", "/v1/dashboards", (), (), True, "header"),
39
+ "dashboards.get": Operation("GET", "/v1/dashboards/{id}", ("id",), (), False, None),
40
+ "dashboards.list": Operation("GET", "/v1/dashboards", (), ("limit", "cursor", "pinned", "unit",), False, None),
41
+ "dashboards.pin": Operation("POST", "/v1/dashboards/{id}/pin", ("id",), (), True, None),
42
+ "dashboards.read": Operation("GET", "/v1/dashboards/{id}/read", ("id",), ("range", "compare", "audience",), False, None),
43
+ "dashboards.update": Operation("PATCH", "/v1/dashboards/{id}", ("id",), (), True, "header"),
44
+ "events.catalog": Operation("GET", "/v1/events/catalog", (), ("limit", "cursor", "search",), False, None),
45
+ "events.send": Operation("POST", "/v1/events", (), (), True, "body"),
46
+ "exports.cancel": Operation("POST", "/v1/exports/{id}/cancel", ("id",), (), True, "header"),
47
+ "exports.create": Operation("POST", "/v1/exports", (), (), True, "header"),
48
+ "exports.download": Operation("POST", "/v1/exports/{id}/download", ("id",), (), True, None),
49
+ "exports.get": Operation("GET", "/v1/exports/{id}", ("id",), (), False, None),
50
+ "exports.list": Operation("GET", "/v1/exports", (), ("limit", "cursor",), False, None),
51
+ "holds.decide": Operation("POST", "/v1/holds/{id}/decision", ("id",), (), True, None),
52
+ "holds.get": Operation("GET", "/v1/holds/{id}", ("id",), (), False, None),
53
+ "holds.list": Operation("GET", "/v1/holds", (), ("limit", "cursor", "status", "user", "rule",), False, None),
54
+ "integrations.health": Operation("GET", "/v1/integrations/health", (), ("key",), False, None),
55
+ "integrations.list": Operation("GET", "/v1/integrations", (), ("limit", "cursor", "filter",), False, None),
56
+ "invites.accept": Operation("POST", "/v1/invites/{id}/accept", ("id",), (), True, None),
57
+ "invites.decline": Operation("POST", "/v1/invites/{id}/decline", ("id",), (), True, None),
58
+ "invites.list": Operation("GET", "/v1/invites", (), ("limit", "cursor",), False, None),
59
+ "invites.revoke": Operation("DELETE", "/v1/invites/{id}", ("id",), (), True, None),
60
+ "lurky.brief": Operation("GET", "/v1/lurky/brief", (), (), False, None),
61
+ "lurky.delete_conversation": Operation("POST", "/v1/lurky/conversations/{id}/delete", ("id",), (), True, "header"),
62
+ "lurky.get_conversation": Operation("GET", "/v1/lurky/conversations/{id}", ("id",), (), False, None),
63
+ "lurky.get_settings": Operation("GET", "/v1/lurky/settings", (), (), False, None),
64
+ "lurky.hide_suggestion": Operation("POST", "/v1/lurky/suggestions/hide", (), (), True, "header"),
65
+ "lurky.list_conversations": Operation("GET", "/v1/lurky/conversations", (), ("limit", "cursor",), False, None),
66
+ "lurky.show_suggestion": Operation("POST", "/v1/lurky/suggestions/show", (), (), True, "header"),
67
+ "lurky.suggestions": Operation("GET", "/v1/lurky/suggestions", (), (), False, None),
68
+ "lurky.update_settings": Operation("PATCH", "/v1/lurky/settings", (), (), True, "header"),
69
+ "lurky.usage": Operation("GET", "/v1/lurky/usage", (), (), False, None),
70
+ "members.invite": Operation("POST", "/v1/invites", (), (), True, None),
71
+ "members.list": Operation("GET", "/v1/members", (), ("organization_id", "limit", "cursor", "status",), False, None),
72
+ "members.me": Operation("GET", "/v1/members/me", (), (), False, None),
73
+ "members.remove": Operation("DELETE", "/v1/members/{id}", ("id",), (), True, None),
74
+ "members.update": Operation("PATCH", "/v1/members/{id}", ("id",), (), True, None),
75
+ "organizations.create": Operation("POST", "/v1/organizations", (), (), True, None),
76
+ "organizations.list": Operation("GET", "/v1/organizations", (), ("limit", "cursor",), False, None),
77
+ "projects.create": Operation("POST", "/v1/projects", (), (), True, None),
78
+ "projects.get": Operation("GET", "/v1/projects/{id}", ("id",), (), False, None),
79
+ "projects.list": Operation("GET", "/v1/projects", (), ("limit", "cursor", "organization_id",), False, None),
80
+ "projects.setup": Operation("GET", "/v1/setup", (), (), False, None),
81
+ "projects.update": Operation("PATCH", "/v1/projects/{id}", ("id",), (), True, None),
82
+ "promotions.create": Operation("POST", "/v1/promotions", (), (), True, None),
83
+ "promotions.preview": Operation("POST", "/v1/promotions/preview", (), (), True, None),
84
+ "proposals.card": Operation("GET", "/v1/proposals/{id}/card", ("id",), (), False, None),
85
+ "proposals.create": Operation("POST", "/v1/proposals", (), (), True, "header"),
86
+ "proposals.decide": Operation("POST", "/v1/proposals/{id}/decision", ("id",), (), True, None),
87
+ "proposals.get": Operation("GET", "/v1/proposals/{id}", ("id",), (), False, None),
88
+ "proposals.list": Operation("GET", "/v1/proposals", (), ("limit", "cursor", "status",), False, None),
89
+ "rules.create": Operation("POST", "/v1/rules", (), (), True, "header"),
90
+ "rules.get": Operation("GET", "/v1/rules/{id}", ("id",), (), False, None),
91
+ "rules.list": Operation("GET", "/v1/rules", (), ("limit", "cursor", "status", "unit", "event", "search",), False, None),
92
+ "rules.pause": Operation("POST", "/v1/rules/{id}/pause", ("id",), (), True, None),
93
+ "rules.preview": Operation("POST", "/v1/rules/{id}/preview", ("id",), (), True, None),
94
+ "rules.publish": Operation("POST", "/v1/rules/{id}/live", ("id",), (), True, None),
95
+ "rules.resume": Operation("POST", "/v1/rules/{id}/resume", ("id",), (), True, None),
96
+ "rules.stats": Operation("GET", "/v1/rules/{id}/stats", ("id",), ("days",), False, None),
97
+ "rules.update": Operation("PATCH", "/v1/rules/{id}", ("id",), (), True, "header"),
98
+ "templates.get": Operation("GET", "/v1/templates/{id}", ("id",), (), False, None),
99
+ "templates.install": Operation("POST", "/v1/templates/{id}/install", ("id",), (), True, "header"),
100
+ "templates.list": Operation("GET", "/v1/templates", (), ("limit", "cursor", "filter", "category",), False, None),
101
+ "templates.plan": Operation("POST", "/v1/templates/{id}/plan", ("id",), (), True, None),
102
+ "templates.remove": Operation("POST", "/v1/templates/{id}/remove", ("id",), (), True, None),
103
+ "units.create": Operation("POST", "/v1/units", (), (), True, "header"),
104
+ "units.get": Operation("GET", "/v1/units/{id}", ("id",), (), False, None),
105
+ "units.give": Operation("POST", "/v1/units/give", (), (), True, "header"),
106
+ "units.give_preview": Operation("POST", "/v1/units/give/preview", (), (), True, None),
107
+ "units.list": Operation("GET", "/v1/units", (), ("limit", "cursor", "group",), False, None),
108
+ "units.send": Operation("POST", "/v1/units/send", (), (), True, "header"),
109
+ "units.spend": Operation("POST", "/v1/units/spend", (), (), True, "header"),
110
+ "units.update": Operation("PATCH", "/v1/units/{id}", ("id",), (), True, "header"),
111
+ "units.use": Operation("POST", "/v1/units/use", (), (), True, "header"),
112
+ "users.export": Operation("GET", "/v1/users/export", (), ("search",), False, None),
113
+ "users.get": Operation("GET", "/v1/users/{id}", ("id",), (), False, None),
114
+ "users.list": Operation("GET", "/v1/users", (), ("limit", "cursor", "search", "audience", "status", "sort", "include",), False, None),
115
+ "views.create": Operation("POST", "/v1/views", (), (), True, "header"),
116
+ "views.get": Operation("GET", "/v1/views/{id}", ("id",), ("range", "compare", "audience",), False, None),
117
+ "views.list": Operation("GET", "/v1/views", (), ("limit", "cursor", "search",), False, None),
118
+ "views.update": Operation("PATCH", "/v1/views/{id}", ("id",), (), True, "header"),
119
+ "webhook_endpoints.create": Operation("POST", "/v1/webhook-endpoints", (), (), True, None),
120
+ "webhook_endpoints.delete": Operation("POST", "/v1/webhook-endpoints/{id}/delete", ("id",), (), True, None),
121
+ "webhook_endpoints.list": Operation("GET", "/v1/webhook-endpoints", (), ("limit", "cursor",), False, None),
122
+ }