TenantService#
- class TenantService[source]#
Methods
Get all tenants of an instance.
Create a new tenant.
Retrieves all visible tenant coupon for the tenant linked to the tenant.
Create a new coupon valid to redeem any course in a tenant, by Tenant id.
Delete a coupon.
Update the given coupon with new values.
Update the price of the given course.
Update the price of the given course.
Get a tenant by id.
Update a tenant by id.
Get the logo of a tenant.
List all LTI providers for this tenant.
Get the permissions of the logged in user for this tenant.
Get all roles of this tenant with their permissions
Get the settings for this tenant.
Update the settings for this tenant.
Get the statistics of a tenant.
Update the Permission of a given TenantRole.
- create(multipart_data)[source]#
Create a new tenant.
- Parameters:
multipart_data (
CreateTenantData
) – The data that should form the body of the request. SeeCreateTenantData
for information about the possible fields.self (TenantService[AuthenticatedClient]) –
- Returns:
The newly created tenant.
- Return type:
- get_all_tenant_coupons(*, tenant_id, page_size=20)[source]#
Retrieves all visible tenant coupon for the tenant linked to the tenant.
- Parameters:
tenant_id (
str
) – The tenant that defines the scopes of the coupons.self (TenantService[AuthenticatedClient]) –
page_size (int) –
- Returns:
The list of available coupons.
- Return type:
Response[TenantCouponWithCode | TenantCouponWithoutCode]
- create_tenant_coupon(json_body, *, tenant_id)[source]#
Create a new coupon valid to redeem any course in a tenant, by Tenant id.
- 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.tenant_id (
str
) – The tenant that defines the scopes of the coupons.self (TenantService[AuthenticatedClient]) –
- Returns:
The coupon created for this tenant.
- Return type:
- delete_tenant_coupon(*, tenant_id, coupon_id)[source]#
Delete a coupon.
- Parameters:
tenant_id (
str
) – The id of the tenant price the coupon is connected to.coupon_id (
str
) – The id of the coupon you want to delete.self (TenantService[AuthenticatedClient]) –
- Returns:
Nothing
- Return type:
None
- update_tenant_coupon(json_body, *, tenant_id, coupon_id)[source]#
Update the given coupon with new values.
- 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.tenant_id (
str
) – The tenant that defines the scopes of the coupons.coupon_id (
str
) – The id of the coupon you want to update.self (TenantService[AuthenticatedClient]) –
- Returns:
The updated coupon
- Return type:
- put_price(json_body, *, tenant_id)[source]#
Update the price of the given course.
- Parameters:
json_body (
PutPriceTenantData
) – The body of the request. SeePutPriceTenantData
for information about the possible fields. You can provide this data as aPutPriceTenantData
or as a dictionary.tenant_id (
str
) – The id of the tenant for which you want to update the price.self (TenantService[AuthenticatedClient]) –
- Returns:
The created or updated price.
- Return type:
- delete_price(*, tenant_id)[source]#
Update the price of the given course.
- Parameters:
tenant_id (
str
) – The id of the tenant for which you want to delete the price.self (TenantService[AuthenticatedClient]) –
- Returns:
Nothing.
- Return type:
None
- get(*, tenant_id)[source]#
Get a tenant by id.
- Parameters:
tenant_id (
str
) – The id of the tenant you want to retrieve.- Returns:
The tenant with the given id.
- Return type:
- patch(json_body, *, tenant_id)[source]#
Update a tenant by id.
- Parameters:
json_body (
PatchTenantData
) – The body of the request. SeePatchTenantData
for information about the possible fields. You can provide this data as aPatchTenantData
or as a dictionary.tenant_id (
str
) – The id of the tenant you want to update.self (TenantService[AuthenticatedClient]) –
- Returns:
The updated tenant.
- Return type:
- get_lti_providers(*, tenant_id, page_size=20)[source]#
List all LTI providers for this tenant.
- Parameters:
tenant_id (
str
) – The id of the tenant to get the LTI providers for.self (TenantService[AuthenticatedClient]) –
page_size (int) –
- Returns:
A list of all known LTI providers.
- Return type:
Response[FinalizedLTI1p3Provider | NonFinalizedLTI1p3Provider | FinalizedLTI1p1Provider | NonFinalizedLTI1p1Provider]
- get_permissions(*, tenant_id)[source]#
Get the permissions of the logged in user for this tenant.
If the user does not have an associated role within the tenant, the global permissions of the user are returned.
- Parameters:
tenant_id (
str
) – The tenant for which to get the permissions.self (TenantService[AuthenticatedClient]) –
- Returns:
The courses for this tenant.
- Return type:
- get_roles(*, tenant_id)[source]#
Get all roles of this tenant with their permissions
- Parameters:
tenant_id (
str
) – The tenant to get the roles for.self (TenantService[AuthenticatedClient]) –
- Returns:
An array of roles.
- Return type:
- get_settings(*, tenant_id, only_frontend=False)[source]#
Get the settings for this tenant.
- Parameters:
- Returns:
The settings for this tenant.
- Return type:
- patch_settings(json_body, *, tenant_id)[source]#
Update the settings for this tenant.
- Parameters:
json_body (
PatchSettingsTenantData
) – The body of the request. SeePatchSettingsTenantData
for information about the possible fields. You can provide this data as aPatchSettingsTenantData
or as a dictionary.tenant_id (
str
) – The tenant to update the settings for.self (TenantService[AuthenticatedClient]) –
- Returns:
The updated tenant settings.
- Return type:
- get_stats(*, tenant_id)[source]#
Get the statistics of a tenant.
- Parameters:
tenant_id (
str
) – The id of the tenant for which you want to get the statistics.self (TenantService[AuthenticatedClient]) –
- Returns:
The statistics of the specified tenant.
- Return type:
- patch_role(json_body, *, tenant_id, role_id)[source]#
Update the Permission of a given TenantRole.
- Parameters:
json_body (
PatchRoleTenantData
) – The body of the request. SeePatchRoleTenantData
for information about the possible fields. You can provide this data as aPatchRoleTenantData
or as a dictionary.tenant_id (
str
) – The tenant to patch the role for.role_id (
int
) – The id of the tenant role.self (TenantService[AuthenticatedClient]) –
- Returns:
An empty response with return code 204.
- Return type:
None