"use strict";
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
// versions:
//   protoc-gen-ts_proto  v2.11.8
//   protoc               v4.25.9
// source: io/restorecommerce/address.proto
Object.defineProperty(exports, "__esModule", { value: true });
exports.protoMetadata = exports.AddressServiceDefinition = exports.BillingAddress = exports.ShippingAddress = exports.Contact = exports.Address = exports.PackStation = exports.ResidentialAddress = exports.BusinessAddress = exports.AddressAddition = exports.GeoPoint = exports.AddressResponse = exports.AddressListResponse = exports.AddressList = exports.Deleted = exports.protobufPackage = void 0;
/* eslint-disable */
const wire_1 = require("@bufbuild/protobuf/wire");
const auth_1 = require("./auth");
const country_1 = require("./country");
const meta_1 = require("./meta");
const options_1 = require("./options");
const resource_base_1 = require("./resource_base");
const status_1 = require("./status");
exports.protobufPackage = "io.restorecommerce.address";
function createBaseDeleted() {
    return {};
}
exports.Deleted = {
    encode(message, writer = new wire_1.BinaryWriter()) {
        if (message.id !== undefined) {
            writer.uint32(10).string(message.id);
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
        const end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseDeleted();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.id = reader.string();
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return { id: isSet(object.id) ? globalThis.String(object.id) : undefined };
    },
    toJSON(message) {
        const obj = {};
        if (message.id !== undefined) {
            obj.id = message.id;
        }
        return obj;
    },
    create(base) {
        return exports.Deleted.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseDeleted();
        message.id = object.id ?? undefined;
        return message;
    },
};
function createBaseAddressList() {
    return {};
}
exports.AddressList = {
    encode(message, writer = new wire_1.BinaryWriter()) {
        if (message.items !== undefined && message.items.length !== 0) {
            for (const v of message.items) {
                exports.Address.encode(v, writer.uint32(10).fork()).join();
            }
        }
        if (message.total_count !== undefined) {
            writer.uint32(16).uint32(message.total_count);
        }
        if (message.subject !== undefined) {
            auth_1.Subject.encode(message.subject, writer.uint32(26).fork()).join();
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
        const end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseAddressList();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    if (message.items === undefined) {
                        message.items = [];
                    }
                    const el = exports.Address.decode(reader, reader.uint32());
                    if (el !== undefined) {
                        message.items.push(el);
                    }
                    continue;
                }
                case 2: {
                    if (tag !== 16) {
                        break;
                    }
                    message.total_count = reader.uint32();
                    continue;
                }
                case 3: {
                    if (tag !== 26) {
                        break;
                    }
                    message.subject = auth_1.Subject.decode(reader, reader.uint32());
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            items: globalThis.Array.isArray(object?.items) ? object.items.map((e) => exports.Address.fromJSON(e)) : undefined,
            total_count: isSet(object.totalCount)
                ? globalThis.Number(object.totalCount)
                : isSet(object.total_count)
                    ? globalThis.Number(object.total_count)
                    : undefined,
            subject: isSet(object.subject) ? auth_1.Subject.fromJSON(object.subject) : undefined,
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.items?.length) {
            obj.items = message.items.map((e) => exports.Address.toJSON(e));
        }
        if (message.total_count !== undefined) {
            obj.totalCount = Math.round(message.total_count);
        }
        if (message.subject !== undefined) {
            obj.subject = auth_1.Subject.toJSON(message.subject);
        }
        return obj;
    },
    create(base) {
        return exports.AddressList.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseAddressList();
        message.items = object.items?.map((e) => exports.Address.fromPartial(e)) || undefined;
        message.total_count = object.total_count ?? undefined;
        message.subject = (object.subject !== undefined && object.subject !== null)
            ? auth_1.Subject.fromPartial(object.subject)
            : undefined;
        return message;
    },
};
function createBaseAddressListResponse() {
    return {};
}
exports.AddressListResponse = {
    encode(message, writer = new wire_1.BinaryWriter()) {
        if (message.items !== undefined && message.items.length !== 0) {
            for (const v of message.items) {
                exports.AddressResponse.encode(v, writer.uint32(10).fork()).join();
            }
        }
        if (message.total_count !== undefined) {
            writer.uint32(16).uint32(message.total_count);
        }
        if (message.operation_status !== undefined) {
            status_1.OperationStatus.encode(message.operation_status, writer.uint32(26).fork()).join();
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
        const end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseAddressListResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    if (message.items === undefined) {
                        message.items = [];
                    }
                    const el = exports.AddressResponse.decode(reader, reader.uint32());
                    if (el !== undefined) {
                        message.items.push(el);
                    }
                    continue;
                }
                case 2: {
                    if (tag !== 16) {
                        break;
                    }
                    message.total_count = reader.uint32();
                    continue;
                }
                case 3: {
                    if (tag !== 26) {
                        break;
                    }
                    message.operation_status = status_1.OperationStatus.decode(reader, reader.uint32());
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            items: globalThis.Array.isArray(object?.items)
                ? object.items.map((e) => exports.AddressResponse.fromJSON(e))
                : undefined,
            total_count: isSet(object.totalCount)
                ? globalThis.Number(object.totalCount)
                : isSet(object.total_count)
                    ? globalThis.Number(object.total_count)
                    : undefined,
            operation_status: isSet(object.operationStatus)
                ? status_1.OperationStatus.fromJSON(object.operationStatus)
                : isSet(object.operation_status)
                    ? status_1.OperationStatus.fromJSON(object.operation_status)
                    : undefined,
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.items?.length) {
            obj.items = message.items.map((e) => exports.AddressResponse.toJSON(e));
        }
        if (message.total_count !== undefined) {
            obj.totalCount = Math.round(message.total_count);
        }
        if (message.operation_status !== undefined) {
            obj.operationStatus = status_1.OperationStatus.toJSON(message.operation_status);
        }
        return obj;
    },
    create(base) {
        return exports.AddressListResponse.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseAddressListResponse();
        message.items = object.items?.map((e) => exports.AddressResponse.fromPartial(e)) || undefined;
        message.total_count = object.total_count ?? undefined;
        message.operation_status = (object.operation_status !== undefined && object.operation_status !== null)
            ? status_1.OperationStatus.fromPartial(object.operation_status)
            : undefined;
        return message;
    },
};
function createBaseAddressResponse() {
    return {};
}
exports.AddressResponse = {
    encode(message, writer = new wire_1.BinaryWriter()) {
        if (message.payload !== undefined) {
            exports.Address.encode(message.payload, writer.uint32(10).fork()).join();
        }
        if (message.status !== undefined) {
            status_1.Status.encode(message.status, writer.uint32(18).fork()).join();
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
        const end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseAddressResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.payload = exports.Address.decode(reader, reader.uint32());
                    continue;
                }
                case 2: {
                    if (tag !== 18) {
                        break;
                    }
                    message.status = status_1.Status.decode(reader, reader.uint32());
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            payload: isSet(object.payload) ? exports.Address.fromJSON(object.payload) : undefined,
            status: isSet(object.status) ? status_1.Status.fromJSON(object.status) : undefined,
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.payload !== undefined) {
            obj.payload = exports.Address.toJSON(message.payload);
        }
        if (message.status !== undefined) {
            obj.status = status_1.Status.toJSON(message.status);
        }
        return obj;
    },
    create(base) {
        return exports.AddressResponse.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseAddressResponse();
        message.payload = (object.payload !== undefined && object.payload !== null)
            ? exports.Address.fromPartial(object.payload)
            : undefined;
        message.status = (object.status !== undefined && object.status !== null)
            ? status_1.Status.fromPartial(object.status)
            : undefined;
        return message;
    },
};
function createBaseGeoPoint() {
    return {};
}
exports.GeoPoint = {
    encode(message, writer = new wire_1.BinaryWriter()) {
        if (message.latitude !== undefined) {
            writer.uint32(9).double(message.latitude);
        }
        if (message.longitude !== undefined) {
            writer.uint32(17).double(message.longitude);
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
        const end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseGeoPoint();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 9) {
                        break;
                    }
                    message.latitude = reader.double();
                    continue;
                }
                case 2: {
                    if (tag !== 17) {
                        break;
                    }
                    message.longitude = reader.double();
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            latitude: isSet(object.latitude) ? globalThis.Number(object.latitude) : undefined,
            longitude: isSet(object.longitude) ? globalThis.Number(object.longitude) : undefined,
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.latitude !== undefined) {
            obj.latitude = message.latitude;
        }
        if (message.longitude !== undefined) {
            obj.longitude = message.longitude;
        }
        return obj;
    },
    create(base) {
        return exports.GeoPoint.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseGeoPoint();
        message.latitude = object.latitude ?? undefined;
        message.longitude = object.longitude ?? undefined;
        return message;
    },
};
function createBaseAddressAddition() {
    return {};
}
exports.AddressAddition = {
    encode(message, writer = new wire_1.BinaryWriter()) {
        if (message.field1 !== undefined) {
            writer.uint32(10).string(message.field1);
        }
        if (message.field2 !== undefined) {
            writer.uint32(18).string(message.field2);
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
        const end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseAddressAddition();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.field1 = reader.string();
                    continue;
                }
                case 2: {
                    if (tag !== 18) {
                        break;
                    }
                    message.field2 = reader.string();
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            field1: isSet(object.field1) ? globalThis.String(object.field1) : undefined,
            field2: isSet(object.field2) ? globalThis.String(object.field2) : undefined,
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.field1 !== undefined) {
            obj.field1 = message.field1;
        }
        if (message.field2 !== undefined) {
            obj.field2 = message.field2;
        }
        return obj;
    },
    create(base) {
        return exports.AddressAddition.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseAddressAddition();
        message.field1 = object.field1 ?? undefined;
        message.field2 = object.field2 ?? undefined;
        return message;
    },
};
function createBaseBusinessAddress() {
    return {};
}
exports.BusinessAddress = {
    encode(message, writer = new wire_1.BinaryWriter()) {
        if (message.name !== undefined) {
            writer.uint32(10).string(message.name);
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
        const end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseBusinessAddress();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.name = reader.string();
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return { name: isSet(object.name) ? globalThis.String(object.name) : undefined };
    },
    toJSON(message) {
        const obj = {};
        if (message.name !== undefined) {
            obj.name = message.name;
        }
        return obj;
    },
    create(base) {
        return exports.BusinessAddress.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseBusinessAddress();
        message.name = object.name ?? undefined;
        return message;
    },
};
function createBaseResidentialAddress() {
    return {};
}
exports.ResidentialAddress = {
    encode(message, writer = new wire_1.BinaryWriter()) {
        if (message.title !== undefined) {
            writer.uint32(10).string(message.title);
        }
        if (message.given_name !== undefined) {
            writer.uint32(18).string(message.given_name);
        }
        if (message.mid_name !== undefined) {
            writer.uint32(26).string(message.mid_name);
        }
        if (message.family_name !== undefined) {
            writer.uint32(34).string(message.family_name);
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
        const end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseResidentialAddress();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.title = reader.string();
                    continue;
                }
                case 2: {
                    if (tag !== 18) {
                        break;
                    }
                    message.given_name = reader.string();
                    continue;
                }
                case 3: {
                    if (tag !== 26) {
                        break;
                    }
                    message.mid_name = reader.string();
                    continue;
                }
                case 4: {
                    if (tag !== 34) {
                        break;
                    }
                    message.family_name = reader.string();
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            title: isSet(object.title) ? globalThis.String(object.title) : undefined,
            given_name: isSet(object.givenName)
                ? globalThis.String(object.givenName)
                : isSet(object.given_name)
                    ? globalThis.String(object.given_name)
                    : undefined,
            mid_name: isSet(object.midName)
                ? globalThis.String(object.midName)
                : isSet(object.mid_name)
                    ? globalThis.String(object.mid_name)
                    : undefined,
            family_name: isSet(object.familyName)
                ? globalThis.String(object.familyName)
                : isSet(object.family_name)
                    ? globalThis.String(object.family_name)
                    : undefined,
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.title !== undefined) {
            obj.title = message.title;
        }
        if (message.given_name !== undefined) {
            obj.givenName = message.given_name;
        }
        if (message.mid_name !== undefined) {
            obj.midName = message.mid_name;
        }
        if (message.family_name !== undefined) {
            obj.familyName = message.family_name;
        }
        return obj;
    },
    create(base) {
        return exports.ResidentialAddress.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseResidentialAddress();
        message.title = object.title ?? undefined;
        message.given_name = object.given_name ?? undefined;
        message.mid_name = object.mid_name ?? undefined;
        message.family_name = object.family_name ?? undefined;
        return message;
    },
};
function createBasePackStation() {
    return {};
}
exports.PackStation = {
    encode(message, writer = new wire_1.BinaryWriter()) {
        if (message.provider !== undefined) {
            writer.uint32(10).string(message.provider);
        }
        if (message.station_number !== undefined) {
            writer.uint32(18).string(message.station_number);
        }
        if (message.post_number !== undefined) {
            writer.uint32(26).string(message.post_number);
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
        const end = length === undefined ? reader.len : reader.pos + length;
        const message = createBasePackStation();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.provider = reader.string();
                    continue;
                }
                case 2: {
                    if (tag !== 18) {
                        break;
                    }
                    message.station_number = reader.string();
                    continue;
                }
                case 3: {
                    if (tag !== 26) {
                        break;
                    }
                    message.post_number = reader.string();
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            provider: isSet(object.provider) ? globalThis.String(object.provider) : undefined,
            station_number: isSet(object.stationNumber)
                ? globalThis.String(object.stationNumber)
                : isSet(object.station_number)
                    ? globalThis.String(object.station_number)
                    : undefined,
            post_number: isSet(object.postNumber)
                ? globalThis.String(object.postNumber)
                : isSet(object.post_number)
                    ? globalThis.String(object.post_number)
                    : undefined,
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.provider !== undefined) {
            obj.provider = message.provider;
        }
        if (message.station_number !== undefined) {
            obj.stationNumber = message.station_number;
        }
        if (message.post_number !== undefined) {
            obj.postNumber = message.post_number;
        }
        return obj;
    },
    create(base) {
        return exports.PackStation.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBasePackStation();
        message.provider = object.provider ?? undefined;
        message.station_number = object.station_number ?? undefined;
        message.post_number = object.post_number ?? undefined;
        return message;
    },
};
function createBaseAddress() {
    return {};
}
exports.Address = {
    encode(message, writer = new wire_1.BinaryWriter()) {
        if (message.id !== undefined) {
            writer.uint32(10).string(message.id);
        }
        if (message.meta !== undefined) {
            meta_1.Meta.encode(message.meta, writer.uint32(18).fork()).join();
        }
        if (message.postcode !== undefined) {
            writer.uint32(26).string(message.postcode);
        }
        if (message.country_id !== undefined) {
            writer.uint32(34).string(message.country_id);
        }
        if (message.locality !== undefined) {
            writer.uint32(50).string(message.locality);
        }
        if (message.street !== undefined) {
            writer.uint32(58).string(message.street);
        }
        if (message.region !== undefined) {
            writer.uint32(66).string(message.region);
        }
        if (message.geo_coordinates !== undefined) {
            exports.GeoPoint.encode(message.geo_coordinates, writer.uint32(74).fork()).join();
        }
        if (message.altitude !== undefined) {
            writer.uint32(81).double(message.altitude);
        }
        if (message.building_number !== undefined) {
            writer.uint32(90).string(message.building_number);
        }
        if (message.address_addition !== undefined) {
            exports.AddressAddition.encode(message.address_addition, writer.uint32(98).fork()).join();
        }
        if (message.business_address !== undefined) {
            exports.BusinessAddress.encode(message.business_address, writer.uint32(106).fork()).join();
        }
        if (message.residential_address !== undefined) {
            exports.ResidentialAddress.encode(message.residential_address, writer.uint32(114).fork()).join();
        }
        if (message.pack_station !== undefined) {
            exports.PackStation.encode(message.pack_station, writer.uint32(122).fork()).join();
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
        const end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseAddress();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.id = reader.string();
                    continue;
                }
                case 2: {
                    if (tag !== 18) {
                        break;
                    }
                    message.meta = meta_1.Meta.decode(reader, reader.uint32());
                    continue;
                }
                case 3: {
                    if (tag !== 26) {
                        break;
                    }
                    message.postcode = reader.string();
                    continue;
                }
                case 4: {
                    if (tag !== 34) {
                        break;
                    }
                    message.country_id = reader.string();
                    continue;
                }
                case 6: {
                    if (tag !== 50) {
                        break;
                    }
                    message.locality = reader.string();
                    continue;
                }
                case 7: {
                    if (tag !== 58) {
                        break;
                    }
                    message.street = reader.string();
                    continue;
                }
                case 8: {
                    if (tag !== 66) {
                        break;
                    }
                    message.region = reader.string();
                    continue;
                }
                case 9: {
                    if (tag !== 74) {
                        break;
                    }
                    message.geo_coordinates = exports.GeoPoint.decode(reader, reader.uint32());
                    continue;
                }
                case 10: {
                    if (tag !== 81) {
                        break;
                    }
                    message.altitude = reader.double();
                    continue;
                }
                case 11: {
                    if (tag !== 90) {
                        break;
                    }
                    message.building_number = reader.string();
                    continue;
                }
                case 12: {
                    if (tag !== 98) {
                        break;
                    }
                    message.address_addition = exports.AddressAddition.decode(reader, reader.uint32());
                    continue;
                }
                case 13: {
                    if (tag !== 106) {
                        break;
                    }
                    message.business_address = exports.BusinessAddress.decode(reader, reader.uint32());
                    continue;
                }
                case 14: {
                    if (tag !== 114) {
                        break;
                    }
                    message.residential_address = exports.ResidentialAddress.decode(reader, reader.uint32());
                    continue;
                }
                case 15: {
                    if (tag !== 122) {
                        break;
                    }
                    message.pack_station = exports.PackStation.decode(reader, reader.uint32());
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            id: isSet(object.id) ? globalThis.String(object.id) : undefined,
            meta: isSet(object.meta) ? meta_1.Meta.fromJSON(object.meta) : undefined,
            postcode: isSet(object.postcode) ? globalThis.String(object.postcode) : undefined,
            country_id: isSet(object.countryId)
                ? globalThis.String(object.countryId)
                : isSet(object.country_id)
                    ? globalThis.String(object.country_id)
                    : undefined,
            locality: isSet(object.locality) ? globalThis.String(object.locality) : undefined,
            street: isSet(object.street) ? globalThis.String(object.street) : undefined,
            region: isSet(object.region) ? globalThis.String(object.region) : undefined,
            geo_coordinates: isSet(object.geoCoordinates)
                ? exports.GeoPoint.fromJSON(object.geoCoordinates)
                : isSet(object.geo_coordinates)
                    ? exports.GeoPoint.fromJSON(object.geo_coordinates)
                    : undefined,
            altitude: isSet(object.altitude) ? globalThis.Number(object.altitude) : undefined,
            building_number: isSet(object.buildingNumber)
                ? globalThis.String(object.buildingNumber)
                : isSet(object.building_number)
                    ? globalThis.String(object.building_number)
                    : undefined,
            address_addition: isSet(object.addressAddition)
                ? exports.AddressAddition.fromJSON(object.addressAddition)
                : isSet(object.address_addition)
                    ? exports.AddressAddition.fromJSON(object.address_addition)
                    : undefined,
            business_address: isSet(object.businessAddress)
                ? exports.BusinessAddress.fromJSON(object.businessAddress)
                : isSet(object.business_address)
                    ? exports.BusinessAddress.fromJSON(object.business_address)
                    : undefined,
            residential_address: isSet(object.residentialAddress)
                ? exports.ResidentialAddress.fromJSON(object.residentialAddress)
                : isSet(object.residential_address)
                    ? exports.ResidentialAddress.fromJSON(object.residential_address)
                    : undefined,
            pack_station: isSet(object.packStation)
                ? exports.PackStation.fromJSON(object.packStation)
                : isSet(object.pack_station)
                    ? exports.PackStation.fromJSON(object.pack_station)
                    : undefined,
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.id !== undefined) {
            obj.id = message.id;
        }
        if (message.meta !== undefined) {
            obj.meta = meta_1.Meta.toJSON(message.meta);
        }
        if (message.postcode !== undefined) {
            obj.postcode = message.postcode;
        }
        if (message.country_id !== undefined) {
            obj.countryId = message.country_id;
        }
        if (message.locality !== undefined) {
            obj.locality = message.locality;
        }
        if (message.street !== undefined) {
            obj.street = message.street;
        }
        if (message.region !== undefined) {
            obj.region = message.region;
        }
        if (message.geo_coordinates !== undefined) {
            obj.geoCoordinates = exports.GeoPoint.toJSON(message.geo_coordinates);
        }
        if (message.altitude !== undefined) {
            obj.altitude = message.altitude;
        }
        if (message.building_number !== undefined) {
            obj.buildingNumber = message.building_number;
        }
        if (message.address_addition !== undefined) {
            obj.addressAddition = exports.AddressAddition.toJSON(message.address_addition);
        }
        if (message.business_address !== undefined) {
            obj.businessAddress = exports.BusinessAddress.toJSON(message.business_address);
        }
        if (message.residential_address !== undefined) {
            obj.residentialAddress = exports.ResidentialAddress.toJSON(message.residential_address);
        }
        if (message.pack_station !== undefined) {
            obj.packStation = exports.PackStation.toJSON(message.pack_station);
        }
        return obj;
    },
    create(base) {
        return exports.Address.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseAddress();
        message.id = object.id ?? undefined;
        message.meta = (object.meta !== undefined && object.meta !== null) ? meta_1.Meta.fromPartial(object.meta) : undefined;
        message.postcode = object.postcode ?? undefined;
        message.country_id = object.country_id ?? undefined;
        message.locality = object.locality ?? undefined;
        message.street = object.street ?? undefined;
        message.region = object.region ?? undefined;
        message.geo_coordinates = (object.geo_coordinates !== undefined && object.geo_coordinates !== null)
            ? exports.GeoPoint.fromPartial(object.geo_coordinates)
            : undefined;
        message.altitude = object.altitude ?? undefined;
        message.building_number = object.building_number ?? undefined;
        message.address_addition = (object.address_addition !== undefined && object.address_addition !== null)
            ? exports.AddressAddition.fromPartial(object.address_addition)
            : undefined;
        message.business_address = (object.business_address !== undefined && object.business_address !== null)
            ? exports.BusinessAddress.fromPartial(object.business_address)
            : undefined;
        message.residential_address = (object.residential_address !== undefined && object.residential_address !== null)
            ? exports.ResidentialAddress.fromPartial(object.residential_address)
            : undefined;
        message.pack_station = (object.pack_station !== undefined && object.pack_station !== null)
            ? exports.PackStation.fromPartial(object.pack_station)
            : undefined;
        return message;
    },
};
function createBaseContact() {
    return {};
}
exports.Contact = {
    encode(message, writer = new wire_1.BinaryWriter()) {
        if (message.name !== undefined) {
            writer.uint32(10).string(message.name);
        }
        if (message.email !== undefined) {
            writer.uint32(18).string(message.email);
        }
        if (message.phone !== undefined) {
            writer.uint32(26).string(message.phone);
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
        const end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseContact();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.name = reader.string();
                    continue;
                }
                case 2: {
                    if (tag !== 18) {
                        break;
                    }
                    message.email = reader.string();
                    continue;
                }
                case 3: {
                    if (tag !== 26) {
                        break;
                    }
                    message.phone = reader.string();
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            name: isSet(object.name) ? globalThis.String(object.name) : undefined,
            email: isSet(object.email) ? globalThis.String(object.email) : undefined,
            phone: isSet(object.phone) ? globalThis.String(object.phone) : undefined,
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.name !== undefined) {
            obj.name = message.name;
        }
        if (message.email !== undefined) {
            obj.email = message.email;
        }
        if (message.phone !== undefined) {
            obj.phone = message.phone;
        }
        return obj;
    },
    create(base) {
        return exports.Contact.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseContact();
        message.name = object.name ?? undefined;
        message.email = object.email ?? undefined;
        message.phone = object.phone ?? undefined;
        return message;
    },
};
function createBaseShippingAddress() {
    return {};
}
exports.ShippingAddress = {
    encode(message, writer = new wire_1.BinaryWriter()) {
        if (message.address !== undefined) {
            exports.Address.encode(message.address, writer.uint32(10).fork()).join();
        }
        if (message.contact !== undefined) {
            exports.Contact.encode(message.contact, writer.uint32(18).fork()).join();
        }
        if (message.comments !== undefined) {
            writer.uint32(26).string(message.comments);
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
        const end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseShippingAddress();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.address = exports.Address.decode(reader, reader.uint32());
                    continue;
                }
                case 2: {
                    if (tag !== 18) {
                        break;
                    }
                    message.contact = exports.Contact.decode(reader, reader.uint32());
                    continue;
                }
                case 3: {
                    if (tag !== 26) {
                        break;
                    }
                    message.comments = reader.string();
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            address: isSet(object.address) ? exports.Address.fromJSON(object.address) : undefined,
            contact: isSet(object.contact) ? exports.Contact.fromJSON(object.contact) : undefined,
            comments: isSet(object.comments) ? globalThis.String(object.comments) : undefined,
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.address !== undefined) {
            obj.address = exports.Address.toJSON(message.address);
        }
        if (message.contact !== undefined) {
            obj.contact = exports.Contact.toJSON(message.contact);
        }
        if (message.comments !== undefined) {
            obj.comments = message.comments;
        }
        return obj;
    },
    create(base) {
        return exports.ShippingAddress.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseShippingAddress();
        message.address = (object.address !== undefined && object.address !== null)
            ? exports.Address.fromPartial(object.address)
            : undefined;
        message.contact = (object.contact !== undefined && object.contact !== null)
            ? exports.Contact.fromPartial(object.contact)
            : undefined;
        message.comments = object.comments ?? undefined;
        return message;
    },
};
function createBaseBillingAddress() {
    return {};
}
exports.BillingAddress = {
    encode(message, writer = new wire_1.BinaryWriter()) {
        if (message.address !== undefined) {
            exports.Address.encode(message.address, writer.uint32(10).fork()).join();
        }
        if (message.contact !== undefined) {
            exports.Contact.encode(message.contact, writer.uint32(18).fork()).join();
        }
        if (message.comments !== undefined) {
            writer.uint32(26).string(message.comments);
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
        const end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseBillingAddress();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.address = exports.Address.decode(reader, reader.uint32());
                    continue;
                }
                case 2: {
                    if (tag !== 18) {
                        break;
                    }
                    message.contact = exports.Contact.decode(reader, reader.uint32());
                    continue;
                }
                case 3: {
                    if (tag !== 26) {
                        break;
                    }
                    message.comments = reader.string();
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            address: isSet(object.address) ? exports.Address.fromJSON(object.address) : undefined,
            contact: isSet(object.contact) ? exports.Contact.fromJSON(object.contact) : undefined,
            comments: isSet(object.comments) ? globalThis.String(object.comments) : undefined,
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.address !== undefined) {
            obj.address = exports.Address.toJSON(message.address);
        }
        if (message.contact !== undefined) {
            obj.contact = exports.Contact.toJSON(message.contact);
        }
        if (message.comments !== undefined) {
            obj.comments = message.comments;
        }
        return obj;
    },
    create(base) {
        return exports.BillingAddress.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseBillingAddress();
        message.address = (object.address !== undefined && object.address !== null)
            ? exports.Address.fromPartial(object.address)
            : undefined;
        message.contact = (object.contact !== undefined && object.contact !== null)
            ? exports.Contact.fromPartial(object.contact)
            : undefined;
        message.comments = object.comments ?? undefined;
        return message;
    },
};
exports.AddressServiceDefinition = {
    name: "AddressService",
    fullName: "io.restorecommerce.address.AddressService",
    methods: {
        read: {
            name: "Read",
            requestType: resource_base_1.ReadRequest,
            requestStream: false,
            responseType: exports.AddressListResponse,
            responseStream: false,
            options: { _unknownFields: { 248008: [Buffer.from([1])] } },
        },
        create: {
            name: "Create",
            requestType: exports.AddressList,
            requestStream: false,
            responseType: exports.AddressListResponse,
            responseStream: false,
            options: {},
        },
        delete: {
            name: "Delete",
            requestType: resource_base_1.DeleteRequest,
            requestStream: false,
            responseType: resource_base_1.DeleteResponse,
            responseStream: false,
            options: {},
        },
        update: {
            name: "Update",
            requestType: exports.AddressList,
            requestStream: false,
            responseType: exports.AddressListResponse,
            responseStream: false,
            options: {},
        },
        upsert: {
            name: "Upsert",
            requestType: exports.AddressList,
            requestStream: false,
            responseType: exports.AddressListResponse,
            responseStream: false,
            options: {},
        },
    },
};
exports.protoMetadata = {
    fileDescriptor: {
        "name": "io/restorecommerce/address.proto",
        "package": "io.restorecommerce.address",
        "dependency": [
            "io/restorecommerce/resource_base.proto",
            "io/restorecommerce/meta.proto",
            "io/restorecommerce/auth.proto",
            "io/restorecommerce/status.proto",
            "io/restorecommerce/options.proto",
            "io/restorecommerce/country.proto",
        ],
        "publicDependency": [],
        "weakDependency": [],
        "optionDependency": [],
        "messageType": [{
                "name": "Deleted",
                "field": [{
                        "name": "id",
                        "number": 1,
                        "label": 1,
                        "type": 9,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 0,
                        "jsonName": "id",
                        "options": undefined,
                        "proto3Optional": true,
                    }],
                "extension": [],
                "nestedType": [],
                "enumType": [],
                "extensionRange": [],
                "oneofDecl": [{ "name": "_id", "options": undefined }],
                "options": undefined,
                "reservedRange": [],
                "reservedName": [],
                "visibility": 0,
            }, {
                "name": "AddressList",
                "field": [{
                        "name": "items",
                        "number": 1,
                        "label": 3,
                        "type": 11,
                        "typeName": ".io.restorecommerce.address.Address",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 0,
                        "jsonName": "items",
                        "options": undefined,
                        "proto3Optional": false,
                    }, {
                        "name": "total_count",
                        "number": 2,
                        "label": 1,
                        "type": 13,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 0,
                        "jsonName": "totalCount",
                        "options": undefined,
                        "proto3Optional": true,
                    }, {
                        "name": "subject",
                        "number": 3,
                        "label": 1,
                        "type": 11,
                        "typeName": ".io.restorecommerce.auth.Subject",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 1,
                        "jsonName": "subject",
                        "options": undefined,
                        "proto3Optional": true,
                    }],
                "extension": [],
                "nestedType": [],
                "enumType": [],
                "extensionRange": [],
                "oneofDecl": [{ "name": "_total_count", "options": undefined }, { "name": "_subject", "options": undefined }],
                "options": undefined,
                "reservedRange": [],
                "reservedName": [],
                "visibility": 0,
            }, {
                "name": "AddressListResponse",
                "field": [{
                        "name": "items",
                        "number": 1,
                        "label": 3,
                        "type": 11,
                        "typeName": ".io.restorecommerce.address.AddressResponse",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 0,
                        "jsonName": "items",
                        "options": undefined,
                        "proto3Optional": false,
                    }, {
                        "name": "total_count",
                        "number": 2,
                        "label": 1,
                        "type": 13,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 0,
                        "jsonName": "totalCount",
                        "options": undefined,
                        "proto3Optional": true,
                    }, {
                        "name": "operation_status",
                        "number": 3,
                        "label": 1,
                        "type": 11,
                        "typeName": ".io.restorecommerce.status.OperationStatus",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 1,
                        "jsonName": "operationStatus",
                        "options": undefined,
                        "proto3Optional": true,
                    }],
                "extension": [],
                "nestedType": [],
                "enumType": [],
                "extensionRange": [],
                "oneofDecl": [{ "name": "_total_count", "options": undefined }, {
                        "name": "_operation_status",
                        "options": undefined,
                    }],
                "options": undefined,
                "reservedRange": [],
                "reservedName": [],
                "visibility": 0,
            }, {
                "name": "AddressResponse",
                "field": [{
                        "name": "payload",
                        "number": 1,
                        "label": 1,
                        "type": 11,
                        "typeName": ".io.restorecommerce.address.Address",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 0,
                        "jsonName": "payload",
                        "options": undefined,
                        "proto3Optional": true,
                    }, {
                        "name": "status",
                        "number": 2,
                        "label": 1,
                        "type": 11,
                        "typeName": ".io.restorecommerce.status.Status",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 1,
                        "jsonName": "status",
                        "options": undefined,
                        "proto3Optional": true,
                    }],
                "extension": [],
                "nestedType": [],
                "enumType": [],
                "extensionRange": [],
                "oneofDecl": [{ "name": "_payload", "options": undefined }, { "name": "_status", "options": undefined }],
                "options": undefined,
                "reservedRange": [],
                "reservedName": [],
                "visibility": 0,
            }, {
                "name": "GeoPoint",
                "field": [{
                        "name": "latitude",
                        "number": 1,
                        "label": 1,
                        "type": 1,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 0,
                        "jsonName": "latitude",
                        "options": undefined,
                        "proto3Optional": true,
                    }, {
                        "name": "longitude",
                        "number": 2,
                        "label": 1,
                        "type": 1,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 1,
                        "jsonName": "longitude",
                        "options": undefined,
                        "proto3Optional": true,
                    }],
                "extension": [],
                "nestedType": [],
                "enumType": [],
                "extensionRange": [],
                "oneofDecl": [{ "name": "_latitude", "options": undefined }, { "name": "_longitude", "options": undefined }],
                "options": undefined,
                "reservedRange": [],
                "reservedName": [],
                "visibility": 0,
            }, {
                "name": "AddressAddition",
                "field": [{
                        "name": "field1",
                        "number": 1,
                        "label": 1,
                        "type": 9,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 0,
                        "jsonName": "field1",
                        "options": undefined,
                        "proto3Optional": true,
                    }, {
                        "name": "field2",
                        "number": 2,
                        "label": 1,
                        "type": 9,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 1,
                        "jsonName": "field2",
                        "options": undefined,
                        "proto3Optional": true,
                    }],
                "extension": [],
                "nestedType": [],
                "enumType": [],
                "extensionRange": [],
                "oneofDecl": [{ "name": "_field1", "options": undefined }, { "name": "_field2", "options": undefined }],
                "options": undefined,
                "reservedRange": [],
                "reservedName": [],
                "visibility": 0,
            }, {
                "name": "BusinessAddress",
                "field": [{
                        "name": "name",
                        "number": 1,
                        "label": 1,
                        "type": 9,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 0,
                        "jsonName": "name",
                        "options": undefined,
                        "proto3Optional": true,
                    }],
                "extension": [],
                "nestedType": [],
                "enumType": [],
                "extensionRange": [],
                "oneofDecl": [{ "name": "_name", "options": undefined }],
                "options": undefined,
                "reservedRange": [],
                "reservedName": [],
                "visibility": 0,
            }, {
                "name": "ResidentialAddress",
                "field": [{
                        "name": "title",
                        "number": 1,
                        "label": 1,
                        "type": 9,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 0,
                        "jsonName": "title",
                        "options": undefined,
                        "proto3Optional": true,
                    }, {
                        "name": "given_name",
                        "number": 2,
                        "label": 1,
                        "type": 9,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 1,
                        "jsonName": "givenName",
                        "options": undefined,
                        "proto3Optional": true,
                    }, {
                        "name": "mid_name",
                        "number": 3,
                        "label": 1,
                        "type": 9,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 2,
                        "jsonName": "midName",
                        "options": undefined,
                        "proto3Optional": true,
                    }, {
                        "name": "family_name",
                        "number": 4,
                        "label": 1,
                        "type": 9,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 3,
                        "jsonName": "familyName",
                        "options": undefined,
                        "proto3Optional": true,
                    }],
                "extension": [],
                "nestedType": [],
                "enumType": [],
                "extensionRange": [],
                "oneofDecl": [{ "name": "_title", "options": undefined }, { "name": "_given_name", "options": undefined }, {
                        "name": "_mid_name",
                        "options": undefined,
                    }, { "name": "_family_name", "options": undefined }],
                "options": undefined,
                "reservedRange": [],
                "reservedName": [],
                "visibility": 0,
            }, {
                "name": "PackStation",
                "field": [{
                        "name": "provider",
                        "number": 1,
                        "label": 1,
                        "type": 9,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 0,
                        "jsonName": "provider",
                        "options": undefined,
                        "proto3Optional": true,
                    }, {
                        "name": "station_number",
                        "number": 2,
                        "label": 1,
                        "type": 9,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 1,
                        "jsonName": "stationNumber",
                        "options": undefined,
                        "proto3Optional": true,
                    }, {
                        "name": "post_number",
                        "number": 3,
                        "label": 1,
                        "type": 9,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 2,
                        "jsonName": "postNumber",
                        "options": undefined,
                        "proto3Optional": true,
                    }],
                "extension": [],
                "nestedType": [],
                "enumType": [],
                "extensionRange": [],
                "oneofDecl": [
                    { "name": "_provider", "options": undefined },
                    { "name": "_station_number", "options": undefined },
                    { "name": "_post_number", "options": undefined },
                ],
                "options": undefined,
                "reservedRange": [],
                "reservedName": [],
                "visibility": 0,
            }, {
                "name": "Address",
                "field": [{
                        "name": "id",
                        "number": 1,
                        "label": 1,
                        "type": 9,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 1,
                        "jsonName": "id",
                        "options": undefined,
                        "proto3Optional": true,
                    }, {
                        "name": "meta",
                        "number": 2,
                        "label": 1,
                        "type": 11,
                        "typeName": ".io.restorecommerce.meta.Meta",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 2,
                        "jsonName": "meta",
                        "options": undefined,
                        "proto3Optional": true,
                    }, {
                        "name": "postcode",
                        "number": 3,
                        "label": 1,
                        "type": 9,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 3,
                        "jsonName": "postcode",
                        "options": undefined,
                        "proto3Optional": true,
                    }, {
                        "name": "country_id",
                        "number": 4,
                        "label": 1,
                        "type": 9,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 4,
                        "jsonName": "countryId",
                        "options": {
                            "ctype": 0,
                            "packed": false,
                            "jstype": 0,
                            "lazy": false,
                            "unverifiedLazy": false,
                            "deprecated": false,
                            "weak": false,
                            "debugRedact": false,
                            "retention": 0,
                            "targets": [],
                            "editionDefaults": [],
                            "features": undefined,
                            "featureSupport": undefined,
                            "uninterpretedOption": [],
                        },
                        "proto3Optional": true,
                    }, {
                        "name": "locality",
                        "number": 6,
                        "label": 1,
                        "type": 9,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 5,
                        "jsonName": "locality",
                        "options": undefined,
                        "proto3Optional": true,
                    }, {
                        "name": "street",
                        "number": 7,
                        "label": 1,
                        "type": 9,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 6,
                        "jsonName": "street",
                        "options": undefined,
                        "proto3Optional": true,
                    }, {
                        "name": "region",
                        "number": 8,
                        "label": 1,
                        "type": 9,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 7,
                        "jsonName": "region",
                        "options": undefined,
                        "proto3Optional": true,
                    }, {
                        "name": "geo_coordinates",
                        "number": 9,
                        "label": 1,
                        "type": 11,
                        "typeName": ".io.restorecommerce.address.GeoPoint",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 8,
                        "jsonName": "geoCoordinates",
                        "options": undefined,
                        "proto3Optional": true,
                    }, {
                        "name": "altitude",
                        "number": 10,
                        "label": 1,
                        "type": 1,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 9,
                        "jsonName": "altitude",
                        "options": undefined,
                        "proto3Optional": true,
                    }, {
                        "name": "building_number",
                        "number": 11,
                        "label": 1,
                        "type": 9,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 10,
                        "jsonName": "buildingNumber",
                        "options": undefined,
                        "proto3Optional": true,
                    }, {
                        "name": "address_addition",
                        "number": 12,
                        "label": 1,
                        "type": 11,
                        "typeName": ".io.restorecommerce.address.AddressAddition",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 11,
                        "jsonName": "addressAddition",
                        "options": undefined,
                        "proto3Optional": true,
                    }, {
                        "name": "business_address",
                        "number": 13,
                        "label": 1,
                        "type": 11,
                        "typeName": ".io.restorecommerce.address.BusinessAddress",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 0,
                        "jsonName": "businessAddress",
                        "options": undefined,
                        "proto3Optional": false,
                    }, {
                        "name": "residential_address",
                        "number": 14,
                        "label": 1,
                        "type": 11,
                        "typeName": ".io.restorecommerce.address.ResidentialAddress",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 0,
                        "jsonName": "residentialAddress",
                        "options": undefined,
                        "proto3Optional": false,
                    }, {
                        "name": "pack_station",
                        "number": 15,
                        "label": 1,
                        "type": 11,
                        "typeName": ".io.restorecommerce.address.PackStation",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 0,
                        "jsonName": "packStation",
                        "options": undefined,
                        "proto3Optional": false,
                    }],
                "extension": [],
                "nestedType": [],
                "enumType": [],
                "extensionRange": [],
                "oneofDecl": [
                    { "name": "type", "options": undefined },
                    { "name": "_id", "options": undefined },
                    { "name": "_meta", "options": undefined },
                    { "name": "_postcode", "options": undefined },
                    { "name": "_country_id", "options": undefined },
                    { "name": "_locality", "options": undefined },
                    { "name": "_street", "options": undefined },
                    { "name": "_region", "options": undefined },
                    { "name": "_geo_coordinates", "options": undefined },
                    { "name": "_altitude", "options": undefined },
                    { "name": "_building_number", "options": undefined },
                    { "name": "_address_addition", "options": undefined },
                ],
                "options": undefined,
                "reservedRange": [],
                "reservedName": [],
                "visibility": 0,
            }, {
                "name": "Contact",
                "field": [{
                        "name": "name",
                        "number": 1,
                        "label": 1,
                        "type": 9,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 0,
                        "jsonName": "name",
                        "options": undefined,
                        "proto3Optional": true,
                    }, {
                        "name": "email",
                        "number": 2,
                        "label": 1,
                        "type": 9,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 1,
                        "jsonName": "email",
                        "options": undefined,
                        "proto3Optional": true,
                    }, {
                        "name": "phone",
                        "number": 3,
                        "label": 1,
                        "type": 9,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 2,
                        "jsonName": "phone",
                        "options": undefined,
                        "proto3Optional": true,
                    }],
                "extension": [],
                "nestedType": [],
                "enumType": [],
                "extensionRange": [],
                "oneofDecl": [{ "name": "_name", "options": undefined }, { "name": "_email", "options": undefined }, {
                        "name": "_phone",
                        "options": undefined,
                    }],
                "options": undefined,
                "reservedRange": [],
                "reservedName": [],
                "visibility": 0,
            }, {
                "name": "ShippingAddress",
                "field": [{
                        "name": "address",
                        "number": 1,
                        "label": 1,
                        "type": 11,
                        "typeName": ".io.restorecommerce.address.Address",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 0,
                        "jsonName": "address",
                        "options": undefined,
                        "proto3Optional": true,
                    }, {
                        "name": "contact",
                        "number": 2,
                        "label": 1,
                        "type": 11,
                        "typeName": ".io.restorecommerce.address.Contact",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 1,
                        "jsonName": "contact",
                        "options": undefined,
                        "proto3Optional": true,
                    }, {
                        "name": "comments",
                        "number": 3,
                        "label": 1,
                        "type": 9,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 2,
                        "jsonName": "comments",
                        "options": undefined,
                        "proto3Optional": true,
                    }],
                "extension": [],
                "nestedType": [],
                "enumType": [],
                "extensionRange": [],
                "oneofDecl": [{ "name": "_address", "options": undefined }, { "name": "_contact", "options": undefined }, {
                        "name": "_comments",
                        "options": undefined,
                    }],
                "options": undefined,
                "reservedRange": [],
                "reservedName": [],
                "visibility": 0,
            }, {
                "name": "BillingAddress",
                "field": [{
                        "name": "address",
                        "number": 1,
                        "label": 1,
                        "type": 11,
                        "typeName": ".io.restorecommerce.address.Address",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 0,
                        "jsonName": "address",
                        "options": undefined,
                        "proto3Optional": true,
                    }, {
                        "name": "contact",
                        "number": 2,
                        "label": 1,
                        "type": 11,
                        "typeName": ".io.restorecommerce.address.Contact",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 1,
                        "jsonName": "contact",
                        "options": undefined,
                        "proto3Optional": true,
                    }, {
                        "name": "comments",
                        "number": 3,
                        "label": 1,
                        "type": 9,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 2,
                        "jsonName": "comments",
                        "options": undefined,
                        "proto3Optional": true,
                    }],
                "extension": [],
                "nestedType": [],
                "enumType": [],
                "extensionRange": [],
                "oneofDecl": [{ "name": "_address", "options": undefined }, { "name": "_contact", "options": undefined }, {
                        "name": "_comments",
                        "options": undefined,
                    }],
                "options": undefined,
                "reservedRange": [],
                "reservedName": [],
                "visibility": 0,
            }],
        "enumType": [],
        "service": [{
                "name": "AddressService",
                "method": [{
                        "name": "Read",
                        "inputType": ".io.restorecommerce.resourcebase.ReadRequest",
                        "outputType": ".io.restorecommerce.address.AddressListResponse",
                        "options": { "deprecated": false, "idempotencyLevel": 0, "features": undefined, "uninterpretedOption": [] },
                        "clientStreaming": false,
                        "serverStreaming": false,
                    }, {
                        "name": "Create",
                        "inputType": ".io.restorecommerce.address.AddressList",
                        "outputType": ".io.restorecommerce.address.AddressListResponse",
                        "options": undefined,
                        "clientStreaming": false,
                        "serverStreaming": false,
                    }, {
                        "name": "Delete",
                        "inputType": ".io.restorecommerce.resourcebase.DeleteRequest",
                        "outputType": ".io.restorecommerce.resourcebase.DeleteResponse",
                        "options": undefined,
                        "clientStreaming": false,
                        "serverStreaming": false,
                    }, {
                        "name": "Update",
                        "inputType": ".io.restorecommerce.address.AddressList",
                        "outputType": ".io.restorecommerce.address.AddressListResponse",
                        "options": undefined,
                        "clientStreaming": false,
                        "serverStreaming": false,
                    }, {
                        "name": "Upsert",
                        "inputType": ".io.restorecommerce.address.AddressList",
                        "outputType": ".io.restorecommerce.address.AddressListResponse",
                        "options": undefined,
                        "clientStreaming": false,
                        "serverStreaming": false,
                    }],
                "options": undefined,
            }],
        "extension": [],
        "options": undefined,
        "sourceCodeInfo": {
            "location": [{
                    "path": [3, 5],
                    "span": [11, 0, 42],
                    "leadingComments": " Used by resolvers\n",
                    "trailingComments": "",
                    "leadingDetachedComments": [],
                }, {
                    "path": [6, 0],
                    "span": [16, 0, 24, 1],
                    "leadingComments": "\n Microservice definition.\n",
                    "trailingComments": "",
                    "leadingDetachedComments": [],
                }],
        },
        "syntax": "proto3",
        "edition": 0,
    },
    references: {
        ".io.restorecommerce.address.Deleted": exports.Deleted,
        ".io.restorecommerce.address.AddressList": exports.AddressList,
        ".io.restorecommerce.address.AddressListResponse": exports.AddressListResponse,
        ".io.restorecommerce.address.AddressResponse": exports.AddressResponse,
        ".io.restorecommerce.address.GeoPoint": exports.GeoPoint,
        ".io.restorecommerce.address.AddressAddition": exports.AddressAddition,
        ".io.restorecommerce.address.BusinessAddress": exports.BusinessAddress,
        ".io.restorecommerce.address.ResidentialAddress": exports.ResidentialAddress,
        ".io.restorecommerce.address.PackStation": exports.PackStation,
        ".io.restorecommerce.address.Address": exports.Address,
        ".io.restorecommerce.address.Contact": exports.Contact,
        ".io.restorecommerce.address.ShippingAddress": exports.ShippingAddress,
        ".io.restorecommerce.address.BillingAddress": exports.BillingAddress,
    },
    dependencies: [resource_base_1.protoMetadata, meta_1.protoMetadata, auth_1.protoMetadata, status_1.protoMetadata, options_1.protoMetadata, country_1.protoMetadata],
    options: {
        messages: {
            "Address": {
                fields: {
                    "country_id": {
                        "resolver": options_1.Resolver.decode(Buffer.from("CiMuaW8ucmVzdG9yZWNvbW1lcmNlLmNvdW50cnkuQ291bnRyeRILbWFzdGVyX2RhdGEaB2NvdW50cnkiBFJlYWQqB2NvdW50cnk=", "base64")),
                    },
                },
            },
        },
        services: { "AddressService": { methods: { "Read": { "is_query": true } } } },
    },
};
function isSet(value) {
    return value !== null && value !== undefined;
}
//# sourceMappingURL=address.js.map