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

/**
 * Identity for the resource.
 *
 */
class ManagedServiceIdentity {
  /**
   * Create a ManagedServiceIdentity.
   * @property {string} [principalId] The principal id of the system assigned
   * identity. This property will only be provided for a system assigned
   * identity.
   * @property {string} [tenantId] The tenant id of the system assigned
   * identity. This property will only be provided for a system assigned
   * identity.
   * @property {string} [type] The type of identity used for the resource. The
   * type 'SystemAssigned, UserAssigned' includes both an implicitly created
   * identity and a set of user assigned identities. The type 'None' will
   * remove any identities from the virtual machine. Possible values include:
   * 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', 'None'
   * @property {object} [userAssignedIdentities] The list of user identities
   * associated with resource. The user identity dictionary key references will
   * be ARM resource ids in the form:
   * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.
   */
  constructor() {
  }

  /**
   * Defines the metadata of ManagedServiceIdentity
   *
   * @returns {object} metadata of ManagedServiceIdentity
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'ManagedServiceIdentity',
      type: {
        name: 'Composite',
        className: 'ManagedServiceIdentity',
        modelProperties: {
          principalId: {
            required: false,
            readOnly: true,
            serializedName: 'principalId',
            type: {
              name: 'String'
            }
          },
          tenantId: {
            required: false,
            readOnly: true,
            serializedName: 'tenantId',
            type: {
              name: 'String'
            }
          },
          type: {
            required: false,
            serializedName: 'type',
            type: {
              name: 'Enum',
              allowedValues: [ 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', 'None' ]
            }
          },
          userAssignedIdentities: {
            required: false,
            serializedName: 'userAssignedIdentities',
            type: {
              name: 'Dictionary',
              value: {
                  required: false,
                  serializedName: 'ManagedServiceIdentityUserAssignedIdentitiesValueElementType',
                  type: {
                    name: 'Composite',
                    className: 'ManagedServiceIdentityUserAssignedIdentitiesValue'
                  }
              }
            }
          }
        }
      }
    };
  }
}

module.exports = ManagedServiceIdentity;
