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

/**
 * Describes a service type defined in the service manifest of a provisioned
 * application type. The properties the ones defined in the service manifest.
 *
 */
class ServiceTypeDescription {
  /**
   * Create a ServiceTypeDescription.
   * @property {boolean} [isStateful] Indicates whether the service type is a
   * stateful service type or a stateless service type. This property is true
   * if the service type is a stateful service type, false otherwise.
   * @property {string} [serviceTypeName] Name of the service type as specified
   * in the service manifest.
   * @property {string} [placementConstraints] The placement constraint to be
   * used when instantiating this service in a Service Fabric cluster.
   * @property {array} [loadMetrics] The service load metrics is given as an
   * array of ServiceLoadMetricDescription objects.
   * @property {array} [servicePlacementPolicies] List of service placement
   * policy descriptions.
   * @property {array} [extensions] List of service type extensions.
   * @property {string} kind Polymorphic Discriminator
   */
  constructor() {
  }

  /**
   * Defines the metadata of ServiceTypeDescription
   *
   * @returns {object} metadata of ServiceTypeDescription
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'ServiceTypeDescription',
      type: {
        name: 'Composite',
        polymorphicDiscriminator: {
          serializedName: 'Kind',
          clientName: 'kind'
        },
        uberParent: 'ServiceTypeDescription',
        className: 'ServiceTypeDescription',
        modelProperties: {
          isStateful: {
            required: false,
            serializedName: 'IsStateful',
            type: {
              name: 'Boolean'
            }
          },
          serviceTypeName: {
            required: false,
            serializedName: 'ServiceTypeName',
            type: {
              name: 'String'
            }
          },
          placementConstraints: {
            required: false,
            serializedName: 'PlacementConstraints',
            type: {
              name: 'String'
            }
          },
          loadMetrics: {
            required: false,
            serializedName: 'LoadMetrics',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'ServiceLoadMetricDescriptionElementType',
                  type: {
                    name: 'Composite',
                    className: 'ServiceLoadMetricDescription'
                  }
              }
            }
          },
          servicePlacementPolicies: {
            required: false,
            serializedName: 'ServicePlacementPolicies',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'ServicePlacementPolicyDescriptionElementType',
                  type: {
                    name: 'Composite',
                    polymorphicDiscriminator: {
                      serializedName: 'Type',
                      clientName: 'type'
                    },
                    uberParent: 'ServicePlacementPolicyDescription',
                    className: 'ServicePlacementPolicyDescription'
                  }
              }
            }
          },
          extensions: {
            required: false,
            serializedName: 'Extensions',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'ServiceTypeExtensionDescriptionElementType',
                  type: {
                    name: 'Composite',
                    className: 'ServiceTypeExtensionDescription'
                  }
              }
            }
          },
          kind: {
            required: true,
            serializedName: 'Kind',
            isPolymorphicDiscriminator: true,
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = ServiceTypeDescription;
