/*
 * 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';

/**
 * Information about a Service Fabric service.
 *
 */
class ServiceInfo {
  /**
   * Create a ServiceInfo.
   * @property {string} [id] The identity of the service. This ID is an encoded
   * representation of the service name. This is used in the REST APIs to
   * identify the service resource.
   * Starting in version 6.0, hierarchical names are delimited with the "\~"
   * character. For example, if the service name is "fabric:/myapp/app1/svc1",
   * the service identity would be "myapp~app1\~svc1" in 6.0+ and
   * "myapp/app1/svc1" in previous versions.
   * @property {string} [name] The full name of the service with 'fabric:' URI
   * scheme.
   * @property {string} [typeName] Name of the service type as specified in the
   * service manifest.
   * @property {string} [manifestVersion] The version of the service manifest.
   * @property {string} [healthState] The health state of a Service Fabric
   * entity such as Cluster, Node, Application, Service, Partition, Replica
   * etc. Possible values include: 'Invalid', 'Ok', 'Warning', 'Error',
   * 'Unknown'
   * @property {string} [serviceStatus] The status of the application. Possible
   * values include: 'Unknown', 'Active', 'Upgrading', 'Deleting', 'Creating',
   * 'Failed'
   * @property {boolean} [isServiceGroup] Whether the service is in a service
   * group.
   * @property {string} serviceKind Polymorphic Discriminator
   */
  constructor() {
  }

  /**
   * Defines the metadata of ServiceInfo
   *
   * @returns {object} metadata of ServiceInfo
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'ServiceInfo',
      type: {
        name: 'Composite',
        polymorphicDiscriminator: {
          serializedName: 'ServiceKind',
          clientName: 'serviceKind'
        },
        uberParent: 'ServiceInfo',
        className: 'ServiceInfo',
        modelProperties: {
          id: {
            required: false,
            serializedName: 'Id',
            type: {
              name: 'String'
            }
          },
          name: {
            required: false,
            serializedName: 'Name',
            type: {
              name: 'String'
            }
          },
          typeName: {
            required: false,
            serializedName: 'TypeName',
            type: {
              name: 'String'
            }
          },
          manifestVersion: {
            required: false,
            serializedName: 'ManifestVersion',
            type: {
              name: 'String'
            }
          },
          healthState: {
            required: false,
            serializedName: 'HealthState',
            type: {
              name: 'String'
            }
          },
          serviceStatus: {
            required: false,
            serializedName: 'ServiceStatus',
            type: {
              name: 'String'
            }
          },
          isServiceGroup: {
            required: false,
            serializedName: 'IsServiceGroup',
            type: {
              name: 'Boolean'
            }
          },
          serviceKind: {
            required: true,
            serializedName: 'ServiceKind',
            isPolymorphicDiscriminator: true,
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = ServiceInfo;
