Skip to content

Commit cb716e9

Browse files
Using google protobuf timestamp and adding a struct for TokenPagination
1 parent 21a009e commit cb716e9

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

protobufs/livekit_models.proto

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ message Pagination {
2828
int32 limit = 2;
2929
}
3030

31+
message TokenPagination {
32+
string token = 1;
33+
}
34+
3135
// ListUpdate is used for updated APIs where 'repeated string' field is modified.
3236
message ListUpdate {
3337
repeated string set = 1; // set the field to a new list

protobufs/livekit_phone_number.proto

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ package livekit;
55
option go_package = "github.com/livekit/protocol/livekit";
66

77
import "google/protobuf/empty.proto";
8+
import "google/protobuf/timestamp.proto";
9+
import "livekit_models.proto";
810
import "livekit_sip.proto";
911

1012
// Telephony cost type enumeration
@@ -49,13 +51,13 @@ message ListPhoneNumberInventoryRequest {
4951
string country_code = 1; // Optional: Filter by country code (e.g., "US", "CA")
5052
string area_code = 2; // Optional: Filter by area code (e.g., "415")
5153
int32 limit = 3; // Optional: Maximum number of results (default: 50)
52-
string page_token = 4; // Optional: Token for pagination (empty for first page)
54+
TokenPagination page_token = 4; // Optional: Token for pagination (empty for first page)
5355
}
5456

5557
// ListPhoneNumberInventoryResponse - Response containing available phone numbers
5658
message ListPhoneNumberInventoryResponse {
5759
repeated PhoneNumberInventoryItem items = 1; // List of available phone numbers
58-
string next_page_token = 2; // Token for next page (empty if no more pages)
60+
TokenPagination next_page_token = 2; // Token for next page (empty if no more pages)
5961
}
6062

6163
// PurchasePhoneNumberRequest - Request to purchase phone numbers
@@ -71,13 +73,13 @@ message PurchasePhoneNumberResponse {
7173
// ListPurchasedPhoneNumbersRequest - Request to list purchased phone numbers
7274
message ListPurchasedPhoneNumbersRequest {
7375
int32 limit = 1; // Optional: Maximum number of results (default: 50)
74-
string page_token = 2; // Optional: Token for pagination (empty for first page)
76+
TokenPagination page_token = 2; // Optional: Token for pagination (empty for first page)
7577
}
7678

7779
// ListPurchasedPhoneNumbersResponse - Response containing purchased phone numbers
7880
message ListPurchasedPhoneNumbersResponse {
7981
repeated PurchasedPhoneNumber items = 1; // List of purchased phone numbers
80-
string next_page_token = 2; // Token for next page (empty if no more pages)
82+
TokenPagination next_page_token = 2; // Token for next page (empty if no more pages)
8183
int32 total_count = 3; // Total number of purchased phone numbers
8284
}
8385

@@ -96,8 +98,8 @@ message GlobalPhoneNumber {
9698
string locality = 6; // City/locality (e.g., "San Francisco")
9799
string region = 7; // State/region (e.g., "CA")
98100
int64 spam_score = 8; // can be used later for fraud detection
99-
int64 created_at = 9; // timestamp when created
100-
int64 updated_at = 10; // timestamp when updated
101+
google.protobuf.Timestamp created_at = 9; // timestamp when created
102+
google.protobuf.Timestamp updated_at = 10; // timestamp when updated
101103
}
102104

103105
// TelephonyCost represents the pricing structure for a specific telephony service
@@ -121,7 +123,7 @@ message PhoneNumberInventoryItem {
121123
message PurchasedPhoneNumber {
122124
GlobalPhoneNumber phone_number = 1; // Common phone number fields
123125
PhoneNumberStatus status = 2; // Current status of the phone number
124-
int64 assigned_at = 3; // Timestamp when the number was assigned
125-
int64 released_at = 4; // Timestamp when the number was released (if applicable)
126+
google.protobuf.Timestamp assigned_at = 3; // Timestamp when the number was assigned
127+
google.protobuf.Timestamp released_at = 4; // Timestamp when the number was released (if applicable)
126128
SIPDispatchRuleInfo sip_dispatch_rule = 5; // Optional: Associated SIP dispatch rule
127129
}

0 commit comments

Comments
 (0)