/**
 * Copyright (c) 2020-present, Goldman Sachs
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
import { getRelationalInputType, observe_DatasourceSpecification, observe_AuthenticationStrategy, observe_BindingTransformer, observe_PropertyMapping, observe_EnumerationMappingReference, observe_TableAlias, observe_PostProcessor, observe_Mapper, } from '@finos/legend-graph';
import { addUniqueEntry, deleteEntry } from '@finos/legend-shared';
import { action } from 'mobx';
// --------------------------------------------- DB Connection -------------------------------------
export const dBConnection_setType = action((con, val) => {
    con.type = val;
});
export const dBConnection_setQuoteIdentifiers = action((con, val) => {
    con.quoteIdentifiers = val;
});
export const dBConnection_setQueryTimeOut = action((con, val) => {
    con.queryTimeOutInSeconds = val;
});
export const relationDbConnection_setLocalMode = action((con, val) => {
    con.localMode = val;
});
export const relationDbConnection_setDatasourceSpecification = action((con, val, context) => {
    con.datasourceSpecification = observe_DatasourceSpecification(val, context);
});
export const relationDbConnection_setNewAuthenticationStrategy = action((con, val, context) => {
    con.authenticationStrategy = observe_AuthenticationStrategy(val, context);
});
// --------------------------------------------- AuthenticationStrategy -------------------------------------
export const delegatedKerberosAuthenticationStrategy_setServerPrincipal = action((v, val) => {
    v.serverPrincipal = val;
});
export const apiTokenAuthenticationStrategy_setApiToken = action((v, val) => {
    v.apiToken = val;
});
export const oAuthAuthenticationStrategy_setOauthKey = action((v, val) => {
    v.oauthKey = val;
});
export const oAuthAuthenticationStrategy_setScopeName = action((v, val) => {
    v.scopeName = val;
});
export const snowflakePublicAuthenticationStrategy_setPrivateKeyVaultReference = action((v, val) => {
    v.privateKeyVaultReference = val;
});
export const snowflakePublicAuthenticationStrategy_setPassPhraseVaultReference = action((v, val) => {
    v.passPhraseVaultReference = val;
});
export const snowflakePublicAuthenticationStrategy_setPublicUserName = action((v, val) => {
    v.publicUserName = val;
});
export const usernamePasswordAuthenticationStrategy_setBaseVaultReference = action((v, val) => {
    v.baseVaultReference = val;
});
export const usernamePasswordAuthenticationStrategy_setUserNameVaultReference = action((v, val) => {
    v.userNameVaultReference = val;
});
export const usernamePasswordAuthenticationStrategy_setPasswordVaultReference = action((v, val) => {
    v.passwordVaultReference = val;
});
export const trinoDelegatedKerberosAuthenticationStrategy_setKerberosRemoteServiceName = action((v, val) => {
    v.kerberosRemoteServiceName = val;
});
export const trinoDelegatedKerberosAuthenticationStrategy_setKerberosUseCanonicalHostname = action((v, val) => {
    v.kerberosUseCanonicalHostname = val;
});
export const gcpWorkloadIdentityFederationAuthenticationStrategy_setServiceAccountEmail = action((v, val) => {
    v.serviceAccountEmail = val;
});
export const gcpWorkloadIdentityFederationAuthenticationStrategy_setAdditionalGcpScopes = action((v, val) => {
    v.additionalGcpScopes = val;
});
export const middleTierUsernamePasswordAuthenticationStrategy_setVaultReference = action((v, val) => {
    v.vaultReference = val;
});
// --------------------------------------------- DatasourceSpecification -------------------------------------
export const staticDatasourceSpecification_setHost = action((v, val) => {
    v.host = val;
});
export const staticDatasourceSpecification_setPort = action((v, val) => {
    v.port = val;
});
export const staticDatasourceSpecification_setDatabaseName = action((v, val) => {
    v.databaseName = val;
});
export const databricksDatasourceSpecification_setHostName = action((v, val) => {
    v.hostname = val;
});
export const databricksDatasourceSpecification_setPort = action((v, val) => {
    v.port = val;
});
export const databricksDatasourceSpecification_setProtocol = action((v, val) => {
    v.protocol = val;
});
export const databricksDatasourceSpecification_setHttpPath = action((v, val) => {
    v.httpPath = val;
});
export const embeddedH2DatasourceSpecification_setDatabaseName = action((v, val) => {
    v.databaseName = val;
});
export const embeddedH2DatasourceSpecification_setDirectory = action((v, val) => {
    v.directory = val;
});
export const embeddedH2DatasourceSpecification_setAutoServerMode = action((v, val) => {
    v.autoServerMode = val;
});
export const localH2DatasourceSpecification_setTestDataSetupSqls = action((v, val) => {
    v.testDataSetupSqls = val;
});
export const localH2DatasourceSpecification_setTestDataSetupCsv = action((v, val) => {
    v.testDataSetupCsv = val;
});
export const snowflakeDatasourceSpec_setTempTableDb = action((spec, val) => {
    spec.tempTableDb = val;
});
export const snowflakeDatasourceSpec_setTempTableSchema = action((spec, val) => {
    spec.tempTableSchema = val;
});
export const snowflakeDatasourceSpec_setAccountName = action((spec, val) => {
    spec.accountName = val;
});
export const snowflakeDatasourceSpec_setRegion = action((spec, val) => {
    spec.region = val;
});
export const snowflakeDatasourceSpec_setWarehouseName = action((spec, val) => {
    spec.warehouseName = val;
});
export const snowflakeDatasourceSpec_setDatabaseName = action((spec, val) => {
    spec.databaseName = val;
});
export const snowflakeDatasourceSpec_setCloudType = action((spec, val) => {
    spec.cloudType = val;
});
export const snowflakeDatasourceSpec_setQuotedIdentifiersIgnoreCase = action((spec, val) => {
    spec.quotedIdentifiersIgnoreCase = val;
});
export const snowflakeDatasourceSpec_setEnableQueryTags = action((spec, val) => {
    spec.enableQueryTags = val;
});
export const snowflakeDatasourceSpec_setProxyHost = action((spec, val) => {
    spec.proxyHost = val;
});
export const snowflakeDatasourceSpec_setProxyPort = action((spec, val) => {
    spec.proxyPort = val;
});
export const snowflakeDatasourceSpec_setNonProxyHosts = action((spec, val) => {
    spec.nonProxyHosts = val;
});
export const snowflakeDatasourceSpec_setOrganization = action((spec, val) => {
    spec.organization = val;
});
export const snowflakeDatasourceSpec_setAccountType = action((spec, val) => {
    spec.accountType = val;
});
export const snowflakeDatasourceSpec_setRole = action((spec, val) => {
    spec.role = val;
});
export const redshiftDatasourceSpecification_setDatabaseName = action((spec, val) => {
    spec.databaseName = val;
});
export const redshiftDatasourceSpecification_setEndpointURL = action((spec, val) => {
    spec.endpointURL = val;
});
export const redshiftDatasourceSpecification_setPort = action((spec, val) => {
    spec.port = val;
});
export const redshiftDatasourceSpecification_setRegion = action((spec, val) => {
    spec.region = val;
});
export const redshiftDatasourceSpecification_setHost = action((spec, val) => {
    spec.host = val;
});
export const redshiftDatasourceSpecification_setClusterID = action((spec, val) => {
    spec.clusterID = val;
});
export const bigQueryDatasourceSpecification_setProjectId = action((spec, val) => {
    spec.projectId = val;
});
export const bigQueryDatasourceSpecification_setDefaultDataset = action((spec, val) => {
    spec.defaultDataset = val;
});
export const bigQueryDatasourceSpecification_setProxyHost = action((spec, val) => {
    spec.proxyHost = val;
});
export const bigQueryDatasourceSpecification_setProxyPort = action((spec, val) => {
    spec.proxyPort = val;
});
export const spannerDatasourceSpecification_setProjectId = action((spec, val) => {
    spec.projectId = val;
});
export const spannerDatasourceSpecification_setInstanceId = action((spec, val) => {
    spec.instanceId = val;
});
export const spannerDatasourceSpecification_setDatabaseId = action((spec, val) => {
    spec.databaseId = val;
});
export const spannerDatasourceSpecification_setProxyHost = action((spec, val) => {
    spec.proxyHost = val;
});
export const spannerDatasourceSpecification_setProxyPort = action((spec, val) => {
    spec.proxyPort = val;
});
export const trinoDatasourceSpecification_setHost = action((spec, val) => {
    spec.host = val;
});
export const trinoDatasourceSpecification_setPort = action((spec, val) => {
    spec.port = val;
});
export const trinoDatasourceSpecification_setCatalog = action((spec, val) => {
    spec.catalog = val;
});
export const trinoDatasourceSpecification_setSchema = action((spec, val) => {
    spec.schema = val;
});
export const trinoDatasourceSpecification_setClientTags = action((spec, val) => {
    spec.clientTags = val;
});
export const trinoDatasourceSpecification_setSsl = action((spec, val) => {
    spec.sslSpecification.ssl = val;
});
export const trinoDatasourceSpecification_setTrustStorePathVaultReference = action((spec, val) => {
    spec.sslSpecification.trustStorePathVaultReference = val;
});
export const trinoDatasourceSpecification_setTrustStorePasswordVaultReference = action((spec, val) => {
    spec.sslSpecification.trustStorePasswordVaultReference = val;
});
export const relationalInputData_setData = action((input, value) => {
    input.data = value;
});
export const relationalInputData_setInputType = action((input, value) => {
    input.inputType = getRelationalInputType(value);
});
export const relationalPropertyMapping_setTransformer = action((v, value) => {
    v.transformer = value
        ? observe_EnumerationMappingReference(value)
        : undefined;
});
export const relationalPropertyMapping_setBindingTransformer = action((v, value) => {
    v.bindingTransformer = value
        ? observe_BindingTransformer(value)
        : undefined;
});
export const rootRelationalSetImp_setMainTableAlias = action((v, value) => {
    v.mainTableAlias = observe_TableAlias(value);
});
export const rootRelationalSetImp_setPropertyMappings = action((v, value, observeContext) => {
    v.propertyMappings = value.map((pm) => observe_PropertyMapping(pm, observeContext));
});
// --------------------------------------------- Post-Processor -------------------------------------
export const relationalDatabaseConnection_addPostProcessor = action((connectionValueState, postProcessor, observerContext) => {
    addUniqueEntry(connectionValueState.connection.postProcessors, observe_PostProcessor(postProcessor, observerContext));
});
export const relationalDatabaseConnection_deletePostProcessor = action((connectionValueState, postProcessor) => {
    deleteEntry(connectionValueState.connection.postProcessors, postProcessor);
});
export const mapperPostProcessor_addMapper = action((mapperPostProcessor, mapper) => {
    addUniqueEntry(mapperPostProcessor.mappers, observe_Mapper(mapper));
});
export const mapper_setFrom = action((mapper, val) => {
    mapper.from = val;
});
export const mapper_setTo = action((mapper, val) => {
    mapper.to = val;
});
export const schemaNameMapper_setTo = action((schemaNameMapper, val) => {
    schemaNameMapper.to = val;
});
export const schemaNameMapper_setFrom = action((schemaNameMapper, val) => {
    schemaNameMapper.from = val;
});
export const mapperPostProcessor_deleteMapper = action((mapperPostProcessor, val) => {
    deleteEntry(mapperPostProcessor.mappers, val);
});
//# sourceMappingURL=STO_Relational_GraphModifierHelper.js.map