/* tslint:disable */
/* eslint-disable */
/**
 * zrok
 * zrok client access
 *
 * The version of the OpenAPI document: 1.0.0
 * 
 *
 * 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 { AuthUser } from './AuthUser';
import {
    AuthUserFromJSON,
    AuthUserFromJSONTyped,
    AuthUserToJSON,
} from './AuthUser';

/**
 * 
 * @export
 * @interface ShareRequest
 */
export interface ShareRequest {
    /**
     * 
     * @type {string}
     * @memberof ShareRequest
     */
    envZId?: string;
    /**
     * 
     * @type {string}
     * @memberof ShareRequest
     */
    shareMode?: ShareRequestShareModeEnum;
    /**
     * 
     * @type {Array<string>}
     * @memberof ShareRequest
     */
    frontendSelection?: Array<string>;
    /**
     * 
     * @type {string}
     * @memberof ShareRequest
     */
    backendMode?: ShareRequestBackendModeEnum;
    /**
     * 
     * @type {string}
     * @memberof ShareRequest
     */
    backendProxyEndpoint?: string;
    /**
     * 
     * @type {string}
     * @memberof ShareRequest
     */
    authScheme?: string;
    /**
     * 
     * @type {Array<AuthUser>}
     * @memberof ShareRequest
     */
    authUsers?: Array<AuthUser>;
    /**
     * 
     * @type {string}
     * @memberof ShareRequest
     */
    oauthProvider?: ShareRequestOauthProviderEnum;
    /**
     * 
     * @type {Array<string>}
     * @memberof ShareRequest
     */
    oauthEmailDomains?: Array<string>;
    /**
     * 
     * @type {string}
     * @memberof ShareRequest
     */
    oauthAuthorizationCheckInterval?: string;
    /**
     * 
     * @type {boolean}
     * @memberof ShareRequest
     */
    reserved?: boolean;
    /**
     * 
     * @type {string}
     * @memberof ShareRequest
     */
    permissionMode?: ShareRequestPermissionModeEnum;
    /**
     * 
     * @type {Array<string>}
     * @memberof ShareRequest
     */
    accessGrants?: Array<string>;
    /**
     * 
     * @type {string}
     * @memberof ShareRequest
     */
    uniqueName?: string;
}


/**
 * @export
 */
export const ShareRequestShareModeEnum = {
    Public: 'public',
    Private: 'private'
} as const;
export type ShareRequestShareModeEnum = typeof ShareRequestShareModeEnum[keyof typeof ShareRequestShareModeEnum];

/**
 * @export
 */
export const ShareRequestBackendModeEnum = {
    Proxy: 'proxy',
    Web: 'web',
    TcpTunnel: 'tcpTunnel',
    UdpTunnel: 'udpTunnel',
    Caddy: 'caddy',
    Drive: 'drive',
    Socks: 'socks',
    Vpn: 'vpn'
} as const;
export type ShareRequestBackendModeEnum = typeof ShareRequestBackendModeEnum[keyof typeof ShareRequestBackendModeEnum];

/**
 * @export
 */
export const ShareRequestOauthProviderEnum = {
    Github: 'github',
    Google: 'google'
} as const;
export type ShareRequestOauthProviderEnum = typeof ShareRequestOauthProviderEnum[keyof typeof ShareRequestOauthProviderEnum];

/**
 * @export
 */
export const ShareRequestPermissionModeEnum = {
    Open: 'open',
    Closed: 'closed'
} as const;
export type ShareRequestPermissionModeEnum = typeof ShareRequestPermissionModeEnum[keyof typeof ShareRequestPermissionModeEnum];


/**
 * Check if a given object implements the ShareRequest interface.
 */
export function instanceOfShareRequest(value: object): value is ShareRequest {
    return true;
}

export function ShareRequestFromJSON(json: any): ShareRequest {
    return ShareRequestFromJSONTyped(json, false);
}

export function ShareRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): ShareRequest {
    if (json == null) {
        return json;
    }
    return {
        
        'envZId': json['envZId'] == null ? undefined : json['envZId'],
        'shareMode': json['shareMode'] == null ? undefined : json['shareMode'],
        'frontendSelection': json['frontendSelection'] == null ? undefined : json['frontendSelection'],
        'backendMode': json['backendMode'] == null ? undefined : json['backendMode'],
        'backendProxyEndpoint': json['backendProxyEndpoint'] == null ? undefined : json['backendProxyEndpoint'],
        'authScheme': json['authScheme'] == null ? undefined : json['authScheme'],
        'authUsers': json['authUsers'] == null ? undefined : ((json['authUsers'] as Array<any>).map(AuthUserFromJSON)),
        'oauthProvider': json['oauthProvider'] == null ? undefined : json['oauthProvider'],
        'oauthEmailDomains': json['oauthEmailDomains'] == null ? undefined : json['oauthEmailDomains'],
        'oauthAuthorizationCheckInterval': json['oauthAuthorizationCheckInterval'] == null ? undefined : json['oauthAuthorizationCheckInterval'],
        'reserved': json['reserved'] == null ? undefined : json['reserved'],
        'permissionMode': json['permissionMode'] == null ? undefined : json['permissionMode'],
        'accessGrants': json['accessGrants'] == null ? undefined : json['accessGrants'],
        'uniqueName': json['uniqueName'] == null ? undefined : json['uniqueName'],
    };
}

export function ShareRequestToJSON(value?: ShareRequest | null): any {
    if (value == null) {
        return value;
    }
    return {
        
        'envZId': value['envZId'],
        'shareMode': value['shareMode'],
        'frontendSelection': value['frontendSelection'],
        'backendMode': value['backendMode'],
        'backendProxyEndpoint': value['backendProxyEndpoint'],
        'authScheme': value['authScheme'],
        'authUsers': value['authUsers'] == null ? undefined : ((value['authUsers'] as Array<any>).map(AuthUserToJSON)),
        'oauthProvider': value['oauthProvider'],
        'oauthEmailDomains': value['oauthEmailDomains'],
        'oauthAuthorizationCheckInterval': value['oauthAuthorizationCheckInterval'],
        'reserved': value['reserved'],
        'permissionMode': value['permissionMode'],
        'accessGrants': value['accessGrants'],
        'uniqueName': value['uniqueName'],
    };
}

