-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
/
ApplicationRoleConnectionMetadata.js
48 lines (40 loc) · 1.21 KB
/
ApplicationRoleConnectionMetadata.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
'use strict';
const { ApplicationRoleConnectionMetadataTypes } = require('../util/Constants');
/**
* Role connection metadata object for an application.
*/
class ApplicationRoleConnectionMetadata {
constructor(data) {
/**
* The name of this metadata field
* @type {string}
*/
this.name = data.name;
/**
* The name localizations for this metadata field
* @type {?Object<Locale, string>}
*/
this.nameLocalizations = data.name_localizations ?? null;
/**
* The description of this metadata field
* @type {string}
*/
this.description = data.description;
/**
* The description localizations for this metadata field
* @type {?Object<Locale, string>}
*/
this.descriptionLocalizations = data.description_localizations ?? null;
/**
* The dictionary key for this metadata field
* @type {string}
*/
this.key = data.key;
/**
* The type of this metadata field
* @type {ApplicationRoleConnectionMetadataType}
*/
this.type = typeof data.type === 'number' ? ApplicationRoleConnectionMetadataTypes[data.type] : data.type;
}
}
exports.ApplicationRoleConnectionMetadata = ApplicationRoleConnectionMetadata;