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

/**
 * Contract details.
 *
 * @extends models['Resource']
 */
class GroupContract extends models['Resource'] {
  /**
   * Create a GroupContract.
   * @property {string} displayName Group name.
   * @property {string} [description] Group description. Can contain HTML
   * formatting tags.
   * @property {boolean} [builtIn] true if the group is one of the three system
   * groups (Administrators, Developers, or Guests); otherwise false.
   * @property {string} [groupContractType] Group type. Possible values
   * include: 'custom', 'system', 'external'
   * @property {string} [externalId] For external groups, this property
   * contains the id of the group from the external identity provider, e.g. for
   * Azure Active Directory `aad://<tenant>.onmicrosoft.com/groups/<group
   * object id>`; otherwise the value is null.
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of GroupContract
   *
   * @returns {object} metadata of GroupContract
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'GroupContract',
      type: {
        name: 'Composite',
        className: 'GroupContract',
        modelProperties: {
          id: {
            required: false,
            readOnly: true,
            serializedName: 'id',
            type: {
              name: 'String'
            }
          },
          name: {
            required: false,
            readOnly: true,
            serializedName: 'name',
            type: {
              name: 'String'
            }
          },
          type: {
            required: false,
            readOnly: true,
            serializedName: 'type',
            type: {
              name: 'String'
            }
          },
          displayName: {
            required: true,
            serializedName: 'properties.displayName',
            constraints: {
              MaxLength: 300,
              MinLength: 1
            },
            type: {
              name: 'String'
            }
          },
          description: {
            required: false,
            serializedName: 'properties.description',
            constraints: {
              MaxLength: 1000
            },
            type: {
              name: 'String'
            }
          },
          builtIn: {
            required: false,
            readOnly: true,
            serializedName: 'properties.builtIn',
            type: {
              name: 'Boolean'
            }
          },
          groupContractType: {
            required: false,
            serializedName: 'properties.type',
            type: {
              name: 'Enum',
              allowedValues: [ 'custom', 'system', 'external' ]
            }
          },
          externalId: {
            required: false,
            serializedName: 'properties.externalId',
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = GroupContract;
