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 courses for this tenant.
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.
- get_all(*, with_statistics=False, extra_parameters=None)[source]#
Get all tenants of an instance.
- Parameters:
- Returns:
All the tenants of this instance.
- Return type:
- create(multipart_data, *, extra_parameters=None)[source]#
Create a new tenant.
- Parameters:
multipart_data (
Union
[dict
,list
,CreateTenantData
]) – The data that should form the body of the request. SeeCreateTenantData
for information about the possible fields.extra_parameters (
Optional
[Mapping
[str
,Union
[str
,bool
,int
,float
]]]) – The extra query parameters you might want to add. By default no extra query parameters are added.self (TenantService[AuthenticatedClient]) –
- Returns:
The newly created tenant.
- Return type:
- get_all_tenant_coupons(*, tenant_id, offset=Nothing, limit=Nothing, extra_parameters=None)[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.offset (
Union
[Just
[int
],_Nothing
[int
]]) – The index of the first coupon to be returned.limit (
Union
[Just
[int
],_Nothing
[int
]]) – The maximum amount of coupons to return.extra_parameters (
Optional
[Mapping
[str
,Union
[str
,bool
,int
,float
]]]) – The extra query parameters you might want to add. By default no extra query parameters are added.self (TenantService[AuthenticatedClient]) –
- Returns:
The list of available coupons.
- Return type:
- create_tenant_coupon(json_body, *, tenant_id, extra_parameters=None)[source]#
Create a new coupon valid to redeem any course in a tenant, by Tenant id.
- Parameters:
json_body (
Union
[dict
,list
,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.extra_parameters (
Optional
[Mapping
[str
,Union
[str
,bool
,int
,float
]]]) – The extra query parameters you might want to add. By default no extra query parameters are added.self (TenantService[AuthenticatedClient]) –
- Returns:
The coupon created for this tenant.
- Return type:
- delete_tenant_coupon(*, tenant_id, coupon_id, extra_parameters=None)[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.extra_parameters (
Optional
[Mapping
[str
,Union
[str
,bool
,int
,float
]]]) – The extra query parameters you might want to add. By default no extra query parameters are added.self (TenantService[AuthenticatedClient]) –
- Returns:
Nothing
- Return type:
None
- update_tenant_coupon(json_body, *, tenant_id, coupon_id, extra_parameters=None)[source]#
Update the given coupon with new values.
- Parameters:
json_body (
Union
[dict
,list
,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.extra_parameters (
Optional
[Mapping
[str
,Union
[str
,bool
,int
,float
]]]) – The extra query parameters you might want to add. By default no extra query parameters are added.self (TenantService[AuthenticatedClient]) –
- Returns:
The updated coupon
- Return type:
- put_price(json_body, *, tenant_id, extra_parameters=None)[source]#
Update the price of the given course.
- Parameters:
json_body (
Union
[dict
,list
,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.extra_parameters (
Optional
[Mapping
[str
,Union
[str
,bool
,int
,float
]]]) – The extra query parameters you might want to add. By default no extra query parameters are added.self (TenantService[AuthenticatedClient]) –
- Returns:
The created or updated price.
- Return type:
- delete_price(*, tenant_id, extra_parameters=None)[source]#
Update the price of the given course.
- Parameters:
- Returns:
Nothing.
- Return type:
None
- get(*, tenant_id, with_statistics=False, extra_parameters=None)[source]#
Get a tenant by id.
- Parameters:
tenant_id (
str
) – The id of the tenant you want to retrieve.with_statistics (
bool
) – Add statistics to returned tenant, if you have permission too see the statistics.extra_parameters (
Optional
[Mapping
[str
,Union
[str
,bool
,int
,float
]]]) – The extra query parameters you might want to add. By default no extra query parameters are added.
- Returns:
The tenant with the given id.
- Return type:
- patch(json_body, *, tenant_id, with_statistics=False, extra_parameters=None)[source]#
Update a tenant by id.
- Parameters:
json_body (
Union
[dict
,list
,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.with_statistics (
bool
) – Add statistics to returned tenant, if you have permission too see the statistics.extra_parameters (
Optional
[Mapping
[str
,Union
[str
,bool
,int
,float
]]]) – The extra query parameters you might want to add. By default no extra query parameters are added.self (TenantService[AuthenticatedClient]) –
- Returns:
The updated tenant.
- Return type:
- get_courses(*, tenant_id, extra_parameters=None)[source]#
Get the courses for this tenant.
- Parameters:
- Returns:
The courses for this tenant.
- Return type:
- get_logo(*, tenant_id, dark=False, extra_parameters=None)[source]#
Get the logo of a tenant.
- Parameters:
tenant_id (
str
) – The id of the tenant for which you want to get the logo.dark (
bool
) – If truhty the retrieved logo will be suited for the dark theme.extra_parameters (
Optional
[Mapping
[str
,Union
[str
,bool
,int
,float
]]]) – The extra query parameters you might want to add. By default no extra query parameters are added.
- Returns:
The logo of the tenant.
- Return type:
- get_lti_providers(*, tenant_id, extra_parameters=None)[source]#
List all LTI providers for this tenant.
- Parameters:
- Returns:
A list of all known LTI providers.
- Return type:
Sequence[FinalizedLTI1p3Provider | NonFinalizedLTI1p3Provider | FinalizedLTI1p1Provider | NonFinalizedLTI1p1Provider]
- get_permissions(*, tenant_id, extra_parameters=None)[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:
- Returns:
The courses for this tenant.
- Return type:
- get_roles(*, tenant_id, extra_parameters=None)[source]#
Get all roles of this tenant with their permissions
- Parameters:
- Returns:
An array of roles.
- Return type:
- get_settings(*, tenant_id, only_frontend=False, extra_parameters=None)[source]#
Get the settings for this tenant.
- Parameters:
tenant_id (
str
) – The tenant for which to get the settings.only_frontend (
bool
) – Get only the frontend settings. When True the returned mapping will contain all frontend settings, even those that only have a global value.extra_parameters (
Optional
[Mapping
[str
,Union
[str
,bool
,int
,float
]]]) – The extra query parameters you might want to add. By default no extra query parameters are added.
- Returns:
The settings for this tenant.
- Return type:
- patch_settings(json_body, *, tenant_id, extra_parameters=None)[source]#
Update the settings for this tenant.
- Parameters:
json_body (
Union
[dict
,list
,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.extra_parameters (
Optional
[Mapping
[str
,Union
[str
,bool
,int
,float
]]]) – The extra query parameters you might want to add. By default no extra query parameters are added.self (TenantService[AuthenticatedClient]) –
- Returns:
The updated tenant settings.
- Return type:
- get_stats(*, tenant_id, extra_parameters=None)[source]#
Get the statistics of a tenant.
- Parameters:
- Returns:
The statistics of the specified tenant.
- Return type:
- patch_role(json_body, *, tenant_id, role_id, extra_parameters=None)[source]#
Update the Permission of a given TenantRole.
- Parameters:
json_body (
Union
[dict
,list
,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.extra_parameters (
Optional
[Mapping
[str
,Union
[str
,bool
,int
,float
]]]) – The extra query parameters you might want to add. By default no extra query parameters are added.self (TenantService[AuthenticatedClient]) –
- Returns:
An empty response with return code 204.
- Return type:
None