/* tslint:disable */
/* eslint-disable */
/**
 * authentik
 * Making authentication simple.
 *
 * The version of the OpenAPI document: 2025.10.0-rc1
 * Contact: hello@goauthentik.io
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */

import { mapValues } from '../runtime';
import type { OutgoingSyncDeleteAction } from './OutgoingSyncDeleteAction';
import {
    OutgoingSyncDeleteActionFromJSON,
    OutgoingSyncDeleteActionFromJSONTyped,
    OutgoingSyncDeleteActionToJSON,
    OutgoingSyncDeleteActionToJSONTyped,
} from './OutgoingSyncDeleteAction';

/**
 * GoogleWorkspaceProvider Serializer
 * @export
 * @interface GoogleWorkspaceProvider
 */
export interface GoogleWorkspaceProvider {
    /**
     * 
     * @type {number}
     * @memberof GoogleWorkspaceProvider
     */
    readonly pk: number;
    /**
     * 
     * @type {string}
     * @memberof GoogleWorkspaceProvider
     */
    name: string;
    /**
     * 
     * @type {Array<string>}
     * @memberof GoogleWorkspaceProvider
     */
    propertyMappings?: Array<string>;
    /**
     * Property mappings used for group creation/updating.
     * @type {Array<string>}
     * @memberof GoogleWorkspaceProvider
     */
    propertyMappingsGroup?: Array<string>;
    /**
     * Get object component so that we know how to edit the object
     * @type {string}
     * @memberof GoogleWorkspaceProvider
     */
    readonly component: string;
    /**
     * Internal application name, used in URLs.
     * @type {string}
     * @memberof GoogleWorkspaceProvider
     */
    readonly assignedBackchannelApplicationSlug: string;
    /**
     * Application's display Name.
     * @type {string}
     * @memberof GoogleWorkspaceProvider
     */
    readonly assignedBackchannelApplicationName: string;
    /**
     * Return object's verbose_name
     * @type {string}
     * @memberof GoogleWorkspaceProvider
     */
    readonly verboseName: string;
    /**
     * Return object's plural verbose_name
     * @type {string}
     * @memberof GoogleWorkspaceProvider
     */
    readonly verboseNamePlural: string;
    /**
     * Return internal model name
     * @type {string}
     * @memberof GoogleWorkspaceProvider
     */
    readonly metaModelName: string;
    /**
     * 
     * @type {string}
     * @memberof GoogleWorkspaceProvider
     */
    delegatedSubject: string;
    /**
     * 
     * @type {{ [key: string]: any; }}
     * @memberof GoogleWorkspaceProvider
     */
    credentials: { [key: string]: any; };
    /**
     * 
     * @type {string}
     * @memberof GoogleWorkspaceProvider
     */
    scopes?: string;
    /**
     * 
     * @type {boolean}
     * @memberof GoogleWorkspaceProvider
     */
    excludeUsersServiceAccount?: boolean;
    /**
     * 
     * @type {string}
     * @memberof GoogleWorkspaceProvider
     */
    filterGroup?: string | null;
    /**
     * 
     * @type {OutgoingSyncDeleteAction}
     * @memberof GoogleWorkspaceProvider
     */
    userDeleteAction?: OutgoingSyncDeleteAction;
    /**
     * 
     * @type {OutgoingSyncDeleteAction}
     * @memberof GoogleWorkspaceProvider
     */
    groupDeleteAction?: OutgoingSyncDeleteAction;
    /**
     * 
     * @type {string}
     * @memberof GoogleWorkspaceProvider
     */
    defaultGroupEmailDomain: string;
    /**
     * When enabled, provider will not modify or create objects in the remote system.
     * @type {boolean}
     * @memberof GoogleWorkspaceProvider
     */
    dryRun?: boolean;
}



/**
 * Check if a given object implements the GoogleWorkspaceProvider interface.
 */
export function instanceOfGoogleWorkspaceProvider(value: object): value is GoogleWorkspaceProvider {
    if (!('pk' in value) || value['pk'] === undefined) return false;
    if (!('name' in value) || value['name'] === undefined) return false;
    if (!('component' in value) || value['component'] === undefined) return false;
    if (!('assignedBackchannelApplicationSlug' in value) || value['assignedBackchannelApplicationSlug'] === undefined) return false;
    if (!('assignedBackchannelApplicationName' in value) || value['assignedBackchannelApplicationName'] === undefined) return false;
    if (!('verboseName' in value) || value['verboseName'] === undefined) return false;
    if (!('verboseNamePlural' in value) || value['verboseNamePlural'] === undefined) return false;
    if (!('metaModelName' in value) || value['metaModelName'] === undefined) return false;
    if (!('delegatedSubject' in value) || value['delegatedSubject'] === undefined) return false;
    if (!('credentials' in value) || value['credentials'] === undefined) return false;
    if (!('defaultGroupEmailDomain' in value) || value['defaultGroupEmailDomain'] === undefined) return false;
    return true;
}

export function GoogleWorkspaceProviderFromJSON(json: any): GoogleWorkspaceProvider {
    return GoogleWorkspaceProviderFromJSONTyped(json, false);
}

export function GoogleWorkspaceProviderFromJSONTyped(json: any, ignoreDiscriminator: boolean): GoogleWorkspaceProvider {
    if (json == null) {
        return json;
    }
    return {
        
        'pk': json['pk'],
        'name': json['name'],
        'propertyMappings': json['property_mappings'] == null ? undefined : json['property_mappings'],
        'propertyMappingsGroup': json['property_mappings_group'] == null ? undefined : json['property_mappings_group'],
        'component': json['component'],
        'assignedBackchannelApplicationSlug': json['assigned_backchannel_application_slug'],
        'assignedBackchannelApplicationName': json['assigned_backchannel_application_name'],
        'verboseName': json['verbose_name'],
        'verboseNamePlural': json['verbose_name_plural'],
        'metaModelName': json['meta_model_name'],
        'delegatedSubject': json['delegated_subject'],
        'credentials': json['credentials'],
        'scopes': json['scopes'] == null ? undefined : json['scopes'],
        'excludeUsersServiceAccount': json['exclude_users_service_account'] == null ? undefined : json['exclude_users_service_account'],
        'filterGroup': json['filter_group'] == null ? undefined : json['filter_group'],
        'userDeleteAction': json['user_delete_action'] == null ? undefined : OutgoingSyncDeleteActionFromJSON(json['user_delete_action']),
        'groupDeleteAction': json['group_delete_action'] == null ? undefined : OutgoingSyncDeleteActionFromJSON(json['group_delete_action']),
        'defaultGroupEmailDomain': json['default_group_email_domain'],
        'dryRun': json['dry_run'] == null ? undefined : json['dry_run'],
    };
}

export function GoogleWorkspaceProviderToJSON(json: any): GoogleWorkspaceProvider {
    return GoogleWorkspaceProviderToJSONTyped(json, false);
}

export function GoogleWorkspaceProviderToJSONTyped(value?: Omit<GoogleWorkspaceProvider, 'pk'|'component'|'assigned_backchannel_application_slug'|'assigned_backchannel_application_name'|'verbose_name'|'verbose_name_plural'|'meta_model_name'> | null, ignoreDiscriminator: boolean = false): any {
    if (value == null) {
        return value;
    }

    return {
        
        'name': value['name'],
        'property_mappings': value['propertyMappings'],
        'property_mappings_group': value['propertyMappingsGroup'],
        'delegated_subject': value['delegatedSubject'],
        'credentials': value['credentials'],
        'scopes': value['scopes'],
        'exclude_users_service_account': value['excludeUsersServiceAccount'],
        'filter_group': value['filterGroup'],
        'user_delete_action': OutgoingSyncDeleteActionToJSON(value['userDeleteAction']),
        'group_delete_action': OutgoingSyncDeleteActionToJSON(value['groupDeleteAction']),
        'default_group_email_domain': value['defaultGroupEmailDomain'],
        'dry_run': value['dryRun'],
    };
}

