forked from github/copilot-sdk-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPingResponse.java
More file actions
89 lines (77 loc) · 2.21 KB
/
PingResponse.java
File metadata and controls
89 lines (77 loc) · 2.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
*--------------------------------------------------------------------------------------------*/
package com.github.copilot.sdk.json;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* Response from a ping request to the Copilot CLI server.
* <p>
* The ping response confirms connectivity and provides information about the
* server, including the protocol version.
*
* @see com.github.copilot.sdk.CopilotClient#ping(String)
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
public class PingResponse {
@JsonProperty("message")
private String message;
@JsonProperty("timestamp")
private long timestamp;
@JsonProperty("protocolVersion")
private Integer protocolVersion;
/**
* Gets the echo message from the server.
*
* @return the message echoed back by the server
*/
public String getMessage() {
return message;
}
/**
* Sets the message.
*
* @param message
* the message
*/
public void setMessage(String message) {
this.message = message;
}
/**
* Gets the server timestamp.
*
* @return the timestamp in milliseconds since epoch
*/
public long getTimestamp() {
return timestamp;
}
/**
* Sets the timestamp.
*
* @param timestamp
* the timestamp
*/
public void setTimestamp(long timestamp) {
this.timestamp = timestamp;
}
/**
* Gets the SDK protocol version supported by the server.
* <p>
* The SDK validates that this version matches the expected version to ensure
* compatibility.
*
* @return the protocol version, or {@code null} if not reported
*/
public Integer getProtocolVersion() {
return protocolVersion;
}
/**
* Sets the protocol version.
*
* @param protocolVersion
* the protocol version
*/
public void setProtocolVersion(Integer protocolVersion) {
this.protocolVersion = protocolVersion;
}
}