Instantly share code, notes, and snippets.
works-tabei/Gnox.Shared.Models.cs Secret
Created
February 7, 2026 09:21
-
Star
0
(0)
You must be signed in to star a gist -
Fork
0
(0)
You must be signed in to fork a gist
-
-
Save works-tabei/122c835f25e81de612bcd9f965cf3bd5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Collections.Generic; | |
| using System.Text.Json.Serialization; | |
| namespace Gnox.Shared.Models | |
| { | |
| // ======================================================================== | |
| // 1. 共通基底クラス | |
| // ======================================================================== | |
| /// <summary> | |
| /// Gnox連携イベントの共通基底クラス | |
| /// すべてのイベント通知 (JSON) はこのクラスのフィールドを含みます。 | |
| /// </summary> | |
| public class GnoxBaseMessage | |
| { | |
| /// <summary>メッセージ種別ID (例: 1001, 3001, 8001)</summary> | |
| [JsonPropertyName("msgId")] | |
| public int MsgId { get; set; } | |
| /// <summary>組織コード</summary> | |
| [JsonPropertyName("siteCd")] | |
| public string SiteCd { get; set; } | |
| /// <summary>サイト認証キー</summary> | |
| [JsonPropertyName("siteKey")] | |
| public string SiteKey { get; set; } | |
| /// <summary>イベント連番 (順序制御用)</summary> | |
| [JsonPropertyName("eventSeq")] | |
| public long? EventSeq { get; set; } | |
| /// <summary>イベント発生日時 (YYYYMMDDHHMMSS)</summary> | |
| [JsonPropertyName("eventTime")] | |
| public string EventTime { get; set; } | |
| /// <summary>呼の一意識別子 (CRN) / トランザクションID</summary> | |
| [JsonPropertyName("crn")] | |
| public string Crn { get; set; } | |
| /// <summary>案件番号 (RefNo)</summary> | |
| [JsonPropertyName("refNo")] | |
| public string RefNo { get; set; } | |
| } | |
| // ======================================================================== | |
| // 2. 通話関連イベント (1001, 1002, 2001, 3001, 3002, 3003) | |
| // ======================================================================== | |
| /// <summary> | |
| /// 通話ライフサイクルイベント用モデル | |
| /// 対象: 入電(1001), 転送(1002), 架電(2001), 呼出(3001), 確立(3002), 終了(3003) | |
| /// </summary> | |
| public class CallEvent : GnoxBaseMessage | |
| { | |
| // --- 共通通話情報 --- | |
| /// <summary>通話方向 (1:受電, 2:架電)</summary> | |
| [JsonPropertyName("callDirection")] | |
| public string CallDirection { get; set; } | |
| /// <summary>通話種別 (inbound, manual, internal 等)</summary> | |
| [JsonPropertyName("callTp")] | |
| public string CallTp { get; set; } | |
| /// <summary>相手先電話番号</summary> | |
| [JsonPropertyName("userTel")] | |
| public string UserTel { get; set; } | |
| /// <summary>センター着信番号 (入電時のみ)</summary> | |
| [JsonPropertyName("centerTel")] | |
| public string CenterTel { get; set; } | |
| /// <summary>センター着信番号名称</summary> | |
| [JsonPropertyName("centerTelNm")] | |
| public string CenterTelNm { get; set; } | |
| /// <summary>エージェントID</summary> | |
| [JsonPropertyName("agentId")] | |
| public string AgentId { get; set; } | |
| /// <summary>内線番号</summary> | |
| [JsonPropertyName("extNo")] | |
| public string ExtNo { get; set; } | |
| /// <summary>スキルコード</summary> | |
| [JsonPropertyName("skillCd")] | |
| public string SkillCd { get; set; } | |
| /// <summary>スキル名称</summary> | |
| [JsonPropertyName("skillNm")] | |
| public string SkillNm { get; set; } | |
| // --- 転送時 (1002) --- | |
| [JsonPropertyName("transferFromAgentId")] | |
| public string TransferFromAgentId { get; set; } | |
| [JsonPropertyName("transferFromExt")] | |
| public string TransferFromExt { get; set; } | |
| // --- 架電時 (2001) --- | |
| [JsonPropertyName("callerId")] | |
| public string CallerId { get; set; } | |
| // --- 時間情報 --- | |
| /// <summary>通話開始日時 (YYYYMMDDHHMMSS)</summary> | |
| [JsonPropertyName("callStartTime")] | |
| public string CallStartTime { get; set; } | |
| /// <summary>通話終了日時 (3003のみ)</summary> | |
| [JsonPropertyName("callEndTime")] | |
| public string CallEndTime { get; set; } | |
| // --- 結果・集計 (3003のみ) --- | |
| /// <summary>通話秒数</summary> | |
| [JsonPropertyName("callDuration")] | |
| public int? CallDuration { get; set; } | |
| /// <summary>保留回数</summary> | |
| [JsonPropertyName("holdCount")] | |
| public int? HoldCount { get; set; } | |
| /// <summary>保留合計時間(秒)</summary> | |
| [JsonPropertyName("holdDuration")] | |
| public int? HoldDuration { get; set; } | |
| /// <summary>通話結果 (success, failure, cancelled, error)</summary> | |
| [JsonPropertyName("callResult")] | |
| public string CallResult { get; set; } | |
| /// <summary>通話結果詳細</summary> | |
| [JsonPropertyName("callResultDetail")] | |
| public string CallResultDetail { get; set; } | |
| } | |
| // ======================================================================== | |
| // 3. 録音・要約関連イベント (3004) | |
| // ======================================================================== | |
| /// <summary> | |
| /// 録音・要約完了通知用モデル (3004) | |
| /// </summary> | |
| public class RecordingEvent : GnoxBaseMessage | |
| { | |
| [JsonPropertyName("userTel")] | |
| public string UserTel { get; set; } | |
| [JsonPropertyName("callDirection")] | |
| public string CallDirection { get; set; } | |
| /// <summary>録音ファイルURLリスト</summary> | |
| [JsonPropertyName("recordingUrl")] | |
| public List<string> RecordingUrl { get; set; } | |
| /// <summary>AI要約タイトル</summary> | |
| [JsonPropertyName("callSummaryTitle")] | |
| public string CallSummaryTitle { get; set; } | |
| /// <summary>AI要約本文リスト</summary> | |
| [JsonPropertyName("callSummary")] | |
| public List<string> CallSummary { get; set; } | |
| /// <summary>文字起こし詳細データ</summary> | |
| [JsonPropertyName("callTranscript")] | |
| public List<TranscriptItem> CallTranscript { get; set; } | |
| } | |
| /// <summary> | |
| /// 文字起こし詳細明細 (Transcript Object) | |
| /// </summary> | |
| public class TranscriptItem | |
| { | |
| /// <summary>話者区分 (0:Agent/System, 1:Customer)</summary> | |
| [JsonPropertyName("channel")] | |
| public int Channel { get; set; } | |
| /// <summary>開始秒</summary> | |
| [JsonPropertyName("start")] | |
| public double Start { get; set; } | |
| /// <summary>終了秒</summary> | |
| [JsonPropertyName("end")] | |
| public double End { get; set; } | |
| /// <summary>発話内容</summary> | |
| [JsonPropertyName("token")] | |
| public string Token { get; set; } | |
| } | |
| // ======================================================================== | |
| // 4. 支払関連イベント (4001) | |
| // ======================================================================== | |
| /// <summary> | |
| /// 支払完了通知用モデル (4001) | |
| /// </summary> | |
| public class PaymentEvent : GnoxBaseMessage | |
| { | |
| [JsonPropertyName("userTel")] | |
| public string UserTel { get; set; } | |
| [JsonPropertyName("paymentDate")] | |
| public string PaymentDate { get; set; } | |
| [JsonPropertyName("paymentTime")] | |
| public string PaymentTime { get; set; } | |
| [JsonPropertyName("paymentAmount")] | |
| public decimal? PaymentAmount { get; set; } | |
| [JsonPropertyName("paymentMethod")] | |
| public string PaymentMethod { get; set; } | |
| [JsonPropertyName("paymentStatus")] | |
| public string PaymentStatus { get; set; } | |
| [JsonPropertyName("transactionId")] | |
| public string TransactionId { get; set; } | |
| } | |
| // ======================================================================== | |
| // 5. SMS関連イベント (5001, 5002) | |
| // ======================================================================== | |
| /// <summary> | |
| /// SMS関連通知用モデル | |
| /// 対象: 送信結果(5001), 開封通知(5002) | |
| /// </summary> | |
| public class SmsEvent : GnoxBaseMessage | |
| { | |
| [JsonPropertyName("userTel")] | |
| public string UserTel { get; set; } | |
| // --- 送信結果 (5001) --- | |
| [JsonPropertyName("smsSentTime")] | |
| public string SmsSentTime { get; set; } | |
| [JsonPropertyName("smsStatus")] | |
| public string SmsStatus { get; set; } | |
| [JsonPropertyName("carrierResult")] | |
| public string CarrierResult { get; set; } | |
| // --- 開封・アクセス (5002) --- | |
| [JsonPropertyName("accessTime")] | |
| public string AccessTime { get; set; } | |
| [JsonPropertyName("accessCount")] | |
| public int? AccessCount { get; set; } | |
| [JsonPropertyName("loginAttemptCount")] | |
| public int? LoginAttemptCount { get; set; } | |
| [JsonPropertyName("loginSuccessCount")] | |
| public int? LoginSuccessCount { get; set; } | |
| [JsonPropertyName("lastLoginTime")] | |
| public string LastLoginTime { get; set; } | |
| } | |
| // ======================================================================== | |
| // 6. AI交渉関連イベント (6001) | |
| // ======================================================================== | |
| /// <summary> | |
| /// AI交渉結果通知用モデル (6001) | |
| /// </summary> | |
| public class AiNegotiationEvent : GnoxBaseMessage | |
| { | |
| [JsonPropertyName("userTel")] | |
| public string UserTel { get; set; } | |
| /// <summary>交渉結果 (promise, paid, call_back等)</summary> | |
| [JsonPropertyName("negotiationResult")] | |
| public string NegotiationResult { get; set; } | |
| /// <summary>約束日 (YYYYMMDD)</summary> | |
| [JsonPropertyName("promiseDate")] | |
| public string PromiseDate { get; set; } | |
| /// <summary>約束金額</summary> | |
| [JsonPropertyName("promiseAmount")] | |
| public decimal? PromiseAmount { get; set; } | |
| /// <summary>約束区分</summary> | |
| [JsonPropertyName("promiseType")] | |
| public string PromiseType { get; set; } | |
| } | |
| // ======================================================================== | |
| // 7. エージェント状態イベント (8001) | |
| // ======================================================================== | |
| /// <summary> | |
| /// エージェント状態通知用モデル (8001) | |
| /// </summary> | |
| public class AgentStatusEvent : GnoxBaseMessage | |
| { | |
| [JsonPropertyName("agentId")] | |
| public string AgentId { get; set; } | |
| [JsonPropertyName("extNo")] | |
| public string ExtNo { get; set; } | |
| /// <summary>プレゼンス (ready, not_ready, logout)</summary> | |
| [JsonPropertyName("presenceState")] | |
| public string PresenceState { get; set; } | |
| /// <summary>回線状態 (idle, ringing, talking, hold, acw)</summary> | |
| [JsonPropertyName("lineState")] | |
| public string LineState { get; set; } | |
| /// <summary>状態変更理由コード</summary> | |
| [JsonPropertyName("reason")] | |
| public string Reason { get; set; } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment