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

/**
 * VpnConnection Resource.
 *
 * @extends models['SubResource']
 */
class VpnConnection extends models['SubResource'] {
  /**
   * Create a VpnConnection.
   * @property {object} [remoteVpnSite] Id of the connected vpn site.
   * @property {string} [remoteVpnSite.id] Resource ID.
   * @property {number} [routingWeight] Routing weight for vpn connection.
   * @property {string} [connectionStatus] The connection status. Possible
   * values include: 'Unknown', 'Connecting', 'Connected', 'NotConnected'
   * @property {string} [vpnConnectionProtocolType] Connection protocol used
   * for this connection. Possible values include: 'IKEv2', 'IKEv1'
   * @property {number} [ingressBytesTransferred] Ingress bytes transferred.
   * @property {number} [egressBytesTransferred] Egress bytes transferred.
   * @property {number} [connectionBandwidth] Expected bandwidth in MBPS.
   * @property {string} [sharedKey] SharedKey for the vpn connection.
   * @property {boolean} [enableBgp] EnableBgp flag
   * @property {array} [ipsecPolicies] The IPSec Policies to be considered by
   * this connection.
   * @property {boolean} [enableRateLimiting] EnableBgp flag
   * @property {boolean} [enableInternetSecurity] Enable internet security
   * @property {boolean} [useLocalAzureIpAddress] Use local azure ip to
   * initiate connection
   * @property {string} [provisioningState] The provisioning state of the
   * resource. Possible values include: 'Succeeded', 'Updating', 'Deleting',
   * 'Failed'
   * @property {string} [name] The name of the resource that is unique within a
   * resource group. This name can be used to access the resource.
   * @property {string} [etag] Gets a unique read-only string that changes
   * whenever the resource is updated.
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of VpnConnection
   *
   * @returns {object} metadata of VpnConnection
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'VpnConnection',
      type: {
        name: 'Composite',
        className: 'VpnConnection',
        modelProperties: {
          id: {
            required: false,
            serializedName: 'id',
            type: {
              name: 'String'
            }
          },
          remoteVpnSite: {
            required: false,
            serializedName: 'properties.remoteVpnSite',
            type: {
              name: 'Composite',
              className: 'SubResource'
            }
          },
          routingWeight: {
            required: false,
            serializedName: 'properties.routingWeight',
            type: {
              name: 'Number'
            }
          },
          connectionStatus: {
            required: false,
            serializedName: 'properties.connectionStatus',
            type: {
              name: 'String'
            }
          },
          vpnConnectionProtocolType: {
            required: false,
            serializedName: 'properties.vpnConnectionProtocolType',
            type: {
              name: 'String'
            }
          },
          ingressBytesTransferred: {
            required: false,
            readOnly: true,
            serializedName: 'properties.ingressBytesTransferred',
            type: {
              name: 'Number'
            }
          },
          egressBytesTransferred: {
            required: false,
            readOnly: true,
            serializedName: 'properties.egressBytesTransferred',
            type: {
              name: 'Number'
            }
          },
          connectionBandwidth: {
            required: false,
            serializedName: 'properties.connectionBandwidth',
            type: {
              name: 'Number'
            }
          },
          sharedKey: {
            required: false,
            serializedName: 'properties.sharedKey',
            type: {
              name: 'String'
            }
          },
          enableBgp: {
            required: false,
            serializedName: 'properties.enableBgp',
            type: {
              name: 'Boolean'
            }
          },
          ipsecPolicies: {
            required: false,
            serializedName: 'properties.ipsecPolicies',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'IpsecPolicyElementType',
                  type: {
                    name: 'Composite',
                    className: 'IpsecPolicy'
                  }
              }
            }
          },
          enableRateLimiting: {
            required: false,
            serializedName: 'properties.enableRateLimiting',
            type: {
              name: 'Boolean'
            }
          },
          enableInternetSecurity: {
            required: false,
            serializedName: 'properties.enableInternetSecurity',
            type: {
              name: 'Boolean'
            }
          },
          useLocalAzureIpAddress: {
            required: false,
            serializedName: 'properties.useLocalAzureIpAddress',
            type: {
              name: 'Boolean'
            }
          },
          provisioningState: {
            required: false,
            serializedName: 'properties.provisioningState',
            type: {
              name: 'String'
            }
          },
          name: {
            required: false,
            serializedName: 'name',
            type: {
              name: 'String'
            }
          },
          etag: {
            required: false,
            readOnly: true,
            serializedName: 'etag',
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = VpnConnection;
