User
Extends:
Container class for all metadata pertaining to a user object from the NPR One API
Test:
Constructor Summary
Public Constructor | ||
public |
constructor(json: CollectionDocJSON) |
Member Summary
Public Members | ||
public |
|
Method Summary
Public Methods | ||
public |
Returns the programs, shows, and podcasts that this user has positively interacted with. |
|
public |
Returns the user's cohort. In most cases, SDK consumers will never need to use this. |
|
public |
Returns the list of organizations this user is affiliated with. |
|
public |
Returns the primary, non-NPR organization that this user is affiliated with, or null if no such organization exists. |
|
public |
Whether this user is a temporary user or not |
|
public |
A convenience function to cast this object back to a string, generally only used by the Logger class. |
Inherited Summary
From class CollectionDoc | ||
public get |
Exposed for legacy reasons. |
|
protected |
|
|
protected |
Ensure that the given Collection Doc is valid |
Public Constructors
public constructor(json: CollectionDocJSON) source
Override:
CollectionDoc#constructorParams:
Name | Type | Attribute | Description |
json | CollectionDocJSON | The decoded JSON object that should be used as the basis for this model |
Test:
Public Members
public attributes: UserAttributes source
Public Methods
public getAffiliations(): Array<UserAffiliation> source
Returns the programs, shows, and podcasts that this user has positively interacted with.
Test:
public getCohort(): UserCohort source
Returns the user's cohort. In most cases, SDK consumers will never need to use this.
Test:
public getOrganizations(): Array<UserOrganization> source
Returns the list of organizations this user is affiliated with. In most cases, you only want a single organization, in which case User#getPrimaryOrganization should be used.
Test:
public getPrimaryOrganization(): null | UserOrganization source
Returns the primary, non-NPR organization that this user is affiliated with, or null if no such organization exists.