/* tslint:disable */
/* eslint-disable */
/**
 * chomestatus API
 * The API for chromestatus.com. chromestatus.com is the official tool used for tracking feature launches in Blink (the browser engine that powers Chrome and many other web browsers). This tool guides feature owners through our launch process and serves as a primary source for developer information that then ripples throughout the web developer ecosystem. More details at: https://github.com/GoogleChrome/chromium-dashboard
 *
 * 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';
/**
 * 
 * @export
 * @interface UserPermissions
 */
export interface UserPermissions {
    /**
     * 
     * @type {boolean}
     * @memberof UserPermissions
     */
    can_create_feature: boolean;
    /**
     * each element should be unique as OAS does not support set
     * @type {Array<number>}
     * @memberof UserPermissions
     */
    approvable_gate_types: Array<number>;
    /**
     * 
     * @type {boolean}
     * @memberof UserPermissions
     */
    can_comment: boolean;
    /**
     * 
     * @type {boolean}
     * @memberof UserPermissions
     */
    can_edit_all: boolean;
    /**
     * 
     * @type {boolean}
     * @memberof UserPermissions
     */
    can_review_release_notes?: boolean;
    /**
     * 
     * @type {boolean}
     * @memberof UserPermissions
     */
    is_admin: boolean;
    /**
     * 
     * @type {string}
     * @memberof UserPermissions
     */
    email: string;
    /**
     * 
     * @type {Array<number>}
     * @memberof UserPermissions
     */
    editable_features: Array<number>;
}

/**
 * Check if a given object implements the UserPermissions interface.
 */
export function instanceOfUserPermissions(value: object): value is UserPermissions {
    if (!('can_create_feature' in value) || value['can_create_feature'] === undefined) return false;
    if (!('approvable_gate_types' in value) || value['approvable_gate_types'] === undefined) return false;
    if (!('can_comment' in value) || value['can_comment'] === undefined) return false;
    if (!('can_edit_all' in value) || value['can_edit_all'] === undefined) return false;
    if (!('is_admin' in value) || value['is_admin'] === undefined) return false;
    if (!('email' in value) || value['email'] === undefined) return false;
    if (!('editable_features' in value) || value['editable_features'] === undefined) return false;
    return true;
}

export function UserPermissionsFromJSON(json: any): UserPermissions {
    return UserPermissionsFromJSONTyped(json, false);
}

export function UserPermissionsFromJSONTyped(json: any, ignoreDiscriminator: boolean): UserPermissions {
    if (json == null) {
        return json;
    }
    return {
        
        'can_create_feature': json['can_create_feature'],
        'approvable_gate_types': json['approvable_gate_types'],
        'can_comment': json['can_comment'],
        'can_edit_all': json['can_edit_all'],
        'can_review_release_notes': json['can_review_release_notes'] == null ? undefined : json['can_review_release_notes'],
        'is_admin': json['is_admin'],
        'email': json['email'],
        'editable_features': json['editable_features'],
    };
}

export function UserPermissionsToJSON(value?: UserPermissions | null): any {
    if (value == null) {
        return value;
    }
    return {
        
        'can_create_feature': value['can_create_feature'],
        'approvable_gate_types': value['approvable_gate_types'],
        'can_comment': value['can_comment'],
        'can_edit_all': value['can_edit_all'],
        'can_review_release_notes': value['can_review_release_notes'],
        'is_admin': value['is_admin'],
        'email': value['email'],
        'editable_features': value['editable_features'],
    };
}

