"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/authentication_log.proto
Object.defineProperty(exports, "__esModule", { value: true });
exports.protoMetadata = exports.AuthenticationLogServiceDefinition = exports.Deleted = exports.AuthenticationLog = exports.AuthenticationLogResponse = exports.AuthenticationLogListResponse = exports.AuthenticationLogList = exports.protobufPackage = void 0;
/* eslint-disable */
const wire_1 = require("@bufbuild/protobuf/wire");
const timestamp_1 = require("../../google/protobuf/timestamp");
const auth_1 = require("./auth");
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.authentication_log";
function createBaseAuthenticationLogList() {
    return {};
}
exports.AuthenticationLogList = {
    encode(message, writer = new wire_1.BinaryWriter()) {
        if (message.items !== undefined && message.items.length !== 0) {
            for (const v of message.items) {
                exports.AuthenticationLog.encode(v, writer.uint32(10).fork()).join();
            }
        }
        if (message.totalCount !== undefined) {
            writer.uint32(16).uint32(message.totalCount);
        }
        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 = createBaseAuthenticationLogList();
        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.AuthenticationLog.decode(reader, reader.uint32());
                    if (el !== undefined) {
                        message.items.push(el);
                    }
                    continue;
                }
                case 2: {
                    if (tag !== 16) {
                        break;
                    }
                    message.totalCount = 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.AuthenticationLog.fromJSON(e))
                : undefined,
            totalCount: 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.AuthenticationLog.toJSON(e));
        }
        if (message.totalCount !== undefined) {
            obj.totalCount = Math.round(message.totalCount);
        }
        if (message.subject !== undefined) {
            obj.subject = auth_1.Subject.toJSON(message.subject);
        }
        return obj;
    },
    create(base) {
        return exports.AuthenticationLogList.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseAuthenticationLogList();
        message.items = object.items?.map((e) => exports.AuthenticationLog.fromPartial(e)) || undefined;
        message.totalCount = object.totalCount ?? undefined;
        message.subject = (object.subject !== undefined && object.subject !== null)
            ? auth_1.Subject.fromPartial(object.subject)
            : undefined;
        return message;
    },
};
function createBaseAuthenticationLogListResponse() {
    return {};
}
exports.AuthenticationLogListResponse = {
    encode(message, writer = new wire_1.BinaryWriter()) {
        if (message.items !== undefined && message.items.length !== 0) {
            for (const v of message.items) {
                exports.AuthenticationLogResponse.encode(v, writer.uint32(10).fork()).join();
            }
        }
        if (message.totalCount !== undefined) {
            writer.uint32(16).uint32(message.totalCount);
        }
        if (message.operationStatus !== undefined) {
            status_1.OperationStatus.encode(message.operationStatus, 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 = createBaseAuthenticationLogListResponse();
        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.AuthenticationLogResponse.decode(reader, reader.uint32());
                    if (el !== undefined) {
                        message.items.push(el);
                    }
                    continue;
                }
                case 2: {
                    if (tag !== 16) {
                        break;
                    }
                    message.totalCount = reader.uint32();
                    continue;
                }
                case 3: {
                    if (tag !== 26) {
                        break;
                    }
                    message.operationStatus = 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.AuthenticationLogResponse.fromJSON(e))
                : undefined,
            totalCount: isSet(object.totalCount)
                ? globalThis.Number(object.totalCount)
                : isSet(object.total_count)
                    ? globalThis.Number(object.total_count)
                    : undefined,
            operationStatus: 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.AuthenticationLogResponse.toJSON(e));
        }
        if (message.totalCount !== undefined) {
            obj.totalCount = Math.round(message.totalCount);
        }
        if (message.operationStatus !== undefined) {
            obj.operationStatus = status_1.OperationStatus.toJSON(message.operationStatus);
        }
        return obj;
    },
    create(base) {
        return exports.AuthenticationLogListResponse.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseAuthenticationLogListResponse();
        message.items = object.items?.map((e) => exports.AuthenticationLogResponse.fromPartial(e)) || undefined;
        message.totalCount = object.totalCount ?? undefined;
        message.operationStatus = (object.operationStatus !== undefined && object.operationStatus !== null)
            ? status_1.OperationStatus.fromPartial(object.operationStatus)
            : undefined;
        return message;
    },
};
function createBaseAuthenticationLogResponse() {
    return {};
}
exports.AuthenticationLogResponse = {
    encode(message, writer = new wire_1.BinaryWriter()) {
        if (message.payload !== undefined) {
            exports.AuthenticationLog.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 = createBaseAuthenticationLogResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.payload = exports.AuthenticationLog.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.AuthenticationLog.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.AuthenticationLog.toJSON(message.payload);
        }
        if (message.status !== undefined) {
            obj.status = status_1.Status.toJSON(message.status);
        }
        return obj;
    },
    create(base) {
        return exports.AuthenticationLogResponse.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseAuthenticationLogResponse();
        message.payload = (object.payload !== undefined && object.payload !== null)
            ? exports.AuthenticationLog.fromPartial(object.payload)
            : undefined;
        message.status = (object.status !== undefined && object.status !== null)
            ? status_1.Status.fromPartial(object.status)
            : undefined;
        return message;
    },
};
function createBaseAuthenticationLog() {
    return {};
}
exports.AuthenticationLog = {
    encode(message, writer = new wire_1.BinaryWriter()) {
        if (message.id !== undefined) {
            writer.uint32(10).string(message.id);
        }
        if (message.ipv4Address !== undefined) {
            writer.uint32(18).string(message.ipv4Address);
        }
        if (message.ipv6Address !== undefined) {
            writer.uint32(26).string(message.ipv6Address);
        }
        if (message.operatingSystem !== undefined) {
            writer.uint32(34).string(message.operatingSystem);
        }
        if (message.userAgent !== undefined) {
            writer.uint32(42).string(message.userAgent);
        }
        if (message.date !== undefined) {
            timestamp_1.Timestamp.encode(toTimestamp(message.date), writer.uint32(50).fork()).join();
        }
        if (message.activity !== undefined) {
            writer.uint32(58).string(message.activity);
        }
        if (message.meta !== undefined) {
            meta_1.Meta.encode(message.meta, writer.uint32(66).fork()).join();
        }
        if (message.subjectId !== undefined) {
            writer.uint32(74).string(message.subjectId);
        }
        if (message.tokenName !== undefined) {
            writer.uint32(82).string(message.tokenName);
        }
        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 = createBaseAuthenticationLog();
        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.ipv4Address = reader.string();
                    continue;
                }
                case 3: {
                    if (tag !== 26) {
                        break;
                    }
                    message.ipv6Address = reader.string();
                    continue;
                }
                case 4: {
                    if (tag !== 34) {
                        break;
                    }
                    message.operatingSystem = reader.string();
                    continue;
                }
                case 5: {
                    if (tag !== 42) {
                        break;
                    }
                    message.userAgent = reader.string();
                    continue;
                }
                case 6: {
                    if (tag !== 50) {
                        break;
                    }
                    message.date = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));
                    continue;
                }
                case 7: {
                    if (tag !== 58) {
                        break;
                    }
                    message.activity = reader.string();
                    continue;
                }
                case 8: {
                    if (tag !== 66) {
                        break;
                    }
                    message.meta = meta_1.Meta.decode(reader, reader.uint32());
                    continue;
                }
                case 9: {
                    if (tag !== 74) {
                        break;
                    }
                    message.subjectId = reader.string();
                    continue;
                }
                case 10: {
                    if (tag !== 82) {
                        break;
                    }
                    message.tokenName = 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,
            ipv4Address: isSet(object.ipv4Address)
                ? globalThis.String(object.ipv4Address)
                : isSet(object.ipv4_address)
                    ? globalThis.String(object.ipv4_address)
                    : undefined,
            ipv6Address: isSet(object.ipv6Address)
                ? globalThis.String(object.ipv6Address)
                : isSet(object.ipv6_address)
                    ? globalThis.String(object.ipv6_address)
                    : undefined,
            operatingSystem: isSet(object.operatingSystem)
                ? globalThis.String(object.operatingSystem)
                : isSet(object.operating_system)
                    ? globalThis.String(object.operating_system)
                    : undefined,
            userAgent: isSet(object.userAgent)
                ? globalThis.String(object.userAgent)
                : isSet(object.user_agent)
                    ? globalThis.String(object.user_agent)
                    : undefined,
            date: isSet(object.date) ? fromJsonTimestamp(object.date) : undefined,
            activity: isSet(object.activity) ? globalThis.String(object.activity) : undefined,
            meta: isSet(object.meta) ? meta_1.Meta.fromJSON(object.meta) : undefined,
            subjectId: isSet(object.subjectId)
                ? globalThis.String(object.subjectId)
                : isSet(object.subject_id)
                    ? globalThis.String(object.subject_id)
                    : undefined,
            tokenName: isSet(object.tokenName)
                ? globalThis.String(object.tokenName)
                : isSet(object.token_name)
                    ? globalThis.String(object.token_name)
                    : undefined,
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.id !== undefined) {
            obj.id = message.id;
        }
        if (message.ipv4Address !== undefined) {
            obj.ipv4Address = message.ipv4Address;
        }
        if (message.ipv6Address !== undefined) {
            obj.ipv6Address = message.ipv6Address;
        }
        if (message.operatingSystem !== undefined) {
            obj.operatingSystem = message.operatingSystem;
        }
        if (message.userAgent !== undefined) {
            obj.userAgent = message.userAgent;
        }
        if (message.date !== undefined) {
            obj.date = message.date.toISOString();
        }
        if (message.activity !== undefined) {
            obj.activity = message.activity;
        }
        if (message.meta !== undefined) {
            obj.meta = meta_1.Meta.toJSON(message.meta);
        }
        if (message.subjectId !== undefined) {
            obj.subjectId = message.subjectId;
        }
        if (message.tokenName !== undefined) {
            obj.tokenName = message.tokenName;
        }
        return obj;
    },
    create(base) {
        return exports.AuthenticationLog.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseAuthenticationLog();
        message.id = object.id ?? undefined;
        message.ipv4Address = object.ipv4Address ?? undefined;
        message.ipv6Address = object.ipv6Address ?? undefined;
        message.operatingSystem = object.operatingSystem ?? undefined;
        message.userAgent = object.userAgent ?? undefined;
        message.date = object.date ?? undefined;
        message.activity = object.activity ?? undefined;
        message.meta = (object.meta !== undefined && object.meta !== null) ? meta_1.Meta.fromPartial(object.meta) : undefined;
        message.subjectId = object.subjectId ?? undefined;
        message.tokenName = object.tokenName ?? undefined;
        return message;
    },
};
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;
    },
};
exports.AuthenticationLogServiceDefinition = {
    name: "AuthenticationLogService",
    fullName: "io.restorecommerce.authentication_log.AuthenticationLogService",
    methods: {
        read: {
            name: "Read",
            requestType: resource_base_1.ReadRequest,
            requestStream: false,
            responseType: exports.AuthenticationLogListResponse,
            responseStream: false,
            options: { _unknownFields: { 248008: [Buffer.from([1])] } },
        },
        create: {
            name: "Create",
            requestType: exports.AuthenticationLogList,
            requestStream: false,
            responseType: exports.AuthenticationLogListResponse,
            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.AuthenticationLogList,
            requestStream: false,
            responseType: exports.AuthenticationLogListResponse,
            responseStream: false,
            options: {},
        },
        upsert: {
            name: "Upsert",
            requestType: exports.AuthenticationLogList,
            requestStream: false,
            responseType: exports.AuthenticationLogListResponse,
            responseStream: false,
            options: {},
        },
    },
};
exports.protoMetadata = {
    fileDescriptor: {
        "name": "io/restorecommerce/authentication_log.proto",
        "package": "io.restorecommerce.authentication_log",
        "dependency": [
            "google/protobuf/timestamp.proto",
            "io/restorecommerce/resource_base.proto",
            "io/restorecommerce/meta.proto",
            "io/restorecommerce/auth.proto",
            "io/restorecommerce/status.proto",
            "io/restorecommerce/options.proto",
        ],
        "publicDependency": [],
        "weakDependency": [],
        "optionDependency": [],
        "messageType": [{
                "name": "AuthenticationLogList",
                "field": [{
                        "name": "items",
                        "number": 1,
                        "label": 3,
                        "type": 11,
                        "typeName": ".io.restorecommerce.authentication_log.AuthenticationLog",
                        "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": "AuthenticationLogListResponse",
                "field": [{
                        "name": "items",
                        "number": 1,
                        "label": 3,
                        "type": 11,
                        "typeName": ".io.restorecommerce.authentication_log.AuthenticationLogResponse",
                        "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": "AuthenticationLogResponse",
                "field": [{
                        "name": "payload",
                        "number": 1,
                        "label": 1,
                        "type": 11,
                        "typeName": ".io.restorecommerce.authentication_log.AuthenticationLog",
                        "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": "AuthenticationLog",
                "field": [{
                        "name": "id",
                        "number": 1,
                        "label": 1,
                        "type": 9,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 0,
                        "jsonName": "id",
                        "options": undefined,
                        "proto3Optional": true,
                    }, {
                        "name": "ipv4_address",
                        "number": 2,
                        "label": 1,
                        "type": 9,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 1,
                        "jsonName": "ipv4Address",
                        "options": undefined,
                        "proto3Optional": true,
                    }, {
                        "name": "ipv6_address",
                        "number": 3,
                        "label": 1,
                        "type": 9,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 2,
                        "jsonName": "ipv6Address",
                        "options": undefined,
                        "proto3Optional": true,
                    }, {
                        "name": "operating_system",
                        "number": 4,
                        "label": 1,
                        "type": 9,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 3,
                        "jsonName": "operatingSystem",
                        "options": undefined,
                        "proto3Optional": true,
                    }, {
                        "name": "user_agent",
                        "number": 5,
                        "label": 1,
                        "type": 9,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 4,
                        "jsonName": "userAgent",
                        "options": undefined,
                        "proto3Optional": true,
                    }, {
                        "name": "date",
                        "number": 6,
                        "label": 1,
                        "type": 11,
                        "typeName": ".google.protobuf.Timestamp",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 5,
                        "jsonName": "date",
                        "options": undefined,
                        "proto3Optional": true,
                    }, {
                        "name": "activity",
                        "number": 7,
                        "label": 1,
                        "type": 9,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 6,
                        "jsonName": "activity",
                        "options": undefined,
                        "proto3Optional": true,
                    }, {
                        "name": "meta",
                        "number": 8,
                        "label": 1,
                        "type": 11,
                        "typeName": ".io.restorecommerce.meta.Meta",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 7,
                        "jsonName": "meta",
                        "options": undefined,
                        "proto3Optional": true,
                    }, {
                        "name": "subject_id",
                        "number": 9,
                        "label": 1,
                        "type": 9,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 8,
                        "jsonName": "subjectId",
                        "options": undefined,
                        "proto3Optional": true,
                    }, {
                        "name": "token_name",
                        "number": 10,
                        "label": 1,
                        "type": 9,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 9,
                        "jsonName": "tokenName",
                        "options": undefined,
                        "proto3Optional": true,
                    }],
                "extension": [],
                "nestedType": [],
                "enumType": [],
                "extensionRange": [],
                "oneofDecl": [
                    { "name": "_id", "options": undefined },
                    { "name": "_ipv4_address", "options": undefined },
                    { "name": "_ipv6_address", "options": undefined },
                    { "name": "_operating_system", "options": undefined },
                    { "name": "_user_agent", "options": undefined },
                    { "name": "_date", "options": undefined },
                    { "name": "_activity", "options": undefined },
                    { "name": "_meta", "options": undefined },
                    { "name": "_subject_id", "options": undefined },
                    { "name": "_token_name", "options": undefined },
                ],
                "options": undefined,
                "reservedRange": [],
                "reservedName": [],
                "visibility": 0,
            }, {
                "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,
            }],
        "enumType": [],
        "service": [{
                "name": "AuthenticationLogService",
                "method": [{
                        "name": "Read",
                        "inputType": ".io.restorecommerce.resourcebase.ReadRequest",
                        "outputType": ".io.restorecommerce.authentication_log.AuthenticationLogListResponse",
                        "options": { "deprecated": false, "idempotencyLevel": 0, "features": undefined, "uninterpretedOption": [] },
                        "clientStreaming": false,
                        "serverStreaming": false,
                    }, {
                        "name": "Create",
                        "inputType": ".io.restorecommerce.authentication_log.AuthenticationLogList",
                        "outputType": ".io.restorecommerce.authentication_log.AuthenticationLogListResponse",
                        "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.authentication_log.AuthenticationLogList",
                        "outputType": ".io.restorecommerce.authentication_log.AuthenticationLogListResponse",
                        "options": undefined,
                        "clientStreaming": false,
                        "serverStreaming": false,
                    }, {
                        "name": "Upsert",
                        "inputType": ".io.restorecommerce.authentication_log.AuthenticationLogList",
                        "outputType": ".io.restorecommerce.authentication_log.AuthenticationLogListResponse",
                        "options": undefined,
                        "clientStreaming": false,
                        "serverStreaming": false,
                    }],
                "options": undefined,
            }],
        "extension": [],
        "options": undefined,
        "sourceCodeInfo": {
            "location": [{
                    "path": [6, 0],
                    "span": [14, 0, 22, 1],
                    "leadingComments": "\n Microservice definition.\n",
                    "trailingComments": "",
                    "leadingDetachedComments": [],
                }, {
                    "path": [4, 3],
                    "span": [44, 0, 55, 1],
                    "leadingComments": "*\n Authentication Log\n",
                    "trailingComments": "",
                    "leadingDetachedComments": [],
                }, {
                    "path": [4, 3, 2, 0],
                    "span": [45, 2, 25],
                    "leadingComments": "",
                    "trailingComments": " log id\n",
                    "leadingDetachedComments": [],
                }, {
                    "path": [4, 3, 2, 5],
                    "span": [50, 2, 46],
                    "leadingComments": "",
                    "trailingComments": " time stamp of login, logout or token update\n",
                    "leadingDetachedComments": [],
                }, {
                    "path": [4, 3, 2, 6],
                    "span": [51, 2, 31],
                    "leadingComments": "",
                    "trailingComments": " login, logout\n",
                    "leadingDetachedComments": [],
                }, {
                    "path": [4, 3, 2, 7],
                    "span": [52, 2, 49],
                    "leadingComments": "",
                    "trailingComments": " meta info\n",
                    "leadingDetachedComments": [],
                }, {
                    "path": [4, 3, 2, 8],
                    "span": [53, 2, 33],
                    "leadingComments": "",
                    "trailingComments": " subject id\n",
                    "leadingDetachedComments": [],
                }, {
                    "path": [4, 3, 2, 9],
                    "span": [54, 2, 34],
                    "leadingComments": "",
                    "trailingComments": " token name associated with io.restorecommerce.auth.Token.token_name\n",
                    "leadingDetachedComments": [],
                }],
        },
        "syntax": "proto3",
        "edition": 0,
    },
    references: {
        ".io.restorecommerce.authentication_log.AuthenticationLogList": exports.AuthenticationLogList,
        ".io.restorecommerce.authentication_log.AuthenticationLogListResponse": exports.AuthenticationLogListResponse,
        ".io.restorecommerce.authentication_log.AuthenticationLogResponse": exports.AuthenticationLogResponse,
        ".io.restorecommerce.authentication_log.AuthenticationLog": exports.AuthenticationLog,
        ".io.restorecommerce.authentication_log.Deleted": exports.Deleted,
    },
    dependencies: [timestamp_1.protoMetadata, resource_base_1.protoMetadata, meta_1.protoMetadata, auth_1.protoMetadata, status_1.protoMetadata, options_1.protoMetadata],
    options: { services: { "AuthenticationLogService": { methods: { "Read": { "is_query": true } } } } },
};
function toTimestamp(date) {
    const seconds = Math.trunc(date.getTime() / 1_000);
    const nanos = (date.getTime() % 1_000) * 1_000_000;
    return { seconds, nanos };
}
function fromTimestamp(t) {
    let millis = (t.seconds || 0) * 1_000;
    millis += (t.nanos || 0) / 1_000_000;
    return new globalThis.Date(millis);
}
function fromJsonTimestamp(o) {
    if (o instanceof globalThis.Date) {
        return o;
    }
    else if (typeof o === "string") {
        return new globalThis.Date(o);
    }
    else {
        return fromTimestamp(timestamp_1.Timestamp.fromJSON(o));
    }
}
function isSet(value) {
    return value !== null && value !== undefined;
}
//# sourceMappingURL=authentication_log.js.map