whop-sdk 0.0.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.
Potentially problematic release.
This version of whop-sdk might be problematic. Click here for more details.
- whop_sdk/__init__.py +94 -0
- whop_sdk/_base_client.py +1995 -0
- whop_sdk/_client.py +664 -0
- whop_sdk/_compat.py +219 -0
- whop_sdk/_constants.py +14 -0
- whop_sdk/_exceptions.py +112 -0
- whop_sdk/_files.py +123 -0
- whop_sdk/_models.py +835 -0
- whop_sdk/_qs.py +150 -0
- whop_sdk/_resource.py +43 -0
- whop_sdk/_response.py +830 -0
- whop_sdk/_streaming.py +333 -0
- whop_sdk/_types.py +260 -0
- whop_sdk/_utils/__init__.py +64 -0
- whop_sdk/_utils/_compat.py +45 -0
- whop_sdk/_utils/_datetime_parse.py +136 -0
- whop_sdk/_utils/_logs.py +25 -0
- whop_sdk/_utils/_proxy.py +65 -0
- whop_sdk/_utils/_reflection.py +42 -0
- whop_sdk/_utils/_resources_proxy.py +24 -0
- whop_sdk/_utils/_streams.py +12 -0
- whop_sdk/_utils/_sync.py +86 -0
- whop_sdk/_utils/_transform.py +457 -0
- whop_sdk/_utils/_typing.py +156 -0
- whop_sdk/_utils/_utils.py +421 -0
- whop_sdk/_version.py +4 -0
- whop_sdk/lib/.keep +4 -0
- whop_sdk/pagination.py +61 -0
- whop_sdk/py.typed +0 -0
- whop_sdk/resources/__init__.py +316 -0
- whop_sdk/resources/app_builds.py +562 -0
- whop_sdk/resources/apps.py +665 -0
- whop_sdk/resources/authorized_users.py +336 -0
- whop_sdk/resources/chat_channels.py +469 -0
- whop_sdk/resources/checkout_configurations.py +464 -0
- whop_sdk/resources/companies.py +171 -0
- whop_sdk/resources/course_lesson_interactions.py +343 -0
- whop_sdk/resources/entries.py +539 -0
- whop_sdk/resources/experiences.py +859 -0
- whop_sdk/resources/forum_posts.py +512 -0
- whop_sdk/resources/invoices.py +633 -0
- whop_sdk/resources/ledger_accounts.py +171 -0
- whop_sdk/resources/memberships.py +810 -0
- whop_sdk/resources/messages.py +446 -0
- whop_sdk/resources/payments.py +761 -0
- whop_sdk/resources/plans.py +906 -0
- whop_sdk/resources/products.py +969 -0
- whop_sdk/resources/reactions.py +423 -0
- whop_sdk/resources/shipments.py +451 -0
- whop_sdk/resources/support_channels.py +455 -0
- whop_sdk/resources/transfers.py +488 -0
- whop_sdk/resources/users.py +248 -0
- whop_sdk/resources/webhooks.py +69 -0
- whop_sdk/types/__init__.py +135 -0
- whop_sdk/types/app_build_create_params.py +59 -0
- whop_sdk/types/app_build_list_params.py +34 -0
- whop_sdk/types/app_build_list_response.py +50 -0
- whop_sdk/types/app_create_params.py +19 -0
- whop_sdk/types/app_list_params.py +54 -0
- whop_sdk/types/app_list_response.py +91 -0
- whop_sdk/types/app_update_params.py +58 -0
- whop_sdk/types/authorized_user_list_params.py +33 -0
- whop_sdk/types/authorized_user_list_response.py +33 -0
- whop_sdk/types/authorized_user_retrieve_response.py +33 -0
- whop_sdk/types/chat_channel_list_params.py +28 -0
- whop_sdk/types/chat_channel_list_response.py +43 -0
- whop_sdk/types/chat_channel_update_params.py +32 -0
- whop_sdk/types/checkout_configuration_create_params.py +129 -0
- whop_sdk/types/checkout_configuration_list_params.py +33 -0
- whop_sdk/types/checkout_configuration_list_response.py +66 -0
- whop_sdk/types/course_lesson_interaction_list_params.py +34 -0
- whop_sdk/types/entry_approve_response.py +10 -0
- whop_sdk/types/entry_list_params.py +44 -0
- whop_sdk/types/entry_list_response.py +56 -0
- whop_sdk/types/experience_attach_params.py +12 -0
- whop_sdk/types/experience_create_params.py +22 -0
- whop_sdk/types/experience_delete_response.py +7 -0
- whop_sdk/types/experience_detach_params.py +12 -0
- whop_sdk/types/experience_list_params.py +31 -0
- whop_sdk/types/experience_list_response.py +47 -0
- whop_sdk/types/experience_update_params.py +41 -0
- whop_sdk/types/forum_post_create_params.py +85 -0
- whop_sdk/types/forum_post_list_params.py +31 -0
- whop_sdk/types/forum_post_list_response.py +53 -0
- whop_sdk/types/invoice_create_params.py +137 -0
- whop_sdk/types/invoice_create_response.py +16 -0
- whop_sdk/types/invoice_created_webhook_event.py +26 -0
- whop_sdk/types/invoice_list_params.py +50 -0
- whop_sdk/types/invoice_paid_webhook_event.py +26 -0
- whop_sdk/types/invoice_past_due_webhook_event.py +26 -0
- whop_sdk/types/invoice_void_response.py +7 -0
- whop_sdk/types/invoice_voided_webhook_event.py +26 -0
- whop_sdk/types/ledger_account_retrieve_response.py +78 -0
- whop_sdk/types/membership_cancel_params.py +13 -0
- whop_sdk/types/membership_list_params.py +70 -0
- whop_sdk/types/membership_list_response.py +117 -0
- whop_sdk/types/membership_pause_params.py +16 -0
- whop_sdk/types/membership_update_params.py +13 -0
- whop_sdk/types/message_create_params.py +51 -0
- whop_sdk/types/message_list_params.py +30 -0
- whop_sdk/types/message_list_response.py +90 -0
- whop_sdk/types/payment_list_params.py +72 -0
- whop_sdk/types/payment_list_response.py +221 -0
- whop_sdk/types/payment_refund_params.py +13 -0
- whop_sdk/types/plan_create_params.py +106 -0
- whop_sdk/types/plan_delete_response.py +7 -0
- whop_sdk/types/plan_list_params.py +49 -0
- whop_sdk/types/plan_list_response.py +92 -0
- whop_sdk/types/plan_update_params.py +95 -0
- whop_sdk/types/product_create_params.py +170 -0
- whop_sdk/types/product_delete_response.py +7 -0
- whop_sdk/types/product_list_params.py +41 -0
- whop_sdk/types/product_update_params.py +90 -0
- whop_sdk/types/reaction_create_params.py +19 -0
- whop_sdk/types/reaction_list_params.py +25 -0
- whop_sdk/types/reaction_list_response.py +32 -0
- whop_sdk/types/shared/__init__.py +55 -0
- whop_sdk/types/shared/access_pass_type.py +7 -0
- whop_sdk/types/shared/app.py +159 -0
- whop_sdk/types/shared/app_build.py +50 -0
- whop_sdk/types/shared/app_build_platforms.py +7 -0
- whop_sdk/types/shared/app_build_statuses.py +7 -0
- whop_sdk/types/shared/app_statuses.py +7 -0
- whop_sdk/types/shared/app_view_type.py +7 -0
- whop_sdk/types/shared/authorized_user_roles.py +9 -0
- whop_sdk/types/shared/business_types.py +22 -0
- whop_sdk/types/shared/chat_channel.py +43 -0
- whop_sdk/types/shared/checkout_configuration.py +66 -0
- whop_sdk/types/shared/collection_method.py +7 -0
- whop_sdk/types/shared/company.py +71 -0
- whop_sdk/types/shared/course_lesson_interaction.py +44 -0
- whop_sdk/types/shared/course_lesson_interaction_list_item.py +44 -0
- whop_sdk/types/shared/currency.py +92 -0
- whop_sdk/types/shared/custom_cta.py +21 -0
- whop_sdk/types/shared/direction.py +7 -0
- whop_sdk/types/shared/dms_post_types.py +7 -0
- whop_sdk/types/shared/entry.py +70 -0
- whop_sdk/types/shared/entry_status.py +7 -0
- whop_sdk/types/shared/experience.py +66 -0
- whop_sdk/types/shared/forum_post.py +53 -0
- whop_sdk/types/shared/friendly_receipt_status.py +24 -0
- whop_sdk/types/shared/global_affiliate_status.py +7 -0
- whop_sdk/types/shared/industry_types.py +67 -0
- whop_sdk/types/shared/invoice.py +61 -0
- whop_sdk/types/shared/invoice_list_item.py +61 -0
- whop_sdk/types/shared/invoice_status.py +7 -0
- whop_sdk/types/shared/membership.py +117 -0
- whop_sdk/types/shared/membership_status.py +9 -0
- whop_sdk/types/shared/message.py +90 -0
- whop_sdk/types/shared/page_info.py +21 -0
- whop_sdk/types/shared/payment.py +211 -0
- whop_sdk/types/shared/plan.py +123 -0
- whop_sdk/types/shared/plan_type.py +7 -0
- whop_sdk/types/shared/product.py +124 -0
- whop_sdk/types/shared/product_list_item.py +49 -0
- whop_sdk/types/shared/promo_type.py +7 -0
- whop_sdk/types/shared/reaction.py +32 -0
- whop_sdk/types/shared/receipt_status.py +7 -0
- whop_sdk/types/shared/release_method.py +7 -0
- whop_sdk/types/shared/shipment.py +48 -0
- whop_sdk/types/shared/shipment_carrier.py +84 -0
- whop_sdk/types/shared/shipment_status.py +18 -0
- whop_sdk/types/shared/shipment_substatus.py +36 -0
- whop_sdk/types/shared/support_channel.py +39 -0
- whop_sdk/types/shared/tax_type.py +7 -0
- whop_sdk/types/shared/transfer.py +109 -0
- whop_sdk/types/shared/visibility.py +7 -0
- whop_sdk/types/shared/visibility_filter.py +9 -0
- whop_sdk/types/shared/who_can_post.py +7 -0
- whop_sdk/types/shared/who_can_react.py +7 -0
- whop_sdk/types/shared_params/__init__.py +27 -0
- whop_sdk/types/shared_params/access_pass_type.py +9 -0
- whop_sdk/types/shared_params/app_build_platforms.py +9 -0
- whop_sdk/types/shared_params/app_build_statuses.py +9 -0
- whop_sdk/types/shared_params/app_statuses.py +9 -0
- whop_sdk/types/shared_params/app_view_type.py +9 -0
- whop_sdk/types/shared_params/authorized_user_roles.py +11 -0
- whop_sdk/types/shared_params/business_types.py +24 -0
- whop_sdk/types/shared_params/collection_method.py +9 -0
- whop_sdk/types/shared_params/currency.py +94 -0
- whop_sdk/types/shared_params/custom_cta.py +23 -0
- whop_sdk/types/shared_params/direction.py +9 -0
- whop_sdk/types/shared_params/entry_status.py +9 -0
- whop_sdk/types/shared_params/friendly_receipt_status.py +26 -0
- whop_sdk/types/shared_params/global_affiliate_status.py +9 -0
- whop_sdk/types/shared_params/industry_types.py +69 -0
- whop_sdk/types/shared_params/invoice_status.py +9 -0
- whop_sdk/types/shared_params/membership_status.py +11 -0
- whop_sdk/types/shared_params/plan_type.py +9 -0
- whop_sdk/types/shared_params/receipt_status.py +9 -0
- whop_sdk/types/shared_params/release_method.py +9 -0
- whop_sdk/types/shared_params/tax_type.py +9 -0
- whop_sdk/types/shared_params/visibility.py +9 -0
- whop_sdk/types/shared_params/visibility_filter.py +11 -0
- whop_sdk/types/shared_params/who_can_post.py +9 -0
- whop_sdk/types/shared_params/who_can_react.py +9 -0
- whop_sdk/types/shipment_create_params.py +18 -0
- whop_sdk/types/shipment_list_params.py +31 -0
- whop_sdk/types/shipment_list_response.py +48 -0
- whop_sdk/types/support_channel_create_params.py +15 -0
- whop_sdk/types/support_channel_list_params.py +40 -0
- whop_sdk/types/support_channel_list_response.py +39 -0
- whop_sdk/types/transfer_create_params.py +36 -0
- whop_sdk/types/transfer_list_params.py +42 -0
- whop_sdk/types/transfer_list_response.py +35 -0
- whop_sdk/types/unwrap_webhook_event.py +15 -0
- whop_sdk/types/user_check_access_response.py +15 -0
- whop_sdk/types/user_retrieve_response.py +25 -0
- whop_sdk-0.0.1.dist-info/METADATA +522 -0
- whop_sdk-0.0.1.dist-info/RECORD +212 -0
- whop_sdk-0.0.1.dist-info/WHEEL +4 -0
- whop_sdk-0.0.1.dist-info/licenses/LICENSE +201 -0
|
@@ -0,0 +1,562 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from typing import List, Optional
|
|
6
|
+
|
|
7
|
+
import httpx
|
|
8
|
+
|
|
9
|
+
from ..types import app_build_list_params, app_build_create_params
|
|
10
|
+
from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
|
|
11
|
+
from .._utils import maybe_transform, async_maybe_transform
|
|
12
|
+
from .._compat import cached_property
|
|
13
|
+
from .._resource import SyncAPIResource, AsyncAPIResource
|
|
14
|
+
from .._response import (
|
|
15
|
+
to_raw_response_wrapper,
|
|
16
|
+
to_streamed_response_wrapper,
|
|
17
|
+
async_to_raw_response_wrapper,
|
|
18
|
+
async_to_streamed_response_wrapper,
|
|
19
|
+
)
|
|
20
|
+
from ..pagination import SyncCursorPage, AsyncCursorPage
|
|
21
|
+
from .._base_client import AsyncPaginator, make_request_options
|
|
22
|
+
from ..types.shared.app_build import AppBuild
|
|
23
|
+
from ..types.shared.app_view_type import AppViewType
|
|
24
|
+
from ..types.app_build_list_response import AppBuildListResponse
|
|
25
|
+
from ..types.shared.app_build_statuses import AppBuildStatuses
|
|
26
|
+
from ..types.shared.app_build_platforms import AppBuildPlatforms
|
|
27
|
+
|
|
28
|
+
__all__ = ["AppBuildsResource", "AsyncAppBuildsResource"]
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
class AppBuildsResource(SyncAPIResource):
|
|
32
|
+
@cached_property
|
|
33
|
+
def with_raw_response(self) -> AppBuildsResourceWithRawResponse:
|
|
34
|
+
"""
|
|
35
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
36
|
+
the raw response object instead of the parsed content.
|
|
37
|
+
|
|
38
|
+
For more information, see https://www.github.com/whopio/whopsdk-python#accessing-raw-response-data-eg-headers
|
|
39
|
+
"""
|
|
40
|
+
return AppBuildsResourceWithRawResponse(self)
|
|
41
|
+
|
|
42
|
+
@cached_property
|
|
43
|
+
def with_streaming_response(self) -> AppBuildsResourceWithStreamingResponse:
|
|
44
|
+
"""
|
|
45
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
46
|
+
|
|
47
|
+
For more information, see https://www.github.com/whopio/whopsdk-python#with_streaming_response
|
|
48
|
+
"""
|
|
49
|
+
return AppBuildsResourceWithStreamingResponse(self)
|
|
50
|
+
|
|
51
|
+
def create(
|
|
52
|
+
self,
|
|
53
|
+
*,
|
|
54
|
+
attachment: app_build_create_params.Attachment,
|
|
55
|
+
checksum: str,
|
|
56
|
+
platform: AppBuildPlatforms,
|
|
57
|
+
app_id: Optional[str] | Omit = omit,
|
|
58
|
+
supported_app_view_types: Optional[List[AppViewType]] | Omit = omit,
|
|
59
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
60
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
61
|
+
extra_headers: Headers | None = None,
|
|
62
|
+
extra_query: Query | None = None,
|
|
63
|
+
extra_body: Body | None = None,
|
|
64
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
65
|
+
) -> AppBuild:
|
|
66
|
+
"""
|
|
67
|
+
Creates a new app build
|
|
68
|
+
|
|
69
|
+
Required permissions:
|
|
70
|
+
|
|
71
|
+
- `developer:manage_builds`
|
|
72
|
+
|
|
73
|
+
Args:
|
|
74
|
+
attachment: Attachment input for the app build file. This should be an upload in .zip
|
|
75
|
+
format. The zip should contain at least one main_js_bundle.hbc file and
|
|
76
|
+
optionally an assets folder next to it.
|
|
77
|
+
|
|
78
|
+
checksum: Checksum of the app build file. This is generated by the client and used to
|
|
79
|
+
verify the integrity of the file that is submitted when un-packaged later on a
|
|
80
|
+
device.
|
|
81
|
+
|
|
82
|
+
platform: The platform of the app build (ios, android, web)
|
|
83
|
+
|
|
84
|
+
app_id: The ID of the app to create a build for. By default the current app from the api
|
|
85
|
+
key is used.
|
|
86
|
+
|
|
87
|
+
supported_app_view_types: Supported app view types for the app build. A build can specify multiple view
|
|
88
|
+
types, but should only specify ones that its code supports.
|
|
89
|
+
|
|
90
|
+
extra_headers: Send extra headers
|
|
91
|
+
|
|
92
|
+
extra_query: Add additional query parameters to the request
|
|
93
|
+
|
|
94
|
+
extra_body: Add additional JSON properties to the request
|
|
95
|
+
|
|
96
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
97
|
+
"""
|
|
98
|
+
return self._post(
|
|
99
|
+
"/app_builds",
|
|
100
|
+
body=maybe_transform(
|
|
101
|
+
{
|
|
102
|
+
"attachment": attachment,
|
|
103
|
+
"checksum": checksum,
|
|
104
|
+
"platform": platform,
|
|
105
|
+
"app_id": app_id,
|
|
106
|
+
"supported_app_view_types": supported_app_view_types,
|
|
107
|
+
},
|
|
108
|
+
app_build_create_params.AppBuildCreateParams,
|
|
109
|
+
),
|
|
110
|
+
options=make_request_options(
|
|
111
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
112
|
+
),
|
|
113
|
+
cast_to=AppBuild,
|
|
114
|
+
)
|
|
115
|
+
|
|
116
|
+
def retrieve(
|
|
117
|
+
self,
|
|
118
|
+
id: str,
|
|
119
|
+
*,
|
|
120
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
121
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
122
|
+
extra_headers: Headers | None = None,
|
|
123
|
+
extra_query: Query | None = None,
|
|
124
|
+
extra_body: Body | None = None,
|
|
125
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
126
|
+
) -> AppBuild:
|
|
127
|
+
"""
|
|
128
|
+
Retrieves an app build by ID
|
|
129
|
+
|
|
130
|
+
Required permissions:
|
|
131
|
+
|
|
132
|
+
- `developer:manage_builds`
|
|
133
|
+
|
|
134
|
+
Args:
|
|
135
|
+
extra_headers: Send extra headers
|
|
136
|
+
|
|
137
|
+
extra_query: Add additional query parameters to the request
|
|
138
|
+
|
|
139
|
+
extra_body: Add additional JSON properties to the request
|
|
140
|
+
|
|
141
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
142
|
+
"""
|
|
143
|
+
if not id:
|
|
144
|
+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
|
|
145
|
+
return self._get(
|
|
146
|
+
f"/app_builds/{id}",
|
|
147
|
+
options=make_request_options(
|
|
148
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
149
|
+
),
|
|
150
|
+
cast_to=AppBuild,
|
|
151
|
+
)
|
|
152
|
+
|
|
153
|
+
def list(
|
|
154
|
+
self,
|
|
155
|
+
*,
|
|
156
|
+
app_id: str,
|
|
157
|
+
after: Optional[str] | Omit = omit,
|
|
158
|
+
before: Optional[str] | Omit = omit,
|
|
159
|
+
first: Optional[int] | Omit = omit,
|
|
160
|
+
last: Optional[int] | Omit = omit,
|
|
161
|
+
platform: Optional[AppBuildPlatforms] | Omit = omit,
|
|
162
|
+
status: Optional[AppBuildStatuses] | Omit = omit,
|
|
163
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
164
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
165
|
+
extra_headers: Headers | None = None,
|
|
166
|
+
extra_query: Query | None = None,
|
|
167
|
+
extra_body: Body | None = None,
|
|
168
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
169
|
+
) -> SyncCursorPage[AppBuildListResponse]:
|
|
170
|
+
"""
|
|
171
|
+
Lists app builds for an app
|
|
172
|
+
|
|
173
|
+
Required permissions:
|
|
174
|
+
|
|
175
|
+
- `developer:manage_builds`
|
|
176
|
+
|
|
177
|
+
Args:
|
|
178
|
+
app_id: The ID of the app to filter app builds by
|
|
179
|
+
|
|
180
|
+
after: Returns the elements in the list that come after the specified cursor.
|
|
181
|
+
|
|
182
|
+
before: Returns the elements in the list that come before the specified cursor.
|
|
183
|
+
|
|
184
|
+
first: Returns the first _n_ elements from the list.
|
|
185
|
+
|
|
186
|
+
last: Returns the last _n_ elements from the list.
|
|
187
|
+
|
|
188
|
+
platform: The different platforms an app build can target.
|
|
189
|
+
|
|
190
|
+
status: The different statuses an AppBuild can be in.
|
|
191
|
+
|
|
192
|
+
extra_headers: Send extra headers
|
|
193
|
+
|
|
194
|
+
extra_query: Add additional query parameters to the request
|
|
195
|
+
|
|
196
|
+
extra_body: Add additional JSON properties to the request
|
|
197
|
+
|
|
198
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
199
|
+
"""
|
|
200
|
+
return self._get_api_list(
|
|
201
|
+
"/app_builds",
|
|
202
|
+
page=SyncCursorPage[AppBuildListResponse],
|
|
203
|
+
options=make_request_options(
|
|
204
|
+
extra_headers=extra_headers,
|
|
205
|
+
extra_query=extra_query,
|
|
206
|
+
extra_body=extra_body,
|
|
207
|
+
timeout=timeout,
|
|
208
|
+
query=maybe_transform(
|
|
209
|
+
{
|
|
210
|
+
"app_id": app_id,
|
|
211
|
+
"after": after,
|
|
212
|
+
"before": before,
|
|
213
|
+
"first": first,
|
|
214
|
+
"last": last,
|
|
215
|
+
"platform": platform,
|
|
216
|
+
"status": status,
|
|
217
|
+
},
|
|
218
|
+
app_build_list_params.AppBuildListParams,
|
|
219
|
+
),
|
|
220
|
+
),
|
|
221
|
+
model=AppBuildListResponse,
|
|
222
|
+
)
|
|
223
|
+
|
|
224
|
+
def promote(
|
|
225
|
+
self,
|
|
226
|
+
id: str,
|
|
227
|
+
*,
|
|
228
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
229
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
230
|
+
extra_headers: Headers | None = None,
|
|
231
|
+
extra_query: Query | None = None,
|
|
232
|
+
extra_body: Body | None = None,
|
|
233
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
234
|
+
) -> AppBuild:
|
|
235
|
+
"""
|
|
236
|
+
Promotes an app build to production
|
|
237
|
+
|
|
238
|
+
Required permissions:
|
|
239
|
+
|
|
240
|
+
- `developer:manage_builds`
|
|
241
|
+
|
|
242
|
+
Args:
|
|
243
|
+
extra_headers: Send extra headers
|
|
244
|
+
|
|
245
|
+
extra_query: Add additional query parameters to the request
|
|
246
|
+
|
|
247
|
+
extra_body: Add additional JSON properties to the request
|
|
248
|
+
|
|
249
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
250
|
+
"""
|
|
251
|
+
if not id:
|
|
252
|
+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
|
|
253
|
+
return self._post(
|
|
254
|
+
f"/app_builds/{id}/promote",
|
|
255
|
+
options=make_request_options(
|
|
256
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
257
|
+
),
|
|
258
|
+
cast_to=AppBuild,
|
|
259
|
+
)
|
|
260
|
+
|
|
261
|
+
|
|
262
|
+
class AsyncAppBuildsResource(AsyncAPIResource):
|
|
263
|
+
@cached_property
|
|
264
|
+
def with_raw_response(self) -> AsyncAppBuildsResourceWithRawResponse:
|
|
265
|
+
"""
|
|
266
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
267
|
+
the raw response object instead of the parsed content.
|
|
268
|
+
|
|
269
|
+
For more information, see https://www.github.com/whopio/whopsdk-python#accessing-raw-response-data-eg-headers
|
|
270
|
+
"""
|
|
271
|
+
return AsyncAppBuildsResourceWithRawResponse(self)
|
|
272
|
+
|
|
273
|
+
@cached_property
|
|
274
|
+
def with_streaming_response(self) -> AsyncAppBuildsResourceWithStreamingResponse:
|
|
275
|
+
"""
|
|
276
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
277
|
+
|
|
278
|
+
For more information, see https://www.github.com/whopio/whopsdk-python#with_streaming_response
|
|
279
|
+
"""
|
|
280
|
+
return AsyncAppBuildsResourceWithStreamingResponse(self)
|
|
281
|
+
|
|
282
|
+
async def create(
|
|
283
|
+
self,
|
|
284
|
+
*,
|
|
285
|
+
attachment: app_build_create_params.Attachment,
|
|
286
|
+
checksum: str,
|
|
287
|
+
platform: AppBuildPlatforms,
|
|
288
|
+
app_id: Optional[str] | Omit = omit,
|
|
289
|
+
supported_app_view_types: Optional[List[AppViewType]] | Omit = omit,
|
|
290
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
291
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
292
|
+
extra_headers: Headers | None = None,
|
|
293
|
+
extra_query: Query | None = None,
|
|
294
|
+
extra_body: Body | None = None,
|
|
295
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
296
|
+
) -> AppBuild:
|
|
297
|
+
"""
|
|
298
|
+
Creates a new app build
|
|
299
|
+
|
|
300
|
+
Required permissions:
|
|
301
|
+
|
|
302
|
+
- `developer:manage_builds`
|
|
303
|
+
|
|
304
|
+
Args:
|
|
305
|
+
attachment: Attachment input for the app build file. This should be an upload in .zip
|
|
306
|
+
format. The zip should contain at least one main_js_bundle.hbc file and
|
|
307
|
+
optionally an assets folder next to it.
|
|
308
|
+
|
|
309
|
+
checksum: Checksum of the app build file. This is generated by the client and used to
|
|
310
|
+
verify the integrity of the file that is submitted when un-packaged later on a
|
|
311
|
+
device.
|
|
312
|
+
|
|
313
|
+
platform: The platform of the app build (ios, android, web)
|
|
314
|
+
|
|
315
|
+
app_id: The ID of the app to create a build for. By default the current app from the api
|
|
316
|
+
key is used.
|
|
317
|
+
|
|
318
|
+
supported_app_view_types: Supported app view types for the app build. A build can specify multiple view
|
|
319
|
+
types, but should only specify ones that its code supports.
|
|
320
|
+
|
|
321
|
+
extra_headers: Send extra headers
|
|
322
|
+
|
|
323
|
+
extra_query: Add additional query parameters to the request
|
|
324
|
+
|
|
325
|
+
extra_body: Add additional JSON properties to the request
|
|
326
|
+
|
|
327
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
328
|
+
"""
|
|
329
|
+
return await self._post(
|
|
330
|
+
"/app_builds",
|
|
331
|
+
body=await async_maybe_transform(
|
|
332
|
+
{
|
|
333
|
+
"attachment": attachment,
|
|
334
|
+
"checksum": checksum,
|
|
335
|
+
"platform": platform,
|
|
336
|
+
"app_id": app_id,
|
|
337
|
+
"supported_app_view_types": supported_app_view_types,
|
|
338
|
+
},
|
|
339
|
+
app_build_create_params.AppBuildCreateParams,
|
|
340
|
+
),
|
|
341
|
+
options=make_request_options(
|
|
342
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
343
|
+
),
|
|
344
|
+
cast_to=AppBuild,
|
|
345
|
+
)
|
|
346
|
+
|
|
347
|
+
async def retrieve(
|
|
348
|
+
self,
|
|
349
|
+
id: str,
|
|
350
|
+
*,
|
|
351
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
352
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
353
|
+
extra_headers: Headers | None = None,
|
|
354
|
+
extra_query: Query | None = None,
|
|
355
|
+
extra_body: Body | None = None,
|
|
356
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
357
|
+
) -> AppBuild:
|
|
358
|
+
"""
|
|
359
|
+
Retrieves an app build by ID
|
|
360
|
+
|
|
361
|
+
Required permissions:
|
|
362
|
+
|
|
363
|
+
- `developer:manage_builds`
|
|
364
|
+
|
|
365
|
+
Args:
|
|
366
|
+
extra_headers: Send extra headers
|
|
367
|
+
|
|
368
|
+
extra_query: Add additional query parameters to the request
|
|
369
|
+
|
|
370
|
+
extra_body: Add additional JSON properties to the request
|
|
371
|
+
|
|
372
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
373
|
+
"""
|
|
374
|
+
if not id:
|
|
375
|
+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
|
|
376
|
+
return await self._get(
|
|
377
|
+
f"/app_builds/{id}",
|
|
378
|
+
options=make_request_options(
|
|
379
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
380
|
+
),
|
|
381
|
+
cast_to=AppBuild,
|
|
382
|
+
)
|
|
383
|
+
|
|
384
|
+
def list(
|
|
385
|
+
self,
|
|
386
|
+
*,
|
|
387
|
+
app_id: str,
|
|
388
|
+
after: Optional[str] | Omit = omit,
|
|
389
|
+
before: Optional[str] | Omit = omit,
|
|
390
|
+
first: Optional[int] | Omit = omit,
|
|
391
|
+
last: Optional[int] | Omit = omit,
|
|
392
|
+
platform: Optional[AppBuildPlatforms] | Omit = omit,
|
|
393
|
+
status: Optional[AppBuildStatuses] | Omit = omit,
|
|
394
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
395
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
396
|
+
extra_headers: Headers | None = None,
|
|
397
|
+
extra_query: Query | None = None,
|
|
398
|
+
extra_body: Body | None = None,
|
|
399
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
400
|
+
) -> AsyncPaginator[AppBuildListResponse, AsyncCursorPage[AppBuildListResponse]]:
|
|
401
|
+
"""
|
|
402
|
+
Lists app builds for an app
|
|
403
|
+
|
|
404
|
+
Required permissions:
|
|
405
|
+
|
|
406
|
+
- `developer:manage_builds`
|
|
407
|
+
|
|
408
|
+
Args:
|
|
409
|
+
app_id: The ID of the app to filter app builds by
|
|
410
|
+
|
|
411
|
+
after: Returns the elements in the list that come after the specified cursor.
|
|
412
|
+
|
|
413
|
+
before: Returns the elements in the list that come before the specified cursor.
|
|
414
|
+
|
|
415
|
+
first: Returns the first _n_ elements from the list.
|
|
416
|
+
|
|
417
|
+
last: Returns the last _n_ elements from the list.
|
|
418
|
+
|
|
419
|
+
platform: The different platforms an app build can target.
|
|
420
|
+
|
|
421
|
+
status: The different statuses an AppBuild can be in.
|
|
422
|
+
|
|
423
|
+
extra_headers: Send extra headers
|
|
424
|
+
|
|
425
|
+
extra_query: Add additional query parameters to the request
|
|
426
|
+
|
|
427
|
+
extra_body: Add additional JSON properties to the request
|
|
428
|
+
|
|
429
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
430
|
+
"""
|
|
431
|
+
return self._get_api_list(
|
|
432
|
+
"/app_builds",
|
|
433
|
+
page=AsyncCursorPage[AppBuildListResponse],
|
|
434
|
+
options=make_request_options(
|
|
435
|
+
extra_headers=extra_headers,
|
|
436
|
+
extra_query=extra_query,
|
|
437
|
+
extra_body=extra_body,
|
|
438
|
+
timeout=timeout,
|
|
439
|
+
query=maybe_transform(
|
|
440
|
+
{
|
|
441
|
+
"app_id": app_id,
|
|
442
|
+
"after": after,
|
|
443
|
+
"before": before,
|
|
444
|
+
"first": first,
|
|
445
|
+
"last": last,
|
|
446
|
+
"platform": platform,
|
|
447
|
+
"status": status,
|
|
448
|
+
},
|
|
449
|
+
app_build_list_params.AppBuildListParams,
|
|
450
|
+
),
|
|
451
|
+
),
|
|
452
|
+
model=AppBuildListResponse,
|
|
453
|
+
)
|
|
454
|
+
|
|
455
|
+
async def promote(
|
|
456
|
+
self,
|
|
457
|
+
id: str,
|
|
458
|
+
*,
|
|
459
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
460
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
461
|
+
extra_headers: Headers | None = None,
|
|
462
|
+
extra_query: Query | None = None,
|
|
463
|
+
extra_body: Body | None = None,
|
|
464
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
465
|
+
) -> AppBuild:
|
|
466
|
+
"""
|
|
467
|
+
Promotes an app build to production
|
|
468
|
+
|
|
469
|
+
Required permissions:
|
|
470
|
+
|
|
471
|
+
- `developer:manage_builds`
|
|
472
|
+
|
|
473
|
+
Args:
|
|
474
|
+
extra_headers: Send extra headers
|
|
475
|
+
|
|
476
|
+
extra_query: Add additional query parameters to the request
|
|
477
|
+
|
|
478
|
+
extra_body: Add additional JSON properties to the request
|
|
479
|
+
|
|
480
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
481
|
+
"""
|
|
482
|
+
if not id:
|
|
483
|
+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
|
|
484
|
+
return await self._post(
|
|
485
|
+
f"/app_builds/{id}/promote",
|
|
486
|
+
options=make_request_options(
|
|
487
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
488
|
+
),
|
|
489
|
+
cast_to=AppBuild,
|
|
490
|
+
)
|
|
491
|
+
|
|
492
|
+
|
|
493
|
+
class AppBuildsResourceWithRawResponse:
|
|
494
|
+
def __init__(self, app_builds: AppBuildsResource) -> None:
|
|
495
|
+
self._app_builds = app_builds
|
|
496
|
+
|
|
497
|
+
self.create = to_raw_response_wrapper(
|
|
498
|
+
app_builds.create,
|
|
499
|
+
)
|
|
500
|
+
self.retrieve = to_raw_response_wrapper(
|
|
501
|
+
app_builds.retrieve,
|
|
502
|
+
)
|
|
503
|
+
self.list = to_raw_response_wrapper(
|
|
504
|
+
app_builds.list,
|
|
505
|
+
)
|
|
506
|
+
self.promote = to_raw_response_wrapper(
|
|
507
|
+
app_builds.promote,
|
|
508
|
+
)
|
|
509
|
+
|
|
510
|
+
|
|
511
|
+
class AsyncAppBuildsResourceWithRawResponse:
|
|
512
|
+
def __init__(self, app_builds: AsyncAppBuildsResource) -> None:
|
|
513
|
+
self._app_builds = app_builds
|
|
514
|
+
|
|
515
|
+
self.create = async_to_raw_response_wrapper(
|
|
516
|
+
app_builds.create,
|
|
517
|
+
)
|
|
518
|
+
self.retrieve = async_to_raw_response_wrapper(
|
|
519
|
+
app_builds.retrieve,
|
|
520
|
+
)
|
|
521
|
+
self.list = async_to_raw_response_wrapper(
|
|
522
|
+
app_builds.list,
|
|
523
|
+
)
|
|
524
|
+
self.promote = async_to_raw_response_wrapper(
|
|
525
|
+
app_builds.promote,
|
|
526
|
+
)
|
|
527
|
+
|
|
528
|
+
|
|
529
|
+
class AppBuildsResourceWithStreamingResponse:
|
|
530
|
+
def __init__(self, app_builds: AppBuildsResource) -> None:
|
|
531
|
+
self._app_builds = app_builds
|
|
532
|
+
|
|
533
|
+
self.create = to_streamed_response_wrapper(
|
|
534
|
+
app_builds.create,
|
|
535
|
+
)
|
|
536
|
+
self.retrieve = to_streamed_response_wrapper(
|
|
537
|
+
app_builds.retrieve,
|
|
538
|
+
)
|
|
539
|
+
self.list = to_streamed_response_wrapper(
|
|
540
|
+
app_builds.list,
|
|
541
|
+
)
|
|
542
|
+
self.promote = to_streamed_response_wrapper(
|
|
543
|
+
app_builds.promote,
|
|
544
|
+
)
|
|
545
|
+
|
|
546
|
+
|
|
547
|
+
class AsyncAppBuildsResourceWithStreamingResponse:
|
|
548
|
+
def __init__(self, app_builds: AsyncAppBuildsResource) -> None:
|
|
549
|
+
self._app_builds = app_builds
|
|
550
|
+
|
|
551
|
+
self.create = async_to_streamed_response_wrapper(
|
|
552
|
+
app_builds.create,
|
|
553
|
+
)
|
|
554
|
+
self.retrieve = async_to_streamed_response_wrapper(
|
|
555
|
+
app_builds.retrieve,
|
|
556
|
+
)
|
|
557
|
+
self.list = async_to_streamed_response_wrapper(
|
|
558
|
+
app_builds.list,
|
|
559
|
+
)
|
|
560
|
+
self.promote = async_to_streamed_response_wrapper(
|
|
561
|
+
app_builds.promote,
|
|
562
|
+
)
|