feat(ClientApplication): add role connections (#9072)

* feat: add add role connections

* feat: add add role connections

* fix: export new class in the index

* Update typings/rawDataTypes.d.ts

Co-authored-by: Aura Román <kyradiscord@gmail.com>

* chore: invite scope

* docs(ApplicationRoleConnectionMetadata): add docstring for the class

* docs(Constants): fix ApplicationRoleConnectionMetadataTypes jsdoc syntax

---------

Co-authored-by: Aura Román <kyradiscord@gmail.com>
Co-authored-by: SpaceEEC <spaceeec@yahoo.com>
This commit is contained in:
Jaworek
2023-02-17 22:44:04 +01:00
committed by GitHub
parent 32cdaff7eb
commit a7dc40f1a8
8 changed files with 186 additions and 1 deletions

View File

@@ -0,0 +1,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;