# Class AdminLicenseApi

#### Hierarchy (View Summary)

- JBaseApi
  - AdminLicenseApi

- Defined in jamespot-user-api/src/apis/admin/license.ts:22

##### Index

### Constructors

constructor

### Properties

jApi
network

### Methods

assignKindLicense
assignLicense
assignPossiblesLicenses
checkUsersManagement
executeUsersAdd
getAssignmentMode
getLicenseArticles
getLicensesAssigned
getLicensesNotAssigned
getLicenseStatistics
getLicenseUsersByKind
getLicenseUserStatistics
getObjectsWithoutLicense
optimizeLicenses
setAssignmentMode
simulateUsersAdd
unAssignKindLicense
unAssignLicense
unAssignUnusedLicenses

## Constructors

### constructor

- new AdminLicenseApi(jApi: JamespotUserApi): AdminLicenseApi

  #### Parameters

  - jApi: JamespotUserApi

  #### Returns AdminLicenseApi

  Inherited from JBaseApi.constructor

  - Defined in jamespot-user-api/src/apis/base.ts:8

## Properties

### jApi

jApi: JamespotUserApi

Inherited from JBaseApi.jApi

- Defined in jamespot-user-api/src/apis/base.ts:5

### network

network: Network

Inherited from JBaseApi.network

- Defined in jamespot-user-api/src/apis/base.ts:6

## Methods

### assignKindLicense

- assignKindLicense(
  uri: string,
  kind: string,
  ): Promise<ApiWrapper<boolean, BaseMessages>>

  Assigns a license to a given kind with the provided uri (if any is available)

  #### Parameters

  - uri: string

    URI of the object to which a license must be assigned

  - kind: string

    the kind of license which must be assigned

  #### Returns Promise<ApiWrapper<boolean, BaseMessages>>

  boolean

  - Defined in jamespot-user-api/src/apis/admin/license.ts:70

### assignLicense

- assignLicense(uri: string): Promise<ApiWrapper<boolean, BaseMessages>>

  Assigns a license to the content with the provided uri (if any is available)

  #### Parameters

  - uri: string

    URI of the object to which a license must be assigned

  #### Returns Promise<ApiWrapper<boolean, BaseMessages>>

  boolean

  - Defined in jamespot-user-api/src/apis/admin/license.ts:56

### assignPossiblesLicenses

- assignPossiblesLicenses(
  type: string,
  kind?: string,
  ): Promise<ApiWrapper<boolean, BaseMessages>>

  Assign the available licenses

  #### Parameters

  - type: string

    the type of licenses for which we will assign the remaining available one

  - `Optional` kind: string

    particular license kind to assign

  #### Returns Promise<ApiWrapper<boolean, BaseMessages>>

  boolean

  - Defined in jamespot-user-api/src/apis/admin/license.ts:145

### checkUsersManagement

- checkUsersManagement(
  options?: { signal?: AbortSignal },
  ): Promise<ApiWrapper<boolean, BaseMessages>>

  #### Parameters

  - `Optional` options: { signal?: AbortSignal }

  #### Returns Promise<ApiWrapper<boolean, BaseMessages>>

  - Defined in jamespot-user-api/src/apis/admin/license.ts:263

### executeUsersAdd

- executeUsersAdd(
  payload: { increment: number },
  options?: { signal?: AbortSignal },
  ): Promise<ApiWrapper<boolean, BaseMessages>>

  #### Parameters

  - payload: { increment: number }
  - `Optional` options: { signal?: AbortSignal }

  #### Returns Promise<ApiWrapper<boolean, BaseMessages>>

  - Defined in jamespot-user-api/src/apis/admin/license.ts:289

### getAssignmentMode

- getAssignmentMode(
  type: string,
  signal?: AbortSignal,
  ): Promise<ApiWrapper<string, BaseMessages>>

  Retrieve the assignment license user mode between automatic | manual

  #### Parameters

  - type: string

    retrieve the automatic license assignation

  - `Optional` signal: AbortSignal

    the signal to cancel the request

  #### Returns Promise<ApiWrapper<string, BaseMessages>>

  a string who's the current assignment selected

  - Defined in jamespot-user-api/src/apis/admin/license.ts:113

### getLicenseArticles

- getLicenseArticles<
  T extends jArticleList = jArticleList,
  K extends ArticleFormatsExtension = ArticleFormatsExtension,
  >(
  payload: GetLicenseArticlesParams,
  params: {
  format: "raw-little" | "raw-list" | "raw-view" | undefined;
  formatExtension: (
  | "comments"
  | "search"
  | "actions"
  | "attachments"
  | "contact"
  | "filebank"
  | "licenses"
  | "licensesExtrabot"
  | "messenger"
  | "filebankPath"
  | "parentArticle"
  | "quarantine"
  | "quizFieldDefinitions"
  | "quizResponseRecord"
  | "recurringEventRecord"
  | "socialEventRecord"
  | "surveyDateRecord"
  | "bookmark"
  )[];
  signal?: AbortSignal;
  },
  ): Promise<ApiWrapper<PagingResults<GetLicenseArticle<T, K>>, BaseMessages>>

  #### Type Parameters

  - T extends jArticleList = jArticleList
  - K extends ArticleFormatsExtension = ArticleFormatsExtension

  #### Parameters

  - payload: GetLicenseArticlesParams
  - params: {
    format: "raw-little" | "raw-list" | "raw-view" | undefined;
    formatExtension: (
    | "comments"
    | "search"
    | "actions"
    | "attachments"
    | "contact"
    | "filebank"
    | "licenses"
    | "licensesExtrabot"
    | "messenger"
    | "filebankPath"
    | "parentArticle"
    | "quarantine"
    | "quizFieldDefinitions"
    | "quizResponseRecord"
    | "recurringEventRecord"
    | "socialEventRecord"
    | "surveyDateRecord"
    | "bookmark"
    )[];
    signal?: AbortSignal;
    }

  #### Returns Promise<ApiWrapper<PagingResults<GetLicenseArticle<T, K>>, BaseMessages>>

  - Defined in jamespot-user-api/src/apis/admin/license.ts:245

### getLicensesAssigned

- getLicensesAssigned(
  type: string,
  ): Promise<ApiWrapper<AdminLicensesAssigned[], BaseMessages>>

  Retireve the list of licenses assigned to content of a given type

  #### Parameters

  - type: string

    type of content for which we want to retrieve the licenses

  #### Returns Promise<ApiWrapper<AdminLicensesAssigned[], BaseMessages>>

  The list of licenses assigned to content of the provided type

  - Defined in jamespot-user-api/src/apis/admin/license.ts:221

### getLicensesNotAssigned

- getLicensesNotAssigned(
  type: string,
  ): Promise<ApiWrapper<Record<string, number>, BaseMessages>>

  Retireve the list of licenses assigned to content of a given type

  #### Parameters

  - type: string

    type of content for which we want to retrieve the licenses not assigned

  #### Returns Promise<ApiWrapper<Record<string, number>, BaseMessages>>

  The number of licenses depending on the type used as param

  - Defined in jamespot-user-api/src/apis/admin/license.ts:207

### getLicenseStatistics

- getLicenseStatistics(
  kind: string,
  type?: string,
  signal?: AbortSignal,
  ): Promise<ApiWrapper<AdminLicenseStats, BaseMessages>>

  Retrieve the licenses stats for a given kind

  #### Parameters

  - kind: string
  - `Optional` type: string
  - `Optional` signal: AbortSignal

  #### Returns Promise<ApiWrapper<AdminLicenseStats, BaseMessages>>

  - Defined in jamespot-user-api/src/apis/admin/license.ts:39

### getLicenseUsersByKind

- getLicenseUsersByKind<T extends jUserLittle = jUserLittle>(
  __namedParameters: GetLicenseKindUsersParams,
  format: "raw-little" | "raw-list" | "raw-view" | undefined,
  signal?: AbortSignal,
  ): Promise<
  ApiWrapper<
  PagingResults<
  {
  [k in "user"
  | "license"]: addQuestionMarks<
  baseObjectOutputType<
  {
  license: ZodUnion<[ZodLiteral<(...)>, ZodLiteral<(...)>]>;
  user: ZodType<T, ZodTypeDef, T>;
  },
  >,
  any,
  >[k]
  },
  >,
  BaseMessages,
  >,
  >

  #### Type Parameters

  - T extends jUserLittle = jUserLittle

  #### Parameters

  - __namedParameters: GetLicenseKindUsersParams
  - format: "raw-little" | "raw-list" | "raw-view" | undefined
  - `Optional` signal: AbortSignal

  #### Returns Promise<
  ApiWrapper<
  PagingResults<
  {
  [k in "user"
  | "license"]: addQuestionMarks<
  baseObjectOutputType<
  {
  license: ZodUnion<[ZodLiteral<(...)>, ZodLiteral<(...)>]>;
  user: ZodType<T, ZodTypeDef, T>;
  },
  >,
  any,
  >[k]
  },
  >,
  BaseMessages,
  >,
  >

  - Defined in jamespot-user-api/src/apis/admin/license.ts:229

### getLicenseUserStatistics

- getLicenseUserStatistics(
  signal?: AbortSignal,
  ): Promise<ApiWrapper<AdminLicenseStats, BaseMessages>>

  Retrieve the user licenses stats

  #### Parameters

  - `Optional` signal: AbortSignal

  #### Returns Promise<ApiWrapper<AdminLicenseStats, BaseMessages>>

  - Defined in jamespot-user-api/src/apis/admin/license.ts:26

### getObjectsWithoutLicense

- getObjectsWithoutLicense(
  type: string,
  filter?: ObjectWithoutLicenseFilter[],
  ): Promise<ApiWrapper<number, BaseMessages>>

  Retrieves the number of licenses of a given type available. License type is different from the content type to which it can be assigned to.

  #### Parameters

  - type: string

    The type of license for which we want to know the availability

  - `Optional` filter: ObjectWithoutLicenseFilter[]

    the filters array the request can be called with

  #### Returns Promise<ApiWrapper<number, BaseMessages>>

  A promise with the number of object without license

  - Defined in jamespot-user-api/src/apis/admin/license.ts:192

### optimizeLicenses

- optimizeLicenses(
  type: string,
  kind?: string,
  ): Promise<ApiWrapper<boolean, BaseMessages>>

  Assign available licenses and unassign license for inactive users

  #### Parameters

  - type: string

    the type of licenses for which we will unassign and assign the possible licenses

  - `Optional` kind: string

    particular license kind to unassign and assign

  #### Returns Promise<ApiWrapper<boolean, BaseMessages>>

  boolean

  - Defined in jamespot-user-api/src/apis/admin/license.ts:175

### setAssignmentMode

- setAssignmentMode(
  type: string,
  assignmentMode: string,
  ): Promise<ApiWrapper<boolean, BaseMessages>>

  Change the mode which the license are affected to the users

  #### Parameters

  - type: string

    the type of license that would automatically be assigned

  - assignmentMode: string

    the mode which the license are affected (automatic | manual)

  #### Returns Promise<ApiWrapper<boolean, BaseMessages>>

  boolean

  - Defined in jamespot-user-api/src/apis/admin/license.ts:130

### simulateUsersAdd

- simulateUsersAdd(
  payload: { increment: number },
  options?: { signal?: AbortSignal },
  ): Promise<ApiWrapper<LicenseUserPriceUpdateSimulation, BaseMessages>>

  #### Parameters

  - payload: { increment: number }
  - `Optional` options: { signal?: AbortSignal }

  #### Returns Promise<ApiWrapper<LicenseUserPriceUpdateSimulation, BaseMessages>>

  - Defined in jamespot-user-api/src/apis/admin/license.ts:273

### unAssignKindLicense

- unAssignKindLicense(
  uri: string,
  kind: string,
  ): Promise<ApiWrapper<boolean, BaseMessages>>

  Unassigns the license linked to the given kind with the provided uri

  #### Parameters

  - uri: string

    URI of the object to which a license must be unassigned

  - kind: string

    the kind of license which must be unassigned

  #### Returns Promise<ApiWrapper<boolean, BaseMessages>>

  boolean

  - Defined in jamespot-user-api/src/apis/admin/license.ts:98

### unAssignLicense

- unAssignLicense(uri: string): Promise<ApiWrapper<boolean, BaseMessages>>

  Unassigns the license linked to the content with the provided uri

  #### Parameters

  - uri: string

    URI of the object to which a license must be unassigned

  #### Returns Promise<ApiWrapper<boolean, BaseMessages>>

  boolean

  - Defined in jamespot-user-api/src/apis/admin/license.ts:84

### unAssignUnusedLicenses

- unAssignUnusedLicenses(
  type: string,
  kind?: string,
  ): Promise<ApiWrapper<boolean, BaseMessages>>

  Unassign licenses for inactive users

  #### Parameters

  - type: string

    the type of licenses for which we will unassign upon inactive user

  - `Optional` kind: string

    particular license kind to unassign

  #### Returns Promise<ApiWrapper<boolean, BaseMessages>>

  boolean

  - Defined in jamespot-user-api/src/apis/admin/license.ts:160