/*
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Licensed under the MIT License. See License.txt in the project root for
 * license information.
 *
 * Code generated by Microsoft (R) AutoRest Code Generator.
 * Changes may cause incorrect behavior and will be lost if the code is
 * regenerated.
 */

'use strict';

const models = require('./index');

/**
 * Data model for an arm gateway resource.
 *
 * @extends models['Resource']
 */
class GatewayResource extends models['Resource'] {
  /**
   * Create a GatewayResource.
   * @member {date} [created] UTC date and time when gateway was first added to
   * management service.
   * @member {date} [updated] UTC date and time when node was last updated.
   * @member {string} [upgradeMode] The upgradeMode property gives the
   * flexibility to gateway to auto upgrade itself. If properties value not
   * specified, then we assume upgradeMode = Automatic. Possible values
   * include: 'Manual', 'Automatic'
   * @member {string} [desiredVersion] Latest available MSI version.
   * @member {array} [instances] Names of the nodes in the gateway.
   * @member {number} [activeMessageCount] Number of active messages.
   * @member {string} [latestPublishedMsiVersion] Last published MSI version.
   * @member {date} [publishedTimeUtc] The date/time of the last published
   * gateway.
   * @member {string} [installerDownload] Installer download uri.
   * @member {string} [minimumVersion] Minimum gateway version.
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of GatewayResource
   *
   * @returns {object} metadata of GatewayResource
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'GatewayResource',
      type: {
        name: 'Composite',
        className: 'GatewayResource',
        modelProperties: {
          id: {
            required: false,
            readOnly: true,
            serializedName: 'id',
            type: {
              name: 'String'
            }
          },
          type: {
            required: false,
            readOnly: true,
            serializedName: 'type',
            type: {
              name: 'String'
            }
          },
          name: {
            required: false,
            readOnly: true,
            serializedName: 'name',
            type: {
              name: 'String'
            }
          },
          location: {
            required: false,
            readOnly: true,
            serializedName: 'location',
            type: {
              name: 'String'
            }
          },
          tags: {
            required: false,
            serializedName: 'tags',
            type: {
              name: 'Dictionary',
              value: {
                  required: false,
                  serializedName: 'StringElementType',
                  type: {
                    name: 'String'
                  }
              }
            }
          },
          etag: {
            required: false,
            serializedName: 'etag',
            type: {
              name: 'String'
            }
          },
          created: {
            required: false,
            serializedName: 'properties.created',
            type: {
              name: 'DateTime'
            }
          },
          updated: {
            required: false,
            serializedName: 'properties.updated',
            type: {
              name: 'DateTime'
            }
          },
          upgradeMode: {
            required: false,
            serializedName: 'properties.upgradeMode',
            type: {
              name: 'Enum',
              allowedValues: [ 'Manual', 'Automatic' ]
            }
          },
          desiredVersion: {
            required: false,
            serializedName: 'properties.desiredVersion',
            type: {
              name: 'String'
            }
          },
          instances: {
            required: false,
            serializedName: 'properties.instances',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'GatewayStatusElementType',
                  type: {
                    name: 'Composite',
                    className: 'GatewayStatus'
                  }
              }
            }
          },
          activeMessageCount: {
            required: false,
            serializedName: 'properties.activeMessageCount',
            type: {
              name: 'Number'
            }
          },
          latestPublishedMsiVersion: {
            required: false,
            serializedName: 'properties.latestPublishedMsiVersion',
            type: {
              name: 'String'
            }
          },
          publishedTimeUtc: {
            required: false,
            serializedName: 'properties.publishedTimeUtc',
            type: {
              name: 'DateTime'
            }
          },
          installerDownload: {
            required: false,
            readOnly: true,
            serializedName: 'properties.installerDownload',
            type: {
              name: 'String'
            }
          },
          minimumVersion: {
            required: false,
            readOnly: true,
            serializedName: 'properties.minimumVersion',
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = GatewayResource;
