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

/**
 * LoadBalancer resource
 *
 * @extends models['Resource']
 */
class LoadBalancer extends models['Resource'] {
  /**
   * Create a LoadBalancer.
   * @property {object} [sku] The load balancer SKU.
   * @property {string} [sku.name] Name of a load balancer SKU. Possible values
   * include: 'Basic', 'Standard'
   * @property {array} [frontendIPConfigurations] Object representing the
   * frontend IPs to be used for the load balancer
   * @property {array} [backendAddressPools] Collection of backend address
   * pools used by a load balancer
   * @property {array} [loadBalancingRules] Object collection representing the
   * load balancing rules Gets the provisioning
   * @property {array} [probes] Collection of probe objects used in the load
   * balancer
   * @property {array} [inboundNatRules] Collection of inbound NAT Rules used
   * by a load balancer. Defining inbound NAT rules on your load balancer is
   * mutually exclusive with defining an inbound NAT pool. Inbound NAT pools
   * are referenced from virtual machine scale sets. NICs that are associated
   * with individual virtual machines cannot reference an Inbound NAT pool.
   * They have to reference individual inbound NAT rules.
   * @property {array} [inboundNatPools] Defines an external port range for
   * inbound NAT to a single backend port on NICs associated with a load
   * balancer. Inbound NAT rules are created automatically for each NIC
   * associated with the Load Balancer using an external port from this range.
   * Defining an Inbound NAT pool on your Load Balancer is mutually exclusive
   * with defining inbound Nat rules. Inbound NAT pools are referenced from
   * virtual machine scale sets. NICs that are associated with individual
   * virtual machines cannot reference an inbound NAT pool. They have to
   * reference individual inbound NAT rules.
   * @property {array} [outboundRules] The outbound rules.
   * @property {string} [resourceGuid] The resource GUID property of the load
   * balancer resource.
   * @property {string} [provisioningState] Gets the provisioning state of the
   * PublicIP 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 LoadBalancer
   *
   * @returns {object} metadata of LoadBalancer
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'LoadBalancer',
      type: {
        name: 'Composite',
        className: 'LoadBalancer',
        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'
                  }
              }
            }
          },
          sku: {
            required: false,
            serializedName: 'sku',
            type: {
              name: 'Composite',
              className: 'LoadBalancerSku'
            }
          },
          frontendIPConfigurations: {
            required: false,
            serializedName: 'properties.frontendIPConfigurations',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'FrontendIPConfigurationElementType',
                  type: {
                    name: 'Composite',
                    className: 'FrontendIPConfiguration'
                  }
              }
            }
          },
          backendAddressPools: {
            required: false,
            serializedName: 'properties.backendAddressPools',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'BackendAddressPoolElementType',
                  type: {
                    name: 'Composite',
                    className: 'BackendAddressPool'
                  }
              }
            }
          },
          loadBalancingRules: {
            required: false,
            serializedName: 'properties.loadBalancingRules',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'LoadBalancingRuleElementType',
                  type: {
                    name: 'Composite',
                    className: 'LoadBalancingRule'
                  }
              }
            }
          },
          probes: {
            required: false,
            serializedName: 'properties.probes',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'ProbeElementType',
                  type: {
                    name: 'Composite',
                    className: 'Probe'
                  }
              }
            }
          },
          inboundNatRules: {
            required: false,
            serializedName: 'properties.inboundNatRules',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'InboundNatRuleElementType',
                  type: {
                    name: 'Composite',
                    className: 'InboundNatRule'
                  }
              }
            }
          },
          inboundNatPools: {
            required: false,
            serializedName: 'properties.inboundNatPools',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'InboundNatPoolElementType',
                  type: {
                    name: 'Composite',
                    className: 'InboundNatPool'
                  }
              }
            }
          },
          outboundRules: {
            required: false,
            serializedName: 'properties.outboundRules',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'OutboundRuleElementType',
                  type: {
                    name: 'Composite',
                    className: 'OutboundRule'
                  }
              }
            }
          },
          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 = LoadBalancer;
