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

/**
 * Describes a Power BI output data source.
 *
 * @extends models['OutputDataSource']
 */
class PowerBIOutputDataSource extends models['OutputDataSource'] {
  /**
   * Create a PowerBIOutputDataSource.
   * @member {string} [refreshToken] A refresh token that can be used to obtain
   * a valid access token that can then be used to authenticate with the data
   * source. A valid refresh token is currently only obtainable via the Azure
   * Portal. It is recommended to put a dummy string value here when creating
   * the data source and then going to the Azure Portal to authenticate the
   * data source which will update this property with a valid refresh token.
   * Required on PUT (CreateOrReplace) requests.
   * @member {string} [tokenUserPrincipalName] The user principal name (UPN) of
   * the user that was used to obtain the refresh token. Use this property to
   * help remember which user was used to obtain the refresh token.
   * @member {string} [tokenUserDisplayName] The user display name of the user
   * that was used to obtain the refresh token. Use this property to help
   * remember which user was used to obtain the refresh token.
   * @member {string} [dataset] The name of the Power BI dataset. Required on
   * PUT (CreateOrReplace) requests.
   * @member {string} [table] The name of the Power BI table under the
   * specified dataset. Required on PUT (CreateOrReplace) requests.
   * @member {string} [groupId] The ID of the Power BI group.
   * @member {string} [groupName] The name of the Power BI group. Use this
   * property to help remember which specific Power BI group id was used.
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of PowerBIOutputDataSource
   *
   * @returns {object} metadata of PowerBIOutputDataSource
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'PowerBI',
      type: {
        name: 'Composite',
        className: 'PowerBIOutputDataSource',
        modelProperties: {
          type: {
            required: true,
            serializedName: 'type',
            type: {
              name: 'String'
            }
          },
          refreshToken: {
            required: false,
            serializedName: 'properties.refreshToken',
            type: {
              name: 'String'
            }
          },
          tokenUserPrincipalName: {
            required: false,
            serializedName: 'properties.tokenUserPrincipalName',
            type: {
              name: 'String'
            }
          },
          tokenUserDisplayName: {
            required: false,
            serializedName: 'properties.tokenUserDisplayName',
            type: {
              name: 'String'
            }
          },
          dataset: {
            required: false,
            serializedName: 'properties.dataset',
            type: {
              name: 'String'
            }
          },
          table: {
            required: false,
            serializedName: 'properties.table',
            type: {
              name: 'String'
            }
          },
          groupId: {
            required: false,
            serializedName: 'properties.groupId',
            type: {
              name: 'String'
            }
          },
          groupName: {
            required: false,
            serializedName: 'properties.groupName',
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = PowerBIOutputDataSource;
