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

/**
 * A network interface in a resource group.
 *
 * @extends models['Resource']
 */
class NetworkInterface extends models['Resource'] {
  /**
   * Create a NetworkInterface.
   * @property {object} [virtualMachine] The reference of a virtual machine.
   * @property {string} [virtualMachine.id] Resource ID.
   * @property {object} [networkSecurityGroup] The reference of the
   * NetworkSecurityGroup resource.
   * @property {array} [networkSecurityGroup.securityRules] A collection of
   * security rules of the network security group.
   * @property {array} [networkSecurityGroup.defaultSecurityRules] The default
   * security rules of network security group.
   * @property {array} [networkSecurityGroup.networkInterfaces] A collection of
   * references to network interfaces.
   * @property {array} [networkSecurityGroup.subnets] A collection of
   * references to subnets.
   * @property {string} [networkSecurityGroup.resourceGuid] The resource GUID
   * property of the network security group resource.
   * @property {string} [networkSecurityGroup.provisioningState] The
   * provisioning state of the public IP resource. Possible values are:
   * 'Updating', 'Deleting', and 'Failed'.
   * @property {string} [networkSecurityGroup.etag] A unique read-only string
   * that changes whenever the resource is updated.
   * @property {object} [interfaceEndpoint] A reference to the interface
   * endpoint to which the network interface is linked.
   * @property {string} [interfaceEndpoint.fqdn] A first-party service's FQDN
   * that is mapped to the private IP allocated via this interface endpoint.
   * @property {object} [interfaceEndpoint.endpointService] A reference to the
   * service being brought into the virtual network.
   * @property {string} [interfaceEndpoint.endpointService.id] A unique
   * identifier of the service being referenced by the interface endpoint.
   * @property {object} [interfaceEndpoint.subnet] The ID of the subnet from
   * which the private IP will be allocated.
   * @property {string} [interfaceEndpoint.subnet.addressPrefix] The address
   * prefix for the subnet.
   * @property {array} [interfaceEndpoint.subnet.addressPrefixes] List of
   * address prefixes for the subnet.
   * @property {object} [interfaceEndpoint.subnet.networkSecurityGroup] The
   * reference of the NetworkSecurityGroup resource.
   * @property {array}
   * [interfaceEndpoint.subnet.networkSecurityGroup.securityRules] A collection
   * of security rules of the network security group.
   * @property {array}
   * [interfaceEndpoint.subnet.networkSecurityGroup.defaultSecurityRules] The
   * default security rules of network security group.
   * @property {array}
   * [interfaceEndpoint.subnet.networkSecurityGroup.networkInterfaces] A
   * collection of references to network interfaces.
   * @property {array} [interfaceEndpoint.subnet.networkSecurityGroup.subnets]
   * A collection of references to subnets.
   * @property {string}
   * [interfaceEndpoint.subnet.networkSecurityGroup.resourceGuid] The resource
   * GUID property of the network security group resource.
   * @property {string}
   * [interfaceEndpoint.subnet.networkSecurityGroup.provisioningState] The
   * provisioning state of the public IP resource. Possible values are:
   * 'Updating', 'Deleting', and 'Failed'.
   * @property {string} [interfaceEndpoint.subnet.networkSecurityGroup.etag] A
   * unique read-only string that changes whenever the resource is updated.
   * @property {object} [interfaceEndpoint.subnet.routeTable] The reference of
   * the RouteTable resource.
   * @property {array} [interfaceEndpoint.subnet.routeTable.routes] Collection
   * of routes contained within a route table.
   * @property {array} [interfaceEndpoint.subnet.routeTable.subnets] A
   * collection of references to subnets.
   * @property {boolean}
   * [interfaceEndpoint.subnet.routeTable.disableBgpRoutePropagation] Gets or
   * sets whether to disable the routes learned by BGP on that route table.
   * True means disable.
   * @property {string} [interfaceEndpoint.subnet.routeTable.provisioningState]
   * The provisioning state of the resource. Possible values are: 'Updating',
   * 'Deleting', and 'Failed'.
   * @property {string} [interfaceEndpoint.subnet.routeTable.etag] Gets a
   * unique read-only string that changes whenever the resource is updated.
   * @property {object} [interfaceEndpoint.subnet.natGateway] Nat gateway
   * associated with this subnet.
   * @property {string} [interfaceEndpoint.subnet.natGateway.id] Resource ID.
   * @property {array} [interfaceEndpoint.subnet.serviceEndpoints] An array of
   * service endpoints.
   * @property {array} [interfaceEndpoint.subnet.serviceEndpointPolicies] An
   * array of service endpoint policies.
   * @property {array} [interfaceEndpoint.subnet.interfaceEndpoints] An array
   * of references to interface endpoints
   * @property {array} [interfaceEndpoint.subnet.ipConfigurations] Gets an
   * array of references to the network interface IP configurations using
   * subnet.
   * @property {array} [interfaceEndpoint.subnet.ipConfigurationProfiles] Array
   * of IP configuration profiles which reference this subnet.
   * @property {array} [interfaceEndpoint.subnet.resourceNavigationLinks] Gets
   * an array of references to the external resources using subnet.
   * @property {array} [interfaceEndpoint.subnet.serviceAssociationLinks] Gets
   * an array of references to services injecting into this subnet.
   * @property {array} [interfaceEndpoint.subnet.delegations] Gets an array of
   * references to the delegations on the subnet.
   * @property {string} [interfaceEndpoint.subnet.purpose] A read-only string
   * identifying the intention of use for this subnet based on delegations and
   * other user-defined properties.
   * @property {string} [interfaceEndpoint.subnet.provisioningState] The
   * provisioning state of the resource.
   * @property {string} [interfaceEndpoint.subnet.name] The name of the
   * resource that is unique within a resource group. This name can be used to
   * access the resource.
   * @property {string} [interfaceEndpoint.subnet.etag] A unique read-only
   * string that changes whenever the resource is updated.
   * @property {array} [interfaceEndpoint.networkInterfaces] Gets an array of
   * references to the network interfaces created for this interface endpoint.
   * @property {string} [interfaceEndpoint.owner] A read-only property that
   * identifies who created this interface endpoint.
   * @property {string} [interfaceEndpoint.provisioningState] The provisioning
   * state of the interface endpoint. Possible values are: 'Updating',
   * 'Deleting', and 'Failed'.
   * @property {string} [interfaceEndpoint.etag] Gets a unique read-only string
   * that changes whenever the resource is updated.
   * @property {array} [ipConfigurations] A list of IPConfigurations of the
   * network interface.
   * @property {array} [tapConfigurations] A list of TapConfigurations of the
   * network interface.
   * @property {object} [dnsSettings] The DNS settings in network interface.
   * @property {array} [dnsSettings.dnsServers] List of DNS servers IP
   * addresses. Use 'AzureProvidedDNS' to switch to azure provided DNS
   * resolution. 'AzureProvidedDNS' value cannot be combined with other IPs, it
   * must be the only value in dnsServers collection.
   * @property {array} [dnsSettings.appliedDnsServers] If the VM that uses this
   * NIC is part of an Availability Set, then this list will have the union of
   * all DNS servers from all NICs that are part of the Availability Set. This
   * property is what is configured on each of those VMs.
   * @property {string} [dnsSettings.internalDnsNameLabel] Relative DNS name
   * for this NIC used for internal communications between VMs in the same
   * virtual network.
   * @property {string} [dnsSettings.internalFqdn] Fully qualified DNS name
   * supporting internal communications between VMs in the same virtual
   * network.
   * @property {string} [dnsSettings.internalDomainNameSuffix] Even if
   * internalDnsNameLabel is not specified, a DNS entry is created for the
   * primary NIC of the VM. This DNS name can be constructed by concatenating
   * the VM name with the value of internalDomainNameSuffix.
   * @property {string} [macAddress] The MAC address of the network interface.
   * @property {boolean} [primary] Gets whether this is a primary network
   * interface on a virtual machine.
   * @property {boolean} [enableAcceleratedNetworking] If the network interface
   * is accelerated networking enabled.
   * @property {boolean} [enableIPForwarding] Indicates whether IP forwarding
   * is enabled on this network interface.
   * @property {array} [hostedWorkloads] A list of references to linked
   * BareMetal resources
   * @property {string} [resourceGuid] The resource GUID property of the
   * network interface resource.
   * @property {string} [provisioningState] The provisioning state of the
   * public IP resource. Possible values are: 'Updating', 'Deleting', and
   * 'Failed'.
   * @property {string} [etag] A unique read-only string that changes whenever
   * the resource is updated.
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of NetworkInterface
   *
   * @returns {object} metadata of NetworkInterface
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'NetworkInterface',
      type: {
        name: 'Composite',
        className: 'NetworkInterface',
        modelProperties: {
          id: {
            required: false,
            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'
            }
          },
          location: {
            required: false,
            serializedName: 'location',
            type: {
              name: 'String'
            }
          },
          tags: {
            required: false,
            serializedName: 'tags',
            type: {
              name: 'Dictionary',
              value: {
                  required: false,
                  serializedName: 'StringElementType',
                  type: {
                    name: 'String'
                  }
              }
            }
          },
          virtualMachine: {
            required: false,
            readOnly: true,
            serializedName: 'properties.virtualMachine',
            type: {
              name: 'Composite',
              className: 'SubResource'
            }
          },
          networkSecurityGroup: {
            required: false,
            serializedName: 'properties.networkSecurityGroup',
            type: {
              name: 'Composite',
              className: 'NetworkSecurityGroup'
            }
          },
          interfaceEndpoint: {
            required: false,
            readOnly: true,
            serializedName: 'properties.interfaceEndpoint',
            type: {
              name: 'Composite',
              className: 'InterfaceEndpoint'
            }
          },
          ipConfigurations: {
            required: false,
            serializedName: 'properties.ipConfigurations',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'NetworkInterfaceIPConfigurationElementType',
                  type: {
                    name: 'Composite',
                    className: 'NetworkInterfaceIPConfiguration'
                  }
              }
            }
          },
          tapConfigurations: {
            required: false,
            serializedName: 'properties.tapConfigurations',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'NetworkInterfaceTapConfigurationElementType',
                  type: {
                    name: 'Composite',
                    className: 'NetworkInterfaceTapConfiguration'
                  }
              }
            }
          },
          dnsSettings: {
            required: false,
            serializedName: 'properties.dnsSettings',
            type: {
              name: 'Composite',
              className: 'NetworkInterfaceDnsSettings'
            }
          },
          macAddress: {
            required: false,
            serializedName: 'properties.macAddress',
            type: {
              name: 'String'
            }
          },
          primary: {
            required: false,
            serializedName: 'properties.primary',
            type: {
              name: 'Boolean'
            }
          },
          enableAcceleratedNetworking: {
            required: false,
            serializedName: 'properties.enableAcceleratedNetworking',
            type: {
              name: 'Boolean'
            }
          },
          enableIPForwarding: {
            required: false,
            serializedName: 'properties.enableIPForwarding',
            type: {
              name: 'Boolean'
            }
          },
          hostedWorkloads: {
            required: false,
            readOnly: true,
            serializedName: 'properties.hostedWorkloads',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'StringElementType',
                  type: {
                    name: 'String'
                  }
              }
            }
          },
          resourceGuid: {
            required: false,
            serializedName: 'properties.resourceGuid',
            type: {
              name: 'String'
            }
          },
          provisioningState: {
            required: false,
            serializedName: 'properties.provisioningState',
            type: {
              name: 'String'
            }
          },
          etag: {
            required: false,
            serializedName: 'etag',
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = NetworkInterface;
