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

/**
 * The azure blob storage linked service.
 *
 * @extends models['LinkedService']
 */
class AzureBlobStorageLinkedService extends models['LinkedService'] {
  /**
   * Create a AzureBlobStorageLinkedService.
   * @member {object} [connectionString] The connection string. It is mutually
   * exclusive with sasUri, serviceEndpoint property. Type: string,
   * SecureString or AzureKeyVaultSecretReference.
   * @member {object} [accountKey] The Azure key vault secret reference of
   * accountKey in connection string.
   * @member {object} [accountKey.store] The Azure Key Vault linked service
   * reference.
   * @member {string} [accountKey.store.referenceName] Reference LinkedService
   * name.
   * @member {object} [accountKey.store.parameters] Arguments for
   * LinkedService.
   * @member {object} [accountKey.secretName] The name of the secret in Azure
   * Key Vault. Type: string (or Expression with resultType string).
   * @member {object} [accountKey.secretVersion] The version of the secret in
   * Azure Key Vault. The default value is the latest version of the secret.
   * Type: string (or Expression with resultType string).
   * @member {object} [sasUri] SAS URI of the Azure Blob Storage resource. It
   * is mutually exclusive with connectionString, serviceEndpoint property.
   * Type: string, SecureString or AzureKeyVaultSecretReference.
   * @member {object} [sasToken] The Azure key vault secret reference of
   * sasToken in sas uri.
   * @member {object} [sasToken.store] The Azure Key Vault linked service
   * reference.
   * @member {string} [sasToken.store.referenceName] Reference LinkedService
   * name.
   * @member {object} [sasToken.store.parameters] Arguments for LinkedService.
   * @member {object} [sasToken.secretName] The name of the secret in Azure Key
   * Vault. Type: string (or Expression with resultType string).
   * @member {object} [sasToken.secretVersion] The version of the secret in
   * Azure Key Vault. The default value is the latest version of the secret.
   * Type: string (or Expression with resultType string).
   * @member {string} [serviceEndpoint] Blob service endpoint of the Azure Blob
   * Storage resource. It is mutually exclusive with connectionString, sasUri
   * property.
   * @member {object} [servicePrincipalId] The ID of the service principal used
   * to authenticate against Azure SQL Data Warehouse. Type: string (or
   * Expression with resultType string).
   * @member {object} [servicePrincipalKey] The key of the service principal
   * used to authenticate against Azure SQL Data Warehouse.
   * @member {string} [servicePrincipalKey.type] Polymorphic Discriminator
   * @member {object} [tenant] The name or ID of the tenant to which the
   * service principal belongs. Type: string (or Expression with resultType
   * string).
   * @member {string} [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 AzureBlobStorageLinkedService
   *
   * @returns {object} metadata of AzureBlobStorageLinkedService
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'AzureBlobStorage',
      type: {
        name: 'Composite',
        polymorphicDiscriminator: {
          serializedName: 'type',
          clientName: 'type'
        },
        uberParent: 'LinkedService',
        className: 'AzureBlobStorageLinkedService',
        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'
            }
          },
          connectionString: {
            required: false,
            serializedName: 'typeProperties.connectionString',
            type: {
              name: 'Object'
            }
          },
          accountKey: {
            required: false,
            serializedName: 'typeProperties.accountKey',
            type: {
              name: 'Composite',
              polymorphicDiscriminator: {
                serializedName: 'type',
                clientName: 'type'
              },
              uberParent: 'SecretBase',
              className: 'AzureKeyVaultSecretReference'
            }
          },
          sasUri: {
            required: false,
            serializedName: 'typeProperties.sasUri',
            type: {
              name: 'Object'
            }
          },
          sasToken: {
            required: false,
            serializedName: 'typeProperties.sasToken',
            type: {
              name: 'Composite',
              polymorphicDiscriminator: {
                serializedName: 'type',
                clientName: 'type'
              },
              uberParent: 'SecretBase',
              className: 'AzureKeyVaultSecretReference'
            }
          },
          serviceEndpoint: {
            required: false,
            serializedName: 'typeProperties.serviceEndpoint',
            type: {
              name: 'String'
            }
          },
          servicePrincipalId: {
            required: false,
            serializedName: 'typeProperties.servicePrincipalId',
            type: {
              name: 'Object'
            }
          },
          servicePrincipalKey: {
            required: false,
            serializedName: 'typeProperties.servicePrincipalKey',
            type: {
              name: 'Composite',
              polymorphicDiscriminator: {
                serializedName: 'type',
                clientName: 'type'
              },
              uberParent: 'SecretBase',
              className: 'SecretBase'
            }
          },
          tenant: {
            required: false,
            serializedName: 'typeProperties.tenant',
            type: {
              name: 'Object'
            }
          },
          encryptedCredential: {
            required: false,
            serializedName: 'typeProperties.encryptedCredential',
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = AzureBlobStorageLinkedService;
