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

/**
 * Results of network security group evaluation.
 *
 */
class EvaluatedNetworkSecurityGroup {
  /**
   * Create a EvaluatedNetworkSecurityGroup.
   * @property {string} [networkSecurityGroupId] Network security group ID.
   * @property {string} [appliedTo] Resource ID of nic or subnet to which
   * network security group is applied.
   * @property {object} [matchedRule] Matched network security rule.
   * @property {string} [matchedRule.ruleName] Name of the matched network
   * security rule.
   * @property {string} [matchedRule.action] The network traffic is allowed or
   * denied. Possible values are 'Allow' and 'Deny'.
   * @property {array} [rulesEvaluationResult] List of network security rules
   * evaluation results.
   */
  constructor() {
  }

  /**
   * Defines the metadata of EvaluatedNetworkSecurityGroup
   *
   * @returns {object} metadata of EvaluatedNetworkSecurityGroup
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'EvaluatedNetworkSecurityGroup',
      type: {
        name: 'Composite',
        className: 'EvaluatedNetworkSecurityGroup',
        modelProperties: {
          networkSecurityGroupId: {
            required: false,
            serializedName: 'networkSecurityGroupId',
            type: {
              name: 'String'
            }
          },
          appliedTo: {
            required: false,
            serializedName: 'appliedTo',
            type: {
              name: 'String'
            }
          },
          matchedRule: {
            required: false,
            serializedName: 'matchedRule',
            type: {
              name: 'Composite',
              className: 'MatchedRule'
            }
          },
          rulesEvaluationResult: {
            required: false,
            readOnly: true,
            serializedName: 'rulesEvaluationResult',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'NetworkSecurityRulesEvaluationResultElementType',
                  type: {
                    name: 'Composite',
                    className: 'NetworkSecurityRulesEvaluationResult'
                  }
              }
            }
          }
        }
      }
    };
  }
}

module.exports = EvaluatedNetworkSecurityGroup;
