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

/**
 * Managed cluster.
 *
 * @extends models['Resource']
 */
class ManagedCluster extends models['Resource'] {
  /**
   * Create a ManagedCluster.
   * @property {string} [provisioningState] The current deployment or
   * provisioning state, which only appears in the response.
   * @property {string} [kubernetesVersion] Version of Kubernetes specified
   * when creating the managed cluster.
   * @property {string} [dnsPrefix] DNS prefix specified when creating the
   * managed cluster.
   * @property {string} [fqdn] FQDN for the master pool.
   * @property {array} [agentPoolProfiles] Properties of the agent pool.
   * @property {object} [linuxProfile] Profile for Linux VMs in the container
   * service cluster.
   * @property {string} [linuxProfile.adminUsername] The administrator username
   * to use for Linux VMs.
   * @property {object} [linuxProfile.ssh] SSH configuration for Linux-based
   * VMs running on Azure.
   * @property {array} [linuxProfile.ssh.publicKeys] The list of SSH public
   * keys used to authenticate with Linux-based VMs. Only expect one key
   * specified.
   * @property {object} [servicePrincipalProfile] Information about a service
   * principal identity for the cluster to use for manipulating Azure APIs.
   * @property {string} [servicePrincipalProfile.clientId] The ID for the
   * service principal.
   * @property {string} [servicePrincipalProfile.secret] The secret password
   * associated with the service principal in plain text.
   * @property {object} [addonProfiles] Profile of managed cluster add-on.
   * @property {string} [nodeResourceGroup] Name of the resource group
   * containing agent pool nodes.
   * @property {boolean} [enableRBAC] Whether to enable Kubernetes Role-Based
   * Access Control.
   * @property {boolean} [enablePodSecurityPolicy] (PREVIEW) Whether to enable
   * Kubernetes Pod security policy.
   * @property {object} [networkProfile] Profile of network configuration.
   * @property {string} [networkProfile.networkPlugin] Network plugin used for
   * building Kubernetes network. Possible values include: 'azure', 'kubenet'
   * @property {string} [networkProfile.networkPolicy] Network policy used for
   * building Kubernetes network. Possible values include: 'calico', 'azure'
   * @property {string} [networkProfile.podCidr] A CIDR notation IP range from
   * which to assign pod IPs when kubenet is used.
   * @property {string} [networkProfile.serviceCidr] A CIDR notation IP range
   * from which to assign service cluster IPs. It must not overlap with any
   * Subnet IP ranges.
   * @property {string} [networkProfile.dnsServiceIP] An IP address assigned to
   * the Kubernetes DNS service. It must be within the Kubernetes service
   * address range specified in serviceCidr.
   * @property {string} [networkProfile.dockerBridgeCidr] A CIDR notation IP
   * range assigned to the Docker bridge network. It must not overlap with any
   * Subnet IP ranges or the Kubernetes service address range.
   * @property {object} [aadProfile] Profile of Azure Active Directory
   * configuration.
   * @property {string} [aadProfile.clientAppID] The client AAD application ID.
   * @property {string} [aadProfile.serverAppID] The server AAD application ID.
   * @property {string} [aadProfile.serverAppSecret] The server AAD application
   * secret.
   * @property {string} [aadProfile.tenantID] The AAD tenant ID to use for
   * authentication. If not specified, will use the tenant of the deployment
   * subscription.
   * @property {array} [apiServerAuthorizedIPRanges] (PREVIEW) Authorized IP
   * Ranges to kubernetes API server.
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of ManagedCluster
   *
   * @returns {object} metadata of ManagedCluster
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'ManagedCluster',
      type: {
        name: 'Composite',
        className: 'ManagedCluster',
        modelProperties: {
          id: {
            required: false,
            readOnly: true,
            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: true,
            serializedName: 'location',
            type: {
              name: 'String'
            }
          },
          tags: {
            required: false,
            serializedName: 'tags',
            type: {
              name: 'Dictionary',
              value: {
                  required: false,
                  serializedName: 'StringElementType',
                  type: {
                    name: 'String'
                  }
              }
            }
          },
          provisioningState: {
            required: false,
            readOnly: true,
            serializedName: 'properties.provisioningState',
            type: {
              name: 'String'
            }
          },
          kubernetesVersion: {
            required: false,
            serializedName: 'properties.kubernetesVersion',
            type: {
              name: 'String'
            }
          },
          dnsPrefix: {
            required: false,
            serializedName: 'properties.dnsPrefix',
            type: {
              name: 'String'
            }
          },
          fqdn: {
            required: false,
            readOnly: true,
            serializedName: 'properties.fqdn',
            type: {
              name: 'String'
            }
          },
          agentPoolProfiles: {
            required: false,
            serializedName: 'properties.agentPoolProfiles',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'ManagedClusterAgentPoolProfileElementType',
                  type: {
                    name: 'Composite',
                    className: 'ManagedClusterAgentPoolProfile'
                  }
              }
            }
          },
          linuxProfile: {
            required: false,
            serializedName: 'properties.linuxProfile',
            type: {
              name: 'Composite',
              className: 'ContainerServiceLinuxProfile'
            }
          },
          servicePrincipalProfile: {
            required: false,
            serializedName: 'properties.servicePrincipalProfile',
            type: {
              name: 'Composite',
              className: 'ManagedClusterServicePrincipalProfile'
            }
          },
          addonProfiles: {
            required: false,
            serializedName: 'properties.addonProfiles',
            type: {
              name: 'Dictionary',
              value: {
                  required: false,
                  serializedName: 'ManagedClusterAddonProfileElementType',
                  type: {
                    name: 'Composite',
                    className: 'ManagedClusterAddonProfile'
                  }
              }
            }
          },
          nodeResourceGroup: {
            required: false,
            readOnly: true,
            serializedName: 'properties.nodeResourceGroup',
            type: {
              name: 'String'
            }
          },
          enableRBAC: {
            required: false,
            serializedName: 'properties.enableRBAC',
            type: {
              name: 'Boolean'
            }
          },
          enablePodSecurityPolicy: {
            required: false,
            serializedName: 'properties.enablePodSecurityPolicy',
            type: {
              name: 'Boolean'
            }
          },
          networkProfile: {
            required: false,
            serializedName: 'properties.networkProfile',
            type: {
              name: 'Composite',
              className: 'ContainerServiceNetworkProfile'
            }
          },
          aadProfile: {
            required: false,
            serializedName: 'properties.aadProfile',
            type: {
              name: 'Composite',
              className: 'ManagedClusterAADProfile'
            }
          },
          apiServerAuthorizedIPRanges: {
            required: false,
            serializedName: 'properties.apiServerAuthorizedIPRanges',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'StringElementType',
                  type: {
                    name: 'String'
                  }
              }
            }
          }
        }
      }
    };
  }
}

module.exports = ManagedCluster;
