AccessPlanService#
- class AccessPlanService[source]#
Methods
Get all access plans for a tenant.
Create a new tenant-wide access plan.
Get all coupons for a tenant access plan.
Create a coupon for a tenant access plan.
Delete an access pass coupon.
Update an access pass coupon.
Create a new payment for a tenant-wide access plan.
Update a tenant access plan.
Use a coupon to get access to a tenant-wide plan.
- get_all(*, tenant_id, page_size=20)[source]#
Get all access plans for a tenant.
- Parameters:
tenant_id (
str
) – The ID of the tenant to get the access plans for.page_size (
int
) – The size of a single page, maximum is 50.self (AccessPlanService[AuthenticatedClient]) –
- Returns:
A paginated list of access plans for the tenant.
- Return type:
Response[TenantAccessPlan]
- create(json_body)[source]#
Create a new tenant-wide access plan.
- Parameters:
json_body (
CreateAccessPlanData
) – The body of the request. SeeCreateAccessPlanData
for information about the possible fields. You can provide this data as aCreateAccessPlanData
or as a dictionary.self (AccessPlanService[AuthenticatedClient]) –
- Returns:
The newly created access plan.
- Return type:
- get_coupons(*, plan_id, page_size=20)[source]#
Get all coupons for a tenant access plan.
- Parameters:
plan_id (
str
) – The ID of the access plan.page_size (
int
) – The size of a single page, maximum is 50.self (AccessPlanService[AuthenticatedClient]) –
- Returns:
A paginated list of coupons.
- Return type:
Response[AccessPassCouponWithCode | AccessPassCouponWithoutCode]
- create_coupon(json_body, *, plan_id)[source]#
Create a coupon for a tenant access plan.
- Parameters:
json_body (
CouponDataParser
) – The body of the request. SeeCouponDataParser
for information about the possible fields. You can provide this data as aCouponDataParser
or as a dictionary.plan_id (
str
) – The ID of the access plan.self (AccessPlanService[AuthenticatedClient]) –
- Returns:
The created coupon.
- Return type:
- delete_coupon(*, plan_id, coupon_id)[source]#
Delete an access pass coupon.
- Parameters:
plan_id (
str
) – The ID of the access plan.coupon_id (
str
) – The ID of the coupon to delete.self (AccessPlanService[AuthenticatedClient]) –
- Returns:
An empty response.
- Return type:
None
- update_coupon(json_body, *, plan_id, coupon_id)[source]#
Update an access pass coupon.
- Parameters:
json_body (
CouponDataParser
) – The body of the request. SeeCouponDataParser
for information about the possible fields. You can provide this data as aCouponDataParser
or as a dictionary.plan_id (
str
) – The ID of the access plan.coupon_id (
str
) – The ID of the coupon to update.self (AccessPlanService[AuthenticatedClient]) –
- Returns:
The updated coupon.
- Return type:
- start_payment(json_body, *, plan_id, course_id)[source]#
Create a new payment for a tenant-wide access plan.
This transaction will grant the user access to all courses within the tenant for the duration specified in the plan.
- Parameters:
json_body (
Union
[StartPaymentCloseTabData
,StartPaymentRedirectData
]) – The body of the request. SeeStartPaymentAccessPlanData
for information about the possible fields. You can provide this data as aStartPaymentAccessPlanData
or as a dictionary.plan_id (
str
) – The ID of the access plan to pay for.course_id (
int
) – The ID of the course the user was on, to redirect back to after successful payment.self (AccessPlanService[AuthenticatedClient]) –
- Returns:
A transaction object with a stripe_url key that can be used to complete the payment.
- Return type:
- update(json_body, *, plan_id)[source]#
Update a tenant access plan.
- Parameters:
json_body (
UpdateAccessPlanData
) – The body of the request. SeeUpdateAccessPlanData
for information about the possible fields. You can provide this data as aUpdateAccessPlanData
or as a dictionary.plan_id (
str
) – The ID of the plan to update.self (AccessPlanService[AuthenticatedClient]) –
- Returns:
The updated access plan.
- Return type:
- pay_with_coupon(json_body, *, plan_id)[source]#
Use a coupon to get access to a tenant-wide plan.
- Parameters:
json_body (
PayWithCouponAccessPlanData
) – The body of the request. SeePayWithCouponAccessPlanData
for information about the possible fields. You can provide this data as aPayWithCouponAccessPlanData
or as a dictionary.plan_id (
str
) – The ID of the access plan to pay for.self (AccessPlanService[AuthenticatedClient]) –
- Returns:
The newly created access pass coupon usage record.
- Return type: