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

/**
 * Peering in an ExpressRoute Cross Connection resource.
 *
 * @extends models['SubResource']
 */
class ExpressRouteCrossConnectionPeering extends models['SubResource'] {
  /**
   * Create a ExpressRouteCrossConnectionPeering.
   * @property {string} [peeringType] The peering type. Possible values
   * include: 'AzurePublicPeering', 'AzurePrivatePeering', 'MicrosoftPeering'
   * @property {string} [state] The peering state. Possible values include:
   * 'Disabled', 'Enabled'
   * @property {number} [azureASN] The Azure ASN.
   * @property {number} [peerASN] The peer ASN.
   * @property {string} [primaryPeerAddressPrefix] The primary address prefix.
   * @property {string} [secondaryPeerAddressPrefix] The secondary address
   * prefix.
   * @property {string} [primaryAzurePort] The primary port.
   * @property {string} [secondaryAzurePort] The secondary port.
   * @property {string} [sharedKey] The shared key.
   * @property {number} [vlanId] The VLAN ID.
   * @property {object} [microsoftPeeringConfig] The Microsoft peering
   * configuration.
   * @property {array} [microsoftPeeringConfig.advertisedPublicPrefixes] The
   * reference of AdvertisedPublicPrefixes.
   * @property {array} [microsoftPeeringConfig.advertisedCommunities] The
   * communities of bgp peering. Specified for microsoft peering
   * @property {string} [microsoftPeeringConfig.advertisedPublicPrefixesState]
   * AdvertisedPublicPrefixState of the Peering resource. Possible values are
   * 'NotConfigured', 'Configuring', 'Configured', and 'ValidationNeeded'.
   * Possible values include: 'NotConfigured', 'Configuring', 'Configured',
   * 'ValidationNeeded'
   * @property {number} [microsoftPeeringConfig.legacyMode] The legacy mode of
   * the peering.
   * @property {number} [microsoftPeeringConfig.customerASN] The CustomerASN of
   * the peering.
   * @property {string} [microsoftPeeringConfig.routingRegistryName] The
   * RoutingRegistryName of the configuration.
   * @property {string} [provisioningState] Gets the provisioning state of the
   * public IP resource. Possible values are: 'Updating', 'Deleting', and
   * 'Failed'.
   * @property {string} [gatewayManagerEtag] The GatewayManager Etag.
   * @property {string} [lastModifiedBy] Gets whether the provider or the
   * customer last modified the peering.
   * @property {object} [ipv6PeeringConfig] The IPv6 peering configuration.
   * @property {string} [ipv6PeeringConfig.primaryPeerAddressPrefix] The
   * primary address prefix.
   * @property {string} [ipv6PeeringConfig.secondaryPeerAddressPrefix] The
   * secondary address prefix.
   * @property {object} [ipv6PeeringConfig.microsoftPeeringConfig] The
   * Microsoft peering configuration.
   * @property {array}
   * [ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixes] The
   * reference of AdvertisedPublicPrefixes.
   * @property {array}
   * [ipv6PeeringConfig.microsoftPeeringConfig.advertisedCommunities] The
   * communities of bgp peering. Specified for microsoft peering
   * @property {string}
   * [ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixesState]
   * AdvertisedPublicPrefixState of the Peering resource. Possible values are
   * 'NotConfigured', 'Configuring', 'Configured', and 'ValidationNeeded'.
   * Possible values include: 'NotConfigured', 'Configuring', 'Configured',
   * 'ValidationNeeded'
   * @property {number} [ipv6PeeringConfig.microsoftPeeringConfig.legacyMode]
   * The legacy mode of the peering.
   * @property {number} [ipv6PeeringConfig.microsoftPeeringConfig.customerASN]
   * The CustomerASN of the peering.
   * @property {string}
   * [ipv6PeeringConfig.microsoftPeeringConfig.routingRegistryName] The
   * RoutingRegistryName of the configuration.
   * @property {object} [ipv6PeeringConfig.routeFilter] The reference of the
   * RouteFilter resource.
   * @property {array} [ipv6PeeringConfig.routeFilter.rules] Collection of
   * RouteFilterRules contained within a route filter.
   * @property {array} [ipv6PeeringConfig.routeFilter.peerings] A collection of
   * references to express route circuit peerings.
   * @property {string} [ipv6PeeringConfig.routeFilter.provisioningState] The
   * provisioning state of the resource. Possible values are: 'Updating',
   * 'Deleting', 'Succeeded' and 'Failed'.
   * @property {string} [ipv6PeeringConfig.routeFilter.etag] Gets a unique
   * read-only string that changes whenever the resource is updated.
   * @property {string} [ipv6PeeringConfig.state] The state of peering.
   * Possible values are: 'Disabled' and 'Enabled'. Possible values include:
   * 'Disabled', 'Enabled'
   * @property {string} [name] Gets name of the resource that is unique within
   * a resource group. This name can be used to access the resource.
   * @property {string} [etag] A unique read-only string that changes whenever
   * the resource is updated.
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of ExpressRouteCrossConnectionPeering
   *
   * @returns {object} metadata of ExpressRouteCrossConnectionPeering
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'ExpressRouteCrossConnectionPeering',
      type: {
        name: 'Composite',
        className: 'ExpressRouteCrossConnectionPeering',
        modelProperties: {
          id: {
            required: false,
            serializedName: 'id',
            type: {
              name: 'String'
            }
          },
          peeringType: {
            required: false,
            serializedName: 'properties.peeringType',
            type: {
              name: 'String'
            }
          },
          state: {
            required: false,
            serializedName: 'properties.state',
            type: {
              name: 'String'
            }
          },
          azureASN: {
            required: false,
            readOnly: true,
            serializedName: 'properties.azureASN',
            type: {
              name: 'Number'
            }
          },
          peerASN: {
            required: false,
            serializedName: 'properties.peerASN',
            constraints: {
              InclusiveMaximum: 4294967295,
              InclusiveMinimum: 1
            },
            type: {
              name: 'Number'
            }
          },
          primaryPeerAddressPrefix: {
            required: false,
            serializedName: 'properties.primaryPeerAddressPrefix',
            type: {
              name: 'String'
            }
          },
          secondaryPeerAddressPrefix: {
            required: false,
            serializedName: 'properties.secondaryPeerAddressPrefix',
            type: {
              name: 'String'
            }
          },
          primaryAzurePort: {
            required: false,
            readOnly: true,
            serializedName: 'properties.primaryAzurePort',
            type: {
              name: 'String'
            }
          },
          secondaryAzurePort: {
            required: false,
            readOnly: true,
            serializedName: 'properties.secondaryAzurePort',
            type: {
              name: 'String'
            }
          },
          sharedKey: {
            required: false,
            serializedName: 'properties.sharedKey',
            type: {
              name: 'String'
            }
          },
          vlanId: {
            required: false,
            serializedName: 'properties.vlanId',
            type: {
              name: 'Number'
            }
          },
          microsoftPeeringConfig: {
            required: false,
            serializedName: 'properties.microsoftPeeringConfig',
            type: {
              name: 'Composite',
              className: 'ExpressRouteCircuitPeeringConfig'
            }
          },
          provisioningState: {
            required: false,
            readOnly: true,
            serializedName: 'properties.provisioningState',
            type: {
              name: 'String'
            }
          },
          gatewayManagerEtag: {
            required: false,
            serializedName: 'properties.gatewayManagerEtag',
            type: {
              name: 'String'
            }
          },
          lastModifiedBy: {
            required: false,
            serializedName: 'properties.lastModifiedBy',
            type: {
              name: 'String'
            }
          },
          ipv6PeeringConfig: {
            required: false,
            serializedName: 'properties.ipv6PeeringConfig',
            type: {
              name: 'Composite',
              className: 'Ipv6ExpressRouteCircuitPeeringConfig'
            }
          },
          name: {
            required: false,
            serializedName: 'name',
            type: {
              name: 'String'
            }
          },
          etag: {
            required: false,
            readOnly: true,
            serializedName: 'etag',
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = ExpressRouteCrossConnectionPeering;
