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

/**
 * The Role Assignment resource format.
 *
 * @extends models['ProxyResource']
 */
class RoleAssignmentResourceFormat extends models['ProxyResource'] {
  /**
   * Create a RoleAssignmentResourceFormat.
   * @member {string} [tenantId] The hub name.
   * @member {string} [assignmentName] The name of the metadata object.
   * @member {object} [displayName] Localized display names for the metadata.
   * @member {object} [description] Localized description for the metadata.
   * @member {string} [provisioningState] Provisioning state. Possible values
   * include: 'Provisioning', 'Succeeded', 'Expiring', 'Deleting',
   * 'HumanIntervention', 'Failed'
   * @member {string} role Type of roles. Possible values include: 'Admin',
   * 'Reader', 'ManageAdmin', 'ManageReader', 'DataAdmin', 'DataReader'
   * @member {array} principals The principals being assigned to.
   * @member {object} [profiles] Profiles set for the assignment.
   * @member {array} [profiles.elements] The elements included in the set.
   * @member {array} [profiles.exceptions] The elements that are not included
   * in the set, in case elements contains '*' indicating 'all'.
   * @member {object} [interactions] Interactions set for the assignment.
   * @member {array} [interactions.elements] The elements included in the set.
   * @member {array} [interactions.exceptions] The elements that are not
   * included in the set, in case elements contains '*' indicating 'all'.
   * @member {object} [links] Links set for the assignment.
   * @member {array} [links.elements] The elements included in the set.
   * @member {array} [links.exceptions] The elements that are not included in
   * the set, in case elements contains '*' indicating 'all'.
   * @member {object} [kpis] Kpis set for the assignment.
   * @member {array} [kpis.elements] The elements included in the set.
   * @member {array} [kpis.exceptions] The elements that are not included in
   * the set, in case elements contains '*' indicating 'all'.
   * @member {object} [sasPolicies] Sas Policies set for the assignment.
   * @member {array} [sasPolicies.elements] The elements included in the set.
   * @member {array} [sasPolicies.exceptions] The elements that are not
   * included in the set, in case elements contains '*' indicating 'all'.
   * @member {object} [connectors] Connectors set for the assignment.
   * @member {array} [connectors.elements] The elements included in the set.
   * @member {array} [connectors.exceptions] The elements that are not included
   * in the set, in case elements contains '*' indicating 'all'.
   * @member {object} [views] Views set for the assignment.
   * @member {array} [views.elements] The elements included in the set.
   * @member {array} [views.exceptions] The elements that are not included in
   * the set, in case elements contains '*' indicating 'all'.
   * @member {object} [relationshipLinks] The Role assignments set for the
   * relationship links.
   * @member {array} [relationshipLinks.elements] The elements included in the
   * set.
   * @member {array} [relationshipLinks.exceptions] The elements that are not
   * included in the set, in case elements contains '*' indicating 'all'.
   * @member {object} [relationships] The Role assignments set for the
   * relationships.
   * @member {array} [relationships.elements] The elements included in the set.
   * @member {array} [relationships.exceptions] The elements that are not
   * included in the set, in case elements contains '*' indicating 'all'.
   * @member {object} [widgetTypes] Widget types set for the assignment.
   * @member {array} [widgetTypes.elements] The elements included in the set.
   * @member {array} [widgetTypes.exceptions] The elements that are not
   * included in the set, in case elements contains '*' indicating 'all'.
   * @member {object} [roleAssignments] The Role assignments set for the
   * assignment.
   * @member {array} [roleAssignments.elements] The elements included in the
   * set.
   * @member {array} [roleAssignments.exceptions] The elements that are not
   * included in the set, in case elements contains '*' indicating 'all'.
   * @member {object} [conflationPolicies] Widget types set for the assignment.
   * @member {array} [conflationPolicies.elements] The elements included in the
   * set.
   * @member {array} [conflationPolicies.exceptions] The elements that are not
   * included in the set, in case elements contains '*' indicating 'all'.
   * @member {object} [segments] The Role assignments set for the assignment.
   * @member {array} [segments.elements] The elements included in the set.
   * @member {array} [segments.exceptions] The elements that are not included
   * in the set, in case elements contains '*' indicating 'all'.
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of RoleAssignmentResourceFormat
   *
   * @returns {object} metadata of RoleAssignmentResourceFormat
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'RoleAssignmentResourceFormat',
      type: {
        name: 'Composite',
        className: 'RoleAssignmentResourceFormat',
        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'
            }
          },
          tenantId: {
            required: false,
            readOnly: true,
            serializedName: 'properties.tenantId',
            type: {
              name: 'String'
            }
          },
          assignmentName: {
            required: false,
            readOnly: true,
            serializedName: 'properties.assignmentName',
            type: {
              name: 'String'
            }
          },
          displayName: {
            required: false,
            serializedName: 'properties.displayName',
            type: {
              name: 'Dictionary',
              value: {
                  required: false,
                  serializedName: 'StringElementType',
                  type: {
                    name: 'String'
                  }
              }
            }
          },
          description: {
            required: false,
            serializedName: 'properties.description',
            type: {
              name: 'Dictionary',
              value: {
                  required: false,
                  serializedName: 'StringElementType',
                  type: {
                    name: 'String'
                  }
              }
            }
          },
          provisioningState: {
            required: false,
            readOnly: true,
            serializedName: 'properties.provisioningState',
            type: {
              name: 'String'
            }
          },
          role: {
            required: true,
            serializedName: 'properties.role',
            type: {
              name: 'Enum',
              allowedValues: [ 'Admin', 'Reader', 'ManageAdmin', 'ManageReader', 'DataAdmin', 'DataReader' ]
            }
          },
          principals: {
            required: true,
            serializedName: 'properties.principals',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'AssignmentPrincipalElementType',
                  type: {
                    name: 'Composite',
                    className: 'AssignmentPrincipal'
                  }
              }
            }
          },
          profiles: {
            required: false,
            serializedName: 'properties.profiles',
            type: {
              name: 'Composite',
              className: 'ResourceSetDescription'
            }
          },
          interactions: {
            required: false,
            serializedName: 'properties.interactions',
            type: {
              name: 'Composite',
              className: 'ResourceSetDescription'
            }
          },
          links: {
            required: false,
            serializedName: 'properties.links',
            type: {
              name: 'Composite',
              className: 'ResourceSetDescription'
            }
          },
          kpis: {
            required: false,
            serializedName: 'properties.kpis',
            type: {
              name: 'Composite',
              className: 'ResourceSetDescription'
            }
          },
          sasPolicies: {
            required: false,
            serializedName: 'properties.sasPolicies',
            type: {
              name: 'Composite',
              className: 'ResourceSetDescription'
            }
          },
          connectors: {
            required: false,
            serializedName: 'properties.connectors',
            type: {
              name: 'Composite',
              className: 'ResourceSetDescription'
            }
          },
          views: {
            required: false,
            serializedName: 'properties.views',
            type: {
              name: 'Composite',
              className: 'ResourceSetDescription'
            }
          },
          relationshipLinks: {
            required: false,
            serializedName: 'properties.relationshipLinks',
            type: {
              name: 'Composite',
              className: 'ResourceSetDescription'
            }
          },
          relationships: {
            required: false,
            serializedName: 'properties.relationships',
            type: {
              name: 'Composite',
              className: 'ResourceSetDescription'
            }
          },
          widgetTypes: {
            required: false,
            serializedName: 'properties.widgetTypes',
            type: {
              name: 'Composite',
              className: 'ResourceSetDescription'
            }
          },
          roleAssignments: {
            required: false,
            serializedName: 'properties.roleAssignments',
            type: {
              name: 'Composite',
              className: 'ResourceSetDescription'
            }
          },
          conflationPolicies: {
            required: false,
            serializedName: 'properties.conflationPolicies',
            type: {
              name: 'Composite',
              className: 'ResourceSetDescription'
            }
          },
          segments: {
            required: false,
            serializedName: 'properties.segments',
            type: {
              name: 'Composite',
              className: 'ResourceSetDescription'
            }
          }
        }
      }
    };
  }
}

module.exports = RoleAssignmentResourceFormat;
