/* tslint:disable */
/* eslint-disable */
/**
 * UCX Proxy
 * A single use API for the UCX Proxy.
 *
 * The version of the OpenAPI document: 0.0.12
 * Contact: customersuccess@equisoft.com
 *
 * 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 { AddressLabel } from './AddressLabel';
import {
    AddressLabelFromJSON,
    AddressLabelFromJSONTyped,
    AddressLabelToJSON,
    AddressLabelToJSONTyped,
} from './AddressLabel';

/**
 * 
 * @export
 * @interface AddressSchema
 */
export interface AddressSchema {
    /**
     * 
     * @type {AddressLabel}
     * @memberof AddressSchema
     */
    label: AddressLabel;
    /**
     * 
     * @type {string}
     * @memberof AddressSchema
     */
    line1?: string | null;
    /**
     * 
     * @type {string}
     * @memberof AddressSchema
     */
    line2?: string | null;
    /**
     * 
     * @type {string}
     * @memberof AddressSchema
     */
    city?: string | null;
    /**
     * 
     * @type {string}
     * @memberof AddressSchema
     */
    postalCode?: string | null;
    /**
     * 
     * @type {string}
     * @memberof AddressSchema
     */
    state?: string | null;
    /**
     * 
     * @type {string}
     * @memberof AddressSchema
     */
    country?: string | null;
    /**
     * 
     * @type {boolean}
     * @memberof AddressSchema
     */
    main: boolean;
}



/**
 * Check if a given object implements the AddressSchema interface.
 */
export function instanceOfAddressSchema(value: object): value is AddressSchema {
    if (!('label' in value) || value['label'] === undefined) return false;
    if (!('main' in value) || value['main'] === undefined) return false;
    return true;
}

export function AddressSchemaFromJSON(json: any): AddressSchema {
    return AddressSchemaFromJSONTyped(json, false);
}

export function AddressSchemaFromJSONTyped(json: any, ignoreDiscriminator: boolean): AddressSchema {
    if (json == null) {
        return json;
    }
    return {
        
        'label': AddressLabelFromJSON(json['label']),
        'line1': json['line1'] == null ? undefined : json['line1'],
        'line2': json['line2'] == null ? undefined : json['line2'],
        'city': json['city'] == null ? undefined : json['city'],
        'postalCode': json['postalCode'] == null ? undefined : json['postalCode'],
        'state': json['state'] == null ? undefined : json['state'],
        'country': json['country'] == null ? undefined : json['country'],
        'main': json['main'],
    };
}

export function AddressSchemaToJSON(json: any): AddressSchema {
    return AddressSchemaToJSONTyped(json, false);
}

export function AddressSchemaToJSONTyped(value?: AddressSchema | null, ignoreDiscriminator: boolean = false): any {
    if (value == null) {
        return value;
    }

    return {
        
        'label': AddressLabelToJSON(value['label']),
        'line1': value['line1'],
        'line2': value['line2'],
        'city': value['city'],
        'postalCode': value['postalCode'],
        'state': value['state'],
        'country': value['country'],
        'main': value['main'],
    };
}

