enterprise.api.v1 package#
Subpackages#
- enterprise.api.v1.views package
- Submodules
- enterprise.api.v1.views.analytics_summary module
- enterprise.api.v1.views.base_views module
- enterprise.api.v1.views.coupon_codes module
CouponCodesView
CouponCodesView.MISSING_REQUIRED_PARAMS_MSG
CouponCodesView.OPTIONAL_PARAM_NOTES
CouponCodesView.OPTIONAL_PARAM_NUMBER_OF_CODES
CouponCodesView.REQUIRED_PARAM_EMAIL
CouponCodesView.REQUIRED_PARAM_ENTERPRISE_NAME
CouponCodesView.authentication_classes
CouponCodesView.get_missing_params_message()
CouponCodesView.get_required_query_params()
CouponCodesView.permission_classes
CouponCodesView.post()
CouponCodesView.throttle_classes
- enterprise.api.v1.views.enterprise_catalog_query module
EnterpriseCatalogQueryViewSet
EnterpriseCatalogQueryViewSet.authentication_classes
EnterpriseCatalogQueryViewSet.basename
EnterpriseCatalogQueryViewSet.description
EnterpriseCatalogQueryViewSet.detail
EnterpriseCatalogQueryViewSet.name
EnterpriseCatalogQueryViewSet.pagination_class
EnterpriseCatalogQueryViewSet.permission_classes
EnterpriseCatalogQueryViewSet.queryset
EnterpriseCatalogQueryViewSet.serializer_class
EnterpriseCatalogQueryViewSet.suffix
ExpandDefaultPageSize
- enterprise.api.v1.views.enterprise_course_enrollment module
EnterpriseCourseEnrollmentPagination
EnterpriseCourseEnrollmentViewSet
EnterpriseCourseEnrollmentViewSet.FIELDS
EnterpriseCourseEnrollmentViewSet.USER_ID_FILTER
EnterpriseCourseEnrollmentViewSet.basename
EnterpriseCourseEnrollmentViewSet.description
EnterpriseCourseEnrollmentViewSet.detail
EnterpriseCourseEnrollmentViewSet.filter_backends
EnterpriseCourseEnrollmentViewSet.filterset_fields
EnterpriseCourseEnrollmentViewSet.get_queryset()
EnterpriseCourseEnrollmentViewSet.get_serializer_class()
EnterpriseCourseEnrollmentViewSet.name
EnterpriseCourseEnrollmentViewSet.ordering_fields
EnterpriseCourseEnrollmentViewSet.pagination_class
EnterpriseCourseEnrollmentViewSet.queryset
EnterpriseCourseEnrollmentViewSet.suffix
PaginatorWithOptimizedCount
read_replica_or_default()
- enterprise.api.v1.views.enterprise_customer module
EnterpriseCustomerViewSet
EnterpriseCustomerViewSet.FIELDS
EnterpriseCustomerViewSet.USER_ID_FILTER
EnterpriseCustomerViewSet.basename
EnterpriseCustomerViewSet.basic_list()
EnterpriseCustomerViewSet.contains_content_items()
EnterpriseCustomerViewSet.course_enrollments()
EnterpriseCustomerViewSet.create()
EnterpriseCustomerViewSet.dashboard_list()
EnterpriseCustomerViewSet.description
EnterpriseCustomerViewSet.detail
EnterpriseCustomerViewSet.enroll_learners_in_courses()
EnterpriseCustomerViewSet.filter_backends
EnterpriseCustomerViewSet.filterset_fields
EnterpriseCustomerViewSet.get_permissions()
EnterpriseCustomerViewSet.get_serializer_class()
EnterpriseCustomerViewSet.name
EnterpriseCustomerViewSet.ordering_fields
EnterpriseCustomerViewSet.pagination_class
EnterpriseCustomerViewSet.partial_update()
EnterpriseCustomerViewSet.queryset
EnterpriseCustomerViewSet.serializer_class
EnterpriseCustomerViewSet.suffix
EnterpriseCustomerViewSet.throttle_classes
EnterpriseCustomerViewSet.toggle_universal_link()
EnterpriseCustomerViewSet.unlink_users()
EnterpriseCustomerViewSet.with_access_to()
- enterprise.api.v1.views.enterprise_customer_api_credentials module
APICredEnabledPermission
APICredentialsRegenerateViewSet
APICredentialsRegenerateViewSet.basename
APICredentialsRegenerateViewSet.description
APICredentialsRegenerateViewSet.detail
APICredentialsRegenerateViewSet.get_queryset()
APICredentialsRegenerateViewSet.get_serializer_class()
APICredentialsRegenerateViewSet.name
APICredentialsRegenerateViewSet.permission_classes
APICredentialsRegenerateViewSet.suffix
APICredentialsRegenerateViewSet.update()
APICredentialsViewSet
APICredentialsViewSet.basename
APICredentialsViewSet.create()
APICredentialsViewSet.description
APICredentialsViewSet.destroy()
APICredentialsViewSet.detail
APICredentialsViewSet.get_queryset()
APICredentialsViewSet.get_serializer_class()
APICredentialsViewSet.name
APICredentialsViewSet.permission_classes
APICredentialsViewSet.retrieve()
APICredentialsViewSet.suffix
APICredentialsViewSet.update()
- enterprise.api.v1.views.enterprise_customer_branding_configuration module
EnterpriseCustomerBrandingConfigurationViewSet
EnterpriseCustomerBrandingConfigurationViewSet.FIELDS
EnterpriseCustomerBrandingConfigurationViewSet.USER_ID_FILTER
EnterpriseCustomerBrandingConfigurationViewSet.basename
EnterpriseCustomerBrandingConfigurationViewSet.description
EnterpriseCustomerBrandingConfigurationViewSet.detail
EnterpriseCustomerBrandingConfigurationViewSet.filterset_fields
EnterpriseCustomerBrandingConfigurationViewSet.lookup_field
EnterpriseCustomerBrandingConfigurationViewSet.name
EnterpriseCustomerBrandingConfigurationViewSet.ordering_fields
EnterpriseCustomerBrandingConfigurationViewSet.parser_classes
EnterpriseCustomerBrandingConfigurationViewSet.permission_classes
EnterpriseCustomerBrandingConfigurationViewSet.queryset
EnterpriseCustomerBrandingConfigurationViewSet.serializer_class
EnterpriseCustomerBrandingConfigurationViewSet.suffix
EnterpriseCustomerBrandingConfigurationViewSet.update_branding()
- enterprise.api.v1.views.enterprise_customer_catalog module
EnterpriseCustomerCatalogViewSet
EnterpriseCustomerCatalogViewSet.FIELDS
EnterpriseCustomerCatalogViewSet.USER_ID_FILTER
EnterpriseCustomerCatalogViewSet.basename
EnterpriseCustomerCatalogViewSet.contains_content_items()
EnterpriseCustomerCatalogViewSet.course_detail()
EnterpriseCustomerCatalogViewSet.course_run_detail()
EnterpriseCustomerCatalogViewSet.description
EnterpriseCustomerCatalogViewSet.detail
EnterpriseCustomerCatalogViewSet.filterset_fields
EnterpriseCustomerCatalogViewSet.get_serializer_class()
EnterpriseCustomerCatalogViewSet.list()
EnterpriseCustomerCatalogViewSet.name
EnterpriseCustomerCatalogViewSet.ordering_fields
EnterpriseCustomerCatalogViewSet.program_detail()
EnterpriseCustomerCatalogViewSet.queryset
EnterpriseCustomerCatalogViewSet.renderer_classes
EnterpriseCustomerCatalogViewSet.retrieve()
EnterpriseCustomerCatalogViewSet.suffix
EnterpriseCustomerCatalogWriteViewSet
EnterpriseCustomerCatalogWriteViewSet.basename
EnterpriseCustomerCatalogWriteViewSet.create()
EnterpriseCustomerCatalogWriteViewSet.description
EnterpriseCustomerCatalogWriteViewSet.detail
EnterpriseCustomerCatalogWriteViewSet.has_enterprise_customer_catalog()
EnterpriseCustomerCatalogWriteViewSet.name
EnterpriseCustomerCatalogWriteViewSet.partial_update()
EnterpriseCustomerCatalogWriteViewSet.permission_classes
EnterpriseCustomerCatalogWriteViewSet.queryset
EnterpriseCustomerCatalogWriteViewSet.serializer_class
EnterpriseCustomerCatalogWriteViewSet.suffix
- enterprise.api.v1.views.enterprise_customer_invite_key module
EnterpriseCustomerInviteKeyViewSet
EnterpriseCustomerInviteKeyViewSet.authentication_classes
EnterpriseCustomerInviteKeyViewSet.basename
EnterpriseCustomerInviteKeyViewSet.basic_list()
EnterpriseCustomerInviteKeyViewSet.create()
EnterpriseCustomerInviteKeyViewSet.description
EnterpriseCustomerInviteKeyViewSet.destroy()
EnterpriseCustomerInviteKeyViewSet.detail
EnterpriseCustomerInviteKeyViewSet.filter_backends
EnterpriseCustomerInviteKeyViewSet.get_serializer_class()
EnterpriseCustomerInviteKeyViewSet.http_method_names
EnterpriseCustomerInviteKeyViewSet.link_user()
EnterpriseCustomerInviteKeyViewSet.list()
EnterpriseCustomerInviteKeyViewSet.name
EnterpriseCustomerInviteKeyViewSet.partial_update()
EnterpriseCustomerInviteKeyViewSet.permission_classes
EnterpriseCustomerInviteKeyViewSet.queryset
EnterpriseCustomerInviteKeyViewSet.retrieve()
EnterpriseCustomerInviteKeyViewSet.suffix
- enterprise.api.v1.views.enterprise_customer_reporting module
EnterpriseCustomerReportTypesView
EnterpriseCustomerReportingConfigurationViewSet
EnterpriseCustomerReportingConfigurationViewSet.FIELDS
EnterpriseCustomerReportingConfigurationViewSet.USER_ID_FILTER
EnterpriseCustomerReportingConfigurationViewSet.basename
EnterpriseCustomerReportingConfigurationViewSet.create()
EnterpriseCustomerReportingConfigurationViewSet.description
EnterpriseCustomerReportingConfigurationViewSet.destroy()
EnterpriseCustomerReportingConfigurationViewSet.detail
EnterpriseCustomerReportingConfigurationViewSet.filterset_fields
EnterpriseCustomerReportingConfigurationViewSet.list()
EnterpriseCustomerReportingConfigurationViewSet.lookup_field
EnterpriseCustomerReportingConfigurationViewSet.name
EnterpriseCustomerReportingConfigurationViewSet.ordering_fields
EnterpriseCustomerReportingConfigurationViewSet.partial_update()
EnterpriseCustomerReportingConfigurationViewSet.permission_classes
EnterpriseCustomerReportingConfigurationViewSet.queryset
EnterpriseCustomerReportingConfigurationViewSet.retrieve()
EnterpriseCustomerReportingConfigurationViewSet.serializer_class
EnterpriseCustomerReportingConfigurationViewSet.suffix
EnterpriseCustomerReportingConfigurationViewSet.update()
- enterprise.api.v1.views.enterprise_customer_sso_configuration module
EnterpriseCustomerInactiveException
EnterpriseCustomerSsoConfigurationViewSet
EnterpriseCustomerSsoConfigurationViewSet.basename
EnterpriseCustomerSsoConfigurationViewSet.create()
EnterpriseCustomerSsoConfigurationViewSet.description
EnterpriseCustomerSsoConfigurationViewSet.destroy()
EnterpriseCustomerSsoConfigurationViewSet.detail
EnterpriseCustomerSsoConfigurationViewSet.list()
EnterpriseCustomerSsoConfigurationViewSet.name
EnterpriseCustomerSsoConfigurationViewSet.oauth_orchestration_complete()
EnterpriseCustomerSsoConfigurationViewSet.permission_classes
EnterpriseCustomerSsoConfigurationViewSet.queryset
EnterpriseCustomerSsoConfigurationViewSet.retrieve()
EnterpriseCustomerSsoConfigurationViewSet.serializer_class
EnterpriseCustomerSsoConfigurationViewSet.suffix
EnterpriseCustomerSsoConfigurationViewSet.update()
EntityIdNotFoundError
SsoConfigurationApiError
check_user_part_of_customer()
fetch_configuration_record()
fetch_entity_id_from_metadata_xml()
fetch_request_data_from_request()
get_customer_from_request()
get_metadata_xml_from_url()
- enterprise.api.v1.views.enterprise_customer_user module
EnterpriseCustomerUserViewSet
EnterpriseCustomerUserViewSet.FIELDS
EnterpriseCustomerUserViewSet.basename
EnterpriseCustomerUserViewSet.description
EnterpriseCustomerUserViewSet.detail
EnterpriseCustomerUserViewSet.filter_backends
EnterpriseCustomerUserViewSet.filterset_fields
EnterpriseCustomerUserViewSet.get_serializer_class()
EnterpriseCustomerUserViewSet.name
EnterpriseCustomerUserViewSet.ordering_fields
EnterpriseCustomerUserViewSet.pagination_class
EnterpriseCustomerUserViewSet.queryset
EnterpriseCustomerUserViewSet.suffix
- enterprise.api.v1.views.enterprise_group module
EnterpriseGroupViewSet
EnterpriseGroupViewSet.assign_learners()
EnterpriseGroupViewSet.basename
EnterpriseGroupViewSet.create()
EnterpriseGroupViewSet.description
EnterpriseGroupViewSet.detail
EnterpriseGroupViewSet.filter_backends
EnterpriseGroupViewSet.get_learners()
EnterpriseGroupViewSet.get_queryset()
EnterpriseGroupViewSet.name
EnterpriseGroupViewSet.permission_classes
EnterpriseGroupViewSet.queryset
EnterpriseGroupViewSet.queryset_with_removed
EnterpriseGroupViewSet.remove_learners()
EnterpriseGroupViewSet.serializer_class
EnterpriseGroupViewSet.suffix
EnterpriseGroupViewSet.update()
- enterprise.api.v1.views.enterprise_subsidy_fulfillment module
EnrollmentModificationException
EnterpriseSubsidyFulfillmentViewSet
EnterpriseSubsidyFulfillmentViewSet.basename
EnterpriseSubsidyFulfillmentViewSet.cancel_enrollment()
EnterpriseSubsidyFulfillmentViewSet.description
EnterpriseSubsidyFulfillmentViewSet.detail
EnterpriseSubsidyFulfillmentViewSet.get_subsidy_fulfillment_queryset()
EnterpriseSubsidyFulfillmentViewSet.get_subsidy_fulfillment_serializer_class()
EnterpriseSubsidyFulfillmentViewSet.get_unenrolled_fulfillment_queryset()
EnterpriseSubsidyFulfillmentViewSet.get_unenrolled_fulfillment_serializer_class()
EnterpriseSubsidyFulfillmentViewSet.name
EnterpriseSubsidyFulfillmentViewSet.retrieve()
EnterpriseSubsidyFulfillmentViewSet.suffix
EnterpriseSubsidyFulfillmentViewSet.unenrolled()
LicensedEnterpriseCourseEnrollmentViewSet
LicensedEnterpriseCourseEnrollmentViewSet.EnrollmentTerminationStatus
LicensedEnterpriseCourseEnrollmentViewSet.OPT_IGNORE_ENROLLMENTS_MODIFIED_AFTER_PARAM
LicensedEnterpriseCourseEnrollmentViewSet.REQ_EXP_LICENSE_UUIDS_PARAM
LicensedEnterpriseCourseEnrollmentViewSet.basename
LicensedEnterpriseCourseEnrollmentViewSet.bulk_licensed_enrollments_expiration()
LicensedEnterpriseCourseEnrollmentViewSet.description
LicensedEnterpriseCourseEnrollmentViewSet.detail
LicensedEnterpriseCourseEnrollmentViewSet.license_revoke()
LicensedEnterpriseCourseEnrollmentViewSet.name
LicensedEnterpriseCourseEnrollmentViewSet.queryset
LicensedEnterpriseCourseEnrollmentViewSet.serializer_class
LicensedEnterpriseCourseEnrollmentViewSet.suffix
- enterprise.api.v1.views.notifications module
NotificationReadView
NotificationReadView.MISSING_REQUIRED_PARAMS_MSG
NotificationReadView.REQUIRED_PARAM_ENTERPRISE_SLUG
NotificationReadView.REQUIRED_PARAM_NOTIFICATION_ID
NotificationReadView.authentication_classes
NotificationReadView.get_missing_params_message()
NotificationReadView.get_required_query_params()
NotificationReadView.permission_classes
NotificationReadView.post()
NotificationReadView.throttle_classes
- enterprise.api.v1.views.pending_enterprise_customer_user module
PendingEnterpriseCustomerUserEnterpriseAdminViewSet
PendingEnterpriseCustomerUserEnterpriseAdminViewSet.basename
PendingEnterpriseCustomerUserEnterpriseAdminViewSet.description
PendingEnterpriseCustomerUserEnterpriseAdminViewSet.detail
PendingEnterpriseCustomerUserEnterpriseAdminViewSet.link_learners()
PendingEnterpriseCustomerUserEnterpriseAdminViewSet.name
PendingEnterpriseCustomerUserEnterpriseAdminViewSet.permission_classes
PendingEnterpriseCustomerUserEnterpriseAdminViewSet.serializer_class
PendingEnterpriseCustomerUserEnterpriseAdminViewSet.suffix
PendingEnterpriseCustomerUserViewSet
PendingEnterpriseCustomerUserViewSet.FIELDS
PendingEnterpriseCustomerUserViewSet.UNIQUE
PendingEnterpriseCustomerUserViewSet.USER_EXISTS_ERROR
PendingEnterpriseCustomerUserViewSet.basename
PendingEnterpriseCustomerUserViewSet.create()
PendingEnterpriseCustomerUserViewSet.description
PendingEnterpriseCustomerUserViewSet.detail
PendingEnterpriseCustomerUserViewSet.filter_backends
PendingEnterpriseCustomerUserViewSet.filterset_fields
PendingEnterpriseCustomerUserViewSet.name
PendingEnterpriseCustomerUserViewSet.ordering_fields
PendingEnterpriseCustomerUserViewSet.permission_classes
PendingEnterpriseCustomerUserViewSet.queryset
PendingEnterpriseCustomerUserViewSet.serializer_class
PendingEnterpriseCustomerUserViewSet.suffix
- enterprise.api.v1.views.plotly_auth module
- Module contents
Submodules#
enterprise.api.v1.decorators module#
Decorators for Enterprise API views.
- enterprise.api.v1.decorators.require_at_least_one_query_parameter(*query_parameter_names)#
Ensure at least one of the specified query parameters are included in the request.
This decorator checks for the existence of at least one of the specified query parameters and passes the values as function parameters to the decorated view. If none of the specified query parameters are included in the request, a ValidationError is raised.
Usage:
@require_at_least_one_query_parameter('program_uuids', 'course_run_ids') def my_view(request, program_uuids, course_run_ids): # Some functionality ...
enterprise.api.v1.fields module#
Fields for Enterprise API serializers.
- class enterprise.api.v1.fields.Base64EmailCSVField(*args, **kwargs)#
Bases:
Field
Serializers a Base64 encoded CSV with emails into an array of emails
- to_internal_value(data)#
Transform the incoming primitive data into a native value.
- to_representation(value)#
Transform the outgoing native value into primitive data.
enterprise.api.v1.permissions module#
Custom API permissions.
- class enterprise.api.v1.permissions.IsInEnterpriseGroup#
Bases:
BasePermission
Find out if the requesting user belongs to a django group meant for granting access to an enterprise feature. This check applies to both staff and non-staff users.
- ALLOWED_API_GROUPS = []#
- has_permission(request, view)#
Return True if permission is granted, False otherwise.
- message = 'User is not allowed to access the view.'#
enterprise.api.v1.serializers module#
Serializers for enterprise api version 1.
- class enterprise.api.v1.serializers.AdminNotificationSerializer(*args, **kwargs)#
Bases:
ModelSerializer
Serializer for AdminNotification model.
- class Meta#
Bases:
object
- fields = ('id', 'title', 'text')#
- model#
alias of
AdminNotification
- class enterprise.api.v1.serializers.AnalyticsSummarySerializer(*args, **kwargs)#
Bases:
Serializer
Serializer for the payload data of analytics summary endpoint.
- class LearnerEngagementSerializer(*args, **kwargs)#
Bases:
Serializer
Serializer for the summary related data in the analytics summary endpoint.
- class LearnerProgressSerializer(*args, **kwargs)#
Bases:
Serializer
Serializer for the learner progress data in the analytics summary endpoint.
- class enterprise.api.v1.serializers.BaseEnterpriseCustomerInviteKeySerializer(*args, **kwargs)#
Bases:
ModelSerializer
Base serializer for writing to the EnterpriseCustomerInviteKey model.
- class Meta#
Bases:
object
- fields = ('uuid', 'enterprise_customer_uuid', 'usage_limit', 'expiration_date', 'is_active', 'is_valid')#
- model#
alias of
EnterpriseCustomerInviteKey
- class enterprise.api.v1.serializers.CourseDetailSerializer(*args, **kwargs)#
Bases:
ImmutableStateSerializer
Serializer for course data retrieved from the discovery service course detail API endpoint.
This serializer updates the course and course run data with the EnterpriseCustomer-specific enrollment page URL for the given course and course runs.
- class enterprise.api.v1.serializers.CourseRunDetailSerializer(*args, **kwargs)#
Bases:
ImmutableStateSerializer
Serializer for course run data retrieved from the discovery service course_run detail API endpoint.
This serializer updates the course run data with the EnterpriseCustomer-specific enrollment page URL for the given course run.
- class enterprise.api.v1.serializers.EnrollmentsInfoSerializer(*args, **kwargs)#
Bases:
Serializer
Nested serializer class to allow for many license info dictionaries.
- create(validated_data)#
- validate(data)#
- class enterprise.api.v1.serializers.EnterpriseCatalogQuerySerializer(*args, **kwargs)#
Bases:
ModelSerializer
Serializer for the
EnterpriseCatalogQuery
model.- class Meta#
Bases:
object
- fields = '__all__'#
- model#
alias of
EnterpriseCatalogQuery
- class enterprise.api.v1.serializers.EnterpriseCourseEnrollmentReadOnlySerializer(*args, **kwargs)#
Bases:
ModelSerializer
Serializer for EnterpriseCourseEnrollment model.
- class Meta#
Bases:
object
- fields = ('enterprise_customer_user', 'course_id', 'unenrolled_at', 'created')#
- model#
alias of
EnterpriseCourseEnrollment
- class enterprise.api.v1.serializers.EnterpriseCourseEnrollmentWithAdditionalFieldsReadOnlySerializer(*args, **kwargs)#
Bases:
EnterpriseCourseEnrollmentReadOnlySerializer
Serializer for EnterpriseCourseEnrollment model with additional fields.
- class Meta#
Bases:
object
- fields = ('enterprise_customer_user', 'course_id', 'created', 'unenrolled_at', 'enrollment_date', 'enrollment_track', 'user_email', 'course_start', 'course_end')#
- model#
alias of
EnterpriseCourseEnrollment
- class enterprise.api.v1.serializers.EnterpriseCourseEnrollmentWriteSerializer(*args, **kwargs)#
Bases:
ModelSerializer
Serializer for writing to the EnterpriseCourseEnrollment model.
- class Meta#
Bases:
object
- fields = ('username', 'course_id')#
- model#
alias of
EnterpriseCourseEnrollment
- enterprise_customer_user = None#
- save()#
Save the model with the found EnterpriseCustomerUser.
- validate_username(value)#
Verify that the username has a matching user, and that the user has an associated EnterpriseCustomerUser.
- class enterprise.api.v1.serializers.EnterpriseCustomerApiCredentialRegeneratePatchSerializer(*args, **kwargs)#
Bases:
Serializer
Serializer for the
EnterpriseCustomerApiCredential
- class enterprise.api.v1.serializers.EnterpriseCustomerApiCredentialSerializer(*args, **kwargs)#
Bases:
Serializer
Serializer for the
EnterpriseCustomerApiCredential
- update(instance, validated_data)#
- class enterprise.api.v1.serializers.EnterpriseCustomerBasicSerializer(*args, **kwargs)#
Bases:
ModelSerializer
Serializer for EnterpriseCustomer model only for name and id fields.
- class Meta#
Bases:
object
- fields = ('id', 'name')#
- model#
alias of
EnterpriseCustomer
- class enterprise.api.v1.serializers.EnterpriseCustomerBrandingConfigurationSerializer(*args, **kwargs)#
Bases:
ModelSerializer
Serializer for EnterpriseCustomerBrandingConfiguration model.
- class Meta#
Bases:
object
- fields = ('enterprise_customer', 'enterprise_slug', 'logo', 'primary_color', 'secondary_color', 'tertiary_color')#
- model#
- get_enterprise_customer(obj)#
Return a string representation of the associated enterprise customer’s UUID.
- get_enterprise_slug(obj)#
Return the slug of the associated enterprise customer.
- get_logo(obj)#
Use EnterpriseCustomerBrandingConfiguration.safe_logo_url to return an absolute URL for either the saved customer logo or the platform logo by default
- get_primary_color(obj)#
Return the primary color of the branding config OR the default primary color code
- get_secondary_color(obj)#
Return the secondary color of the branding config OR the default secondary color code
- get_tertiary_color(obj)#
Return the tertiary color of the branding config OR the default tertiary color code
- class enterprise.api.v1.serializers.EnterpriseCustomerBulkEnrollmentsSerializer(*args, **kwargs)#
Bases:
Serializer
Serializes a email_csv or email field for bulk enrollment requests.
- create(validated_data)#
- validate(data)#
- class enterprise.api.v1.serializers.EnterpriseCustomerBulkSubscriptionEnrollmentsSerializer(*args, **kwargs)#
Bases:
Serializer
Serializes a licenses info field for bulk enrollment requests.
- create(validated_data)#
- validate(data)#
- class enterprise.api.v1.serializers.EnterpriseCustomerCatalogDetailSerializer(*args, **kwargs)#
Bases:
EnterpriseCustomerCatalogSerializer
Serializer for the
EnterpriseCustomerCatalog
model which includes the catalog’s discovery service search query results.- to_representation(instance)#
Serialize the EnterpriseCustomerCatalog object.
- Parameters:
instance (EnterpriseCustomerCatalog) – The EnterpriseCustomerCatalog to serialize.
- Returns:
The EnterpriseCustomerCatalog converted to a dict.
- Return type:
- class enterprise.api.v1.serializers.EnterpriseCustomerCatalogSerializer(*args, **kwargs)#
Bases:
ModelSerializer
Serializer for the
EnterpriseCustomerCatalog
model.- class Meta#
Bases:
object
- fields = ('uuid', 'title', 'enterprise_customer', 'enterprise_catalog_query', 'created', 'modified')#
- model#
alias of
EnterpriseCustomerCatalog
- class enterprise.api.v1.serializers.EnterpriseCustomerCatalogWriteOnlySerializer(*args, **kwargs)#
Bases:
EnterpriseCustomerCatalogSerializer
Serializer for the
EnterpriseCustomerCatalog
model which includes the catalog’s discovery service search query results.- class Meta#
Bases:
object
- extra_kwargs = {'enterprise_catalog_query': {'required': False}, 'enterprise_customer': {'required': True}, 'title': {'required': True}, 'uuid': {'required': False}}#
- fields = ('uuid', 'title', 'enterprise_customer', 'enterprise_catalog_query')#
- model#
alias of
EnterpriseCustomerCatalog
- class enterprise.api.v1.serializers.EnterpriseCustomerCourseEnrollmentsListSerializer(*args, **kwargs)#
Bases:
ListSerializer
Serializes a list of enrollment requests.
Meant to be used in conjunction with EnterpriseCustomerCourseEnrollmentsSerializer.
- create(validated_data)#
This selectively calls the child create method based on whether or not validation failed for each payload.
- to_internal_value(data)#
This implements the same relevant logic as ListSerializer except that if one or more items fail validation, processing for other items that did not fail will continue.
- to_representation(data)#
This selectively calls to_representation on each result that was processed by create.
- class enterprise.api.v1.serializers.EnterpriseCustomerCourseEnrollmentsSerializer(*args, **kwargs)#
Bases:
Serializer
Serializes enrollment information for a collection of students/emails.
This is mainly useful for implementing validation when performing enrollment operations.
- create(validated_data)#
Perform the enrollment for existing enterprise customer users, or create the pending objects for new users.
- validate(data)#
Validate that at least one of the user identifier fields has been passed in.
- validate_course_run_id(value)#
Validates that the course run id is part of the Enterprise Customer’s catalog.
- validate_lms_user_id(value)#
Validates the lms_user_id, if is given, to see if there is an existing EnterpriseCustomerUser for it.
- validate_tpa_user_id(value)#
Validates the tpa_user_id, if is given, to see if there is an existing EnterpriseCustomerUser for it.
It first uses the third party auth api to find the associated username to do the lookup.
- validate_user_email(value)#
Validates the user_email, if given, to see if an existing EnterpriseCustomerUser exists for it.
If it does not, it does not fail validation, unlike for the other field validation methods above.
- class enterprise.api.v1.serializers.EnterpriseCustomerIdentityProviderSerializer(*args, **kwargs)#
Bases:
ModelSerializer
Serializer for EnterpriseCustomerIdentityProvider model.
- class Meta#
Bases:
object
- fields = ('provider_id', 'default_provider')#
- model#
alias of
EnterpriseCustomerIdentityProvider
- class enterprise.api.v1.serializers.EnterpriseCustomerInviteKeyPartialUpdateSerializer(*args, **kwargs)#
Bases:
ModelSerializer
Serializer for updating the EnterpriseCustomerInviteKey model.
- class Meta#
Bases:
object
- fields = ('expiration_date', 'is_active')#
- model#
alias of
EnterpriseCustomerInviteKey
- class enterprise.api.v1.serializers.EnterpriseCustomerInviteKeyReadOnlySerializer(*args, **kwargs)#
Bases:
BaseEnterpriseCustomerInviteKeySerializer
Serializer for reading the EnterpriseCustomerInviteKey model.
- class Meta#
Bases:
Meta
- additional_fields = ('enterprise_customer_name', 'usage_count', 'created')#
- fields = ('uuid', 'enterprise_customer_uuid', 'usage_limit', 'expiration_date', 'is_active', 'is_valid', 'enterprise_customer_name', 'usage_count', 'created')#
- get_enterprise_customer_name(obj)#
- get_enterprise_customer_uuid(obj)#
- class enterprise.api.v1.serializers.EnterpriseCustomerInviteKeyWriteSerializer(*args, **kwargs)#
Bases:
BaseEnterpriseCustomerInviteKeySerializer
Serializer for writing to the EnterpriseCustomerInviteKey model.
- save()#
- validate_enterprise_customer_uuid(value)#
Validates an EnterpriseCustomer with the given enterprise_customer_uuid exists.
- class enterprise.api.v1.serializers.EnterpriseCustomerReportingConfigurationSerializer(*args, **kwargs)#
Bases:
ModelSerializer
Serializer for EnterpriseCustomerReportingConfiguration model.
- class Meta#
Bases:
object
- fields = ('enterprise_customer', 'enterprise_customer_id', 'active', 'delivery_method', 'email', 'frequency', 'day_of_month', 'day_of_week', 'hour_of_day', 'include_date', 'encrypted_password', 'sftp_hostname', 'sftp_port', 'sftp_username', 'encrypted_sftp_password', 'sftp_file_path', 'data_type', 'report_type', 'pgp_encryption_key', 'enterprise_customer_catalogs', 'uuid', 'enterprise_customer_catalog_uuids', 'enable_compression')#
- model#
- create(validated_data)#
Perform the creation of model instance and link the enterprise customer catalogs.
- Parameters:
validated_data (dict) – A dictionary containing serializer’s validated data.
- Returns:
- Instance of the newly created enterprise customer
reporting configuration.
- Return type:
- update(instance, validated_data)#
Update the instance of enterprise customer reporting configuration and link the enterprise customer catalogs.
- Parameters:
instance (EnterpriseCustomerReportingConfiguration) – Instance of the enterprise customer reporting configuration being updated.
validated_data (dict) – A dictionary containing serializer’s validated data.
- Returns:
- Instance of the newly created enterprise customer
reporting configuration.
- Return type:
- validate(data)#
- validate_pgp_encryption_key(value)#
Validate that pgp_encryption_key is correctly set or left empty.
- class enterprise.api.v1.serializers.EnterpriseCustomerSerializer(*args, **kwargs)#
Bases:
ModelSerializer
Serializer for EnterpriseCustomer model.
- class Meta#
Bases:
object
- fields = ('uuid', 'name', 'slug', 'active', 'auth_org_id', 'site', 'enable_data_sharing_consent', 'enforce_data_sharing_consent', 'branding_configuration', 'identity_provider', 'enable_audit_enrollment', 'replace_sensitive_sso_username', 'enable_portal_code_management_screen', 'sync_learner_profile_data', 'enable_audit_data_reporting', 'enable_learner_portal', 'enable_learner_portal_offers', 'enable_portal_learner_credit_management_screen', 'enable_executive_education_2U_fulfillment', 'enable_portal_reporting_config_screen', 'enable_portal_saml_configuration_screen', 'contact_email', 'enable_portal_subscription_management_screen', 'hide_course_original_price', 'enable_analytics_screen', 'enable_integrated_customer_learner_portal_search', 'enable_generation_of_api_credentials', 'enable_portal_lms_configurations_screen', 'sender_alias', 'identity_providers', 'enterprise_customer_catalogs', 'reply_to', 'enterprise_notification_banner', 'hide_labor_market_data', 'modified', 'enable_universal_link', 'enable_browse_and_request', 'admin_users', 'enable_career_engagement_network_on_learner_portal', 'career_engagement_network_message', 'enable_pathways', 'enable_programs', 'enable_demo_data_for_analytics_and_lpr', 'enable_academies', 'enable_one_academy', 'active_integrations')#
- model#
alias of
EnterpriseCustomer
- get_active_integrations(obj)#
- get_admin_users(obj)#
- get_branding_configuration(obj)#
Return the serialized branding configuration object OR default object if null
- get_enterprise_customer_catalogs(obj)#
Return list of catalog uuids associated with the enterprise customer.
- get_enterprise_notification_banner(obj)#
Return the notification text if exist OR None
- class enterprise.api.v1.serializers.EnterpriseCustomerSsoConfiguration(*args, **kwargs)#
Bases:
ModelSerializer
Serializer for the
EnterpriseCustomerSsoConfiguration
model.- class Meta#
Bases:
object
- fields = '__all__'#
- model#
alias of
EnterpriseCustomerSsoConfiguration
- get_enterprise_customer(obj)#
Return a string representation of the associated enterprise customer’s UUID.
- get_is_pending_configuration(obj)#
Return whether the SSO configuration is pending configuration.
- class enterprise.api.v1.serializers.EnterpriseCustomerToggleUniversalLinkSerializer(*args, **kwargs)#
Bases:
Serializer
Serializer for toggling an EnterpriseCustomer enable_universal_link field.
- class enterprise.api.v1.serializers.EnterpriseCustomerUnlinkUsersSerializer(*args, **kwargs)#
Bases:
Serializer
Serializer for the
EnterpriseCustomerViewSet
unlink_users action.
- class enterprise.api.v1.serializers.EnterpriseCustomerUserReadOnlySerializer(*args, **kwargs)#
Bases:
ModelSerializer
Serializer for EnterpriseCustomerUser model.
- class Meta#
Bases:
object
- fields = ('id', 'enterprise_customer', 'active', 'user_id', 'user', 'data_sharing_consent_records', 'groups', 'created', 'invite_key', 'role_assignments', 'enterprise_group')#
- model#
alias of
EnterpriseCustomerUser
- get_data_sharing_consent_records(obj)#
Return serialization of EnterpriseCustomerUser.data_sharing_consent_records property.
- get_enterprise_group(obj)#
Return the enterprise group membership for this enterprise customer user.
- get_groups(obj)#
Return the enterprise related django groups that this user is a part of.
- get_role_assignments(obj)#
Return the enterprise role assignments for this enterprise customer user.
- class enterprise.api.v1.serializers.EnterpriseCustomerUserWriteSerializer(*args, **kwargs)#
Bases:
ModelSerializer
Serializer for writing to the EnterpriseCustomerUser model.
- class Meta#
Bases:
object
- fields = ('enterprise_customer', 'username', 'active')#
- model#
alias of
EnterpriseCustomerUser
- USER_DOES_NOT_EXIST = 'User does not exist'#
- save()#
Save the EnterpriseCustomerUser.
- user = None#
- validate_username(value)#
Verify that the username has a matching user.
- class enterprise.api.v1.serializers.EnterpriseGroupLearnersRequestQuerySerializer(*args, **kwargs)#
Bases:
Serializer
Serializer for the Enterprise Group Learners endpoint query filter
- class enterprise.api.v1.serializers.EnterpriseGroupMembershipSerializer(*args, **kwargs)#
Bases:
ModelSerializer
Serializer for EnterpriseGroupMembership model.
- class Meta#
Bases:
object
- fields = ('learner_id', 'pending_learner_id', 'enterprise_group_membership_uuid', 'member_details', 'recent_action', 'status')#
- model#
alias of
EnterpriseGroupMembership
- get_member_details(obj)#
Return either the member’s name and email if it’s the case that the member is realized, otherwise just email
- get_recent_action(obj)#
Return the timestamp and name of the most recent action associated with the membership.
- class enterprise.api.v1.serializers.EnterpriseGroupRequestDataSerializer(*args, **kwargs)#
Bases:
Serializer
Serializer for the Enterprise Group Assign Learners endpoint query params
- class enterprise.api.v1.serializers.EnterpriseGroupSerializer(*args, **kwargs)#
Bases:
ModelSerializer
Serializer for EnterpriseGroup model.
- class Meta#
Bases:
object
- fields = ('enterprise_customer', 'name', 'uuid', 'applies_to_all_contexts')#
- model#
alias of
EnterpriseGroup
- class enterprise.api.v1.serializers.ImmutableStateSerializer(*args, **kwargs)#
Bases:
Serializer
Base serializer for any serializer that inhibits state changing requests.
- create(validated_data)#
Do not perform any operations for state changing requests.
- update(instance, validated_data)#
Do not perform any operations for state changing requests.
- class enterprise.api.v1.serializers.LearnerCreditEnterpriseCourseEnrollmentReadOnlySerializer(*args, **kwargs)#
Bases:
ModelSerializer
Serializer for LearnerCreditEnterpriseCourseEnrollment model.
- class enterprise.api.v1.serializers.LicensedEnterpriseCourseEnrollmentReadOnlySerializer(*args, **kwargs)#
Bases:
ModelSerializer
Serializer for LicensedEnterpriseCourseEnrollment model.
- class Meta#
Bases:
object
- fields = ('enterprise_course_enrollment', 'license_uuid', 'uuid')#
- model#
alias of
LicensedEnterpriseCourseEnrollment
- class enterprise.api.v1.serializers.LinkLearnersSerializer(*args, **kwargs)#
Bases:
PendingEnterpriseCustomerUserSerializer
Extends the PendingEnterpriseCustomerSerializer to validate that the enterprise customer uuid matches the uuid the user has permissions to update
- NOT_AUTHORIZED_ERROR = 'Not authorized for this enterprise'#
- validate_enterprise_customer(value)#
Check that the enterprise customer is the same as the one the user has permissions for The value recieved is an EnterpriseCustomer object
- class enterprise.api.v1.serializers.PendingEnterpriseCustomerUserSerializer(*args, **kwargs)#
Bases:
ModelSerializer
Serializer for writing to the PendingEnterpriseCustomerUser model.
- class Meta#
Bases:
object
- fields = ('enterprise_customer', 'user_email')#
- model#
alias of
PendingEnterpriseCustomerUser
- create(attrs)#
Create the PendingEnterpriseCustomerUser, or EnterpriseCustomerUser if a user with the validated_email already exists.
- to_representation(instance)#
Because we are returning whether or not the instance was created from the create method, we must use the instance for to_representation and ignore the “created” half of the tuple
- class enterprise.api.v1.serializers.ProgramDetailSerializer(*args, **kwargs)#
Bases:
ImmutableStateSerializer
Serializer for program data retrieved from the discovery service program detail API endpoint.
This serializer updates the program data and child course run data with EnterpriseCustomer-specific enrollment page URLs for the given content types.
- class enterprise.api.v1.serializers.ResponsePaginationSerializer(*args, **kwargs)#
Bases:
ImmutableStateSerializer
Serializer for responses that require pagination.
- class enterprise.api.v1.serializers.SiteField(*args, **kwargs)#
Bases:
Field
Custom Site field to facilitate with creation of parent objects, while also keeping output pretty.
When used in a ModelSerializer, the site field can be provided to the create() REST API endpoint as follows, which performs a lookup for a site with the domain “example.com”:
"site": {"domain": "example.com"}
Output serializations render sites with all Site fields.
- to_internal_value(data)#
Transform the incoming primitive data into a native value.
- to_representation(value)#
Transform the outgoing native value into primitive data.
- class enterprise.api.v1.serializers.SiteSerializer(*args, **kwargs)#
Bases:
ModelSerializer
Serializer for Site model.
enterprise.api.v1.urls module#
URL definitions for enterprise api version 1 endpoint.
Module contents#
API endpoint for enterprise app.