Source: client/openapi/model/WorldStatus.js

  1. /**
  2. * OpenAPI definition
  3. * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
  4. *
  5. * The version of the OpenAPI document: v0
  6. *
  7. *
  8. * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
  9. * https://openapi-generator.tech
  10. * Do not edit the class manually.
  11. *
  12. */
  13. import {ApiClient} from '../ApiClient.js';
  14. /**
  15. * The WorldStatus model module.
  16. * @module model/WorldStatus
  17. * @version v0
  18. */
  19. export class WorldStatus {
  20. /**
  21. * Constructs a new <code>WorldStatus</code>.
  22. * @alias WorldStatus
  23. */
  24. constructor() {
  25. WorldStatus.initialize(this);
  26. }
  27. /**
  28. * Initializes the fields of this object.
  29. * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
  30. * Only for internal use.
  31. */
  32. static initialize(obj) {
  33. }
  34. /**
  35. * Constructs a <code>WorldStatus</code> from a plain JavaScript object, optionally creating a new instance.
  36. * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
  37. * @param {Object} data The plain JavaScript object bearing properties of interest.
  38. * @param {WorldStatus} obj Optional instance to populate.
  39. * @return {WorldStatus} The populated <code>WorldStatus</code> instance.
  40. */
  41. static constructFromObject(data, obj) {
  42. if (data) {
  43. obj = obj || new WorldStatus();
  44. if (data.hasOwnProperty('worldName')) {
  45. obj['worldName'] = ApiClient.convertToType(data['worldName'], 'String');
  46. }
  47. if (data.hasOwnProperty('activeUsers')) {
  48. obj['activeUsers'] = ApiClient.convertToType(data['activeUsers'], 'Number');
  49. }
  50. if (data.hasOwnProperty('totalUsers')) {
  51. obj['totalUsers'] = ApiClient.convertToType(data['totalUsers'], 'Number');
  52. }
  53. }
  54. return obj;
  55. }
  56. /**
  57. * Validates the JSON data with respect to <code>WorldStatus</code>.
  58. * @param {Object} data The plain JavaScript object bearing properties of interest.
  59. * @return {boolean} to indicate whether the JSON data is valid with respect to <code>WorldStatus</code>.
  60. */
  61. static validateJSON(data) {
  62. // ensure the json data is a string
  63. if (data['worldName'] && !(typeof data['worldName'] === 'string' || data['worldName'] instanceof String)) {
  64. throw new Error("Expected the field `worldName` to be a primitive type in the JSON string but got " + data['worldName']);
  65. }
  66. return true;
  67. }
  68. }
  69. /**
  70. * @member {String} worldName
  71. */
  72. WorldStatus.prototype['worldName'] = undefined;
  73. /**
  74. * @member {Number} activeUsers
  75. */
  76. WorldStatus.prototype['activeUsers'] = undefined;
  77. /**
  78. * @member {Number} totalUsers
  79. */
  80. WorldStatus.prototype['totalUsers'] = undefined;
  81. export default WorldStatus;