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

/**
 * Google BigQuery service linked service.
 *
 * @extends models['LinkedService']
 */
class GoogleBigQueryLinkedService extends models['LinkedService'] {
  /**
   * Create a GoogleBigQueryLinkedService.
   * @member {object} project The default BigQuery project to query against.
   * @member {object} [additionalProjects] A comma-separated list of public
   * BigQuery projects to access.
   * @member {object} [requestGoogleDriveScope] Whether to request access to
   * Google Drive. Allowing Google Drive access enables support for federated
   * tables that combine BigQuery data with data from Google Drive. The default
   * value is false.
   * @member {string} authenticationType The OAuth 2.0 authentication mechanism
   * used for authentication. ServiceAuthentication can only be used on
   * self-hosted IR. Possible values include: 'ServiceAuthentication',
   * 'UserAuthentication'
   * @member {object} [refreshToken] The refresh token obtained from Google for
   * authorizing access to BigQuery for UserAuthentication.
   * @member {string} [refreshToken.type] Polymorphic Discriminator
   * @member {object} [clientId] The client id of the google application used
   * to acquire the refresh token.
   * @member {string} [clientId.type] Polymorphic Discriminator
   * @member {object} [clientSecret] The client secret of the google
   * application used to acquire the refresh token.
   * @member {string} [clientSecret.type] Polymorphic Discriminator
   * @member {object} [email] The service account email ID that is used for
   * ServiceAuthentication and can only be used on self-hosted IR.
   * @member {object} [keyFilePath] The full path to the .p12 key file that is
   * used to authenticate the service account email address and can only be
   * used on self-hosted IR.
   * @member {object} [trustedCertPath] The full path of the .pem file
   * containing trusted CA certificates for verifying the server when
   * connecting over SSL. This property can only be set when using SSL on
   * self-hosted IR. The default value is the cacerts.pem file installed with
   * the IR.
   * @member {object} [useSystemTrustStore] Specifies whether to use a CA
   * certificate from the system trust store or from a specified PEM file. The
   * default value is false.
   * @member {object} [encryptedCredential] The encrypted credential used for
   * authentication. Credentials are encrypted using the integration runtime
   * credential manager. Type: string (or Expression with resultType string).
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of GoogleBigQueryLinkedService
   *
   * @returns {object} metadata of GoogleBigQueryLinkedService
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'GoogleBigQuery',
      type: {
        name: 'Composite',
        polymorphicDiscriminator: {
          serializedName: 'type',
          clientName: 'type'
        },
        uberParent: 'LinkedService',
        className: 'GoogleBigQueryLinkedService',
        modelProperties: {
          connectVia: {
            required: false,
            serializedName: 'connectVia',
            type: {
              name: 'Composite',
              className: 'IntegrationRuntimeReference'
            }
          },
          description: {
            required: false,
            serializedName: 'description',
            type: {
              name: 'String'
            }
          },
          parameters: {
            required: false,
            serializedName: 'parameters',
            type: {
              name: 'Dictionary',
              value: {
                  required: false,
                  serializedName: 'ParameterSpecificationElementType',
                  type: {
                    name: 'Composite',
                    className: 'ParameterSpecification'
                  }
              }
            }
          },
          annotations: {
            required: false,
            serializedName: 'annotations',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'ObjectElementType',
                  type: {
                    name: 'Object'
                  }
              }
            }
          },
          type: {
            required: true,
            serializedName: 'type',
            isPolymorphicDiscriminator: true,
            type: {
              name: 'String'
            }
          },
          project: {
            required: true,
            serializedName: 'typeProperties.project',
            type: {
              name: 'Object'
            }
          },
          additionalProjects: {
            required: false,
            serializedName: 'typeProperties.additionalProjects',
            type: {
              name: 'Object'
            }
          },
          requestGoogleDriveScope: {
            required: false,
            serializedName: 'typeProperties.requestGoogleDriveScope',
            type: {
              name: 'Object'
            }
          },
          authenticationType: {
            required: true,
            serializedName: 'typeProperties.authenticationType',
            type: {
              name: 'String'
            }
          },
          refreshToken: {
            required: false,
            serializedName: 'typeProperties.refreshToken',
            type: {
              name: 'Composite',
              polymorphicDiscriminator: {
                serializedName: 'type',
                clientName: 'type'
              },
              uberParent: 'SecretBase',
              className: 'SecretBase'
            }
          },
          clientId: {
            required: false,
            serializedName: 'typeProperties.clientId',
            type: {
              name: 'Composite',
              polymorphicDiscriminator: {
                serializedName: 'type',
                clientName: 'type'
              },
              uberParent: 'SecretBase',
              className: 'SecretBase'
            }
          },
          clientSecret: {
            required: false,
            serializedName: 'typeProperties.clientSecret',
            type: {
              name: 'Composite',
              polymorphicDiscriminator: {
                serializedName: 'type',
                clientName: 'type'
              },
              uberParent: 'SecretBase',
              className: 'SecretBase'
            }
          },
          email: {
            required: false,
            serializedName: 'typeProperties.email',
            type: {
              name: 'Object'
            }
          },
          keyFilePath: {
            required: false,
            serializedName: 'typeProperties.keyFilePath',
            type: {
              name: 'Object'
            }
          },
          trustedCertPath: {
            required: false,
            serializedName: 'typeProperties.trustedCertPath',
            type: {
              name: 'Object'
            }
          },
          useSystemTrustStore: {
            required: false,
            serializedName: 'typeProperties.useSystemTrustStore',
            type: {
              name: 'Object'
            }
          },
          encryptedCredential: {
            required: false,
            serializedName: 'typeProperties.encryptedCredential',
            type: {
              name: 'Object'
            }
          }
        }
      }
    };
  }
}

module.exports = GoogleBigQueryLinkedService;
