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

/**
 * Effective network security rules.
 *
 */
class EffectiveNetworkSecurityRule {
  /**
   * Create a EffectiveNetworkSecurityRule.
   * @property {string} [name] The name of the security rule specified by the
   * user (if created by the user).
   * @property {string} [protocol] The network protocol this rule applies to.
   * Possible values are: 'Tcp', 'Udp', and 'All'. Possible values include:
   * 'Tcp', 'Udp', 'All'
   * @property {string} [sourcePortRange] The source port or range.
   * @property {string} [destinationPortRange] The destination port or range.
   * @property {array} [sourcePortRanges] The source port ranges. Expected
   * values include a single integer between 0 and 65535, a range using '-' as
   * separator (e.g. 100-400), or an asterisk (*)
   * @property {array} [destinationPortRanges] The destination port ranges.
   * Expected values include a single integer between 0 and 65535, a range
   * using '-' as separator (e.g. 100-400), or an asterisk (*)
   * @property {string} [sourceAddressPrefix] The source address prefix.
   * @property {string} [destinationAddressPrefix] The destination address
   * prefix.
   * @property {array} [sourceAddressPrefixes] The source address prefixes.
   * Expected values include CIDR IP ranges, Default Tags (VirtualNetwork,
   * AzureLoadBalancer, Internet), System Tags, and the asterisk (*).
   * @property {array} [destinationAddressPrefixes] The destination address
   * prefixes. Expected values include CIDR IP ranges, Default Tags
   * (VirtualNetwork, AzureLoadBalancer, Internet), System Tags, and the
   * asterisk (*).
   * @property {array} [expandedSourceAddressPrefix] The expanded source
   * address prefix.
   * @property {array} [expandedDestinationAddressPrefix] Expanded destination
   * address prefix.
   * @property {string} [access] Whether network traffic is allowed or denied.
   * Possible values include: 'Allow', 'Deny'
   * @property {number} [priority] The priority of the rule.
   * @property {string} [direction] The direction of the rule. Possible values
   * include: 'Inbound', 'Outbound'
   */
  constructor() {
  }

  /**
   * Defines the metadata of EffectiveNetworkSecurityRule
   *
   * @returns {object} metadata of EffectiveNetworkSecurityRule
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'EffectiveNetworkSecurityRule',
      type: {
        name: 'Composite',
        className: 'EffectiveNetworkSecurityRule',
        modelProperties: {
          name: {
            required: false,
            serializedName: 'name',
            type: {
              name: 'String'
            }
          },
          protocol: {
            required: false,
            serializedName: 'protocol',
            type: {
              name: 'String'
            }
          },
          sourcePortRange: {
            required: false,
            serializedName: 'sourcePortRange',
            type: {
              name: 'String'
            }
          },
          destinationPortRange: {
            required: false,
            serializedName: 'destinationPortRange',
            type: {
              name: 'String'
            }
          },
          sourcePortRanges: {
            required: false,
            serializedName: 'sourcePortRanges',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'StringElementType',
                  type: {
                    name: 'String'
                  }
              }
            }
          },
          destinationPortRanges: {
            required: false,
            serializedName: 'destinationPortRanges',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'StringElementType',
                  type: {
                    name: 'String'
                  }
              }
            }
          },
          sourceAddressPrefix: {
            required: false,
            serializedName: 'sourceAddressPrefix',
            type: {
              name: 'String'
            }
          },
          destinationAddressPrefix: {
            required: false,
            serializedName: 'destinationAddressPrefix',
            type: {
              name: 'String'
            }
          },
          sourceAddressPrefixes: {
            required: false,
            serializedName: 'sourceAddressPrefixes',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'StringElementType',
                  type: {
                    name: 'String'
                  }
              }
            }
          },
          destinationAddressPrefixes: {
            required: false,
            serializedName: 'destinationAddressPrefixes',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'StringElementType',
                  type: {
                    name: 'String'
                  }
              }
            }
          },
          expandedSourceAddressPrefix: {
            required: false,
            serializedName: 'expandedSourceAddressPrefix',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'StringElementType',
                  type: {
                    name: 'String'
                  }
              }
            }
          },
          expandedDestinationAddressPrefix: {
            required: false,
            serializedName: 'expandedDestinationAddressPrefix',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'StringElementType',
                  type: {
                    name: 'String'
                  }
              }
            }
          },
          access: {
            required: false,
            serializedName: 'access',
            type: {
              name: 'String'
            }
          },
          priority: {
            required: false,
            serializedName: 'priority',
            type: {
              name: 'Number'
            }
          },
          direction: {
            required: false,
            serializedName: 'direction',
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = EffectiveNetworkSecurityRule;
