From 38b1229bf1ecef19de51092ed99f3502d1b51f7b Mon Sep 17 00:00:00 2001 From: Steve Yoon Date: Tue, 7 Apr 2026 13:10:38 -0400 Subject: [PATCH 1/8] add environment support for cloud-agents --- livekit/livekit_cloud_agent.pb.go | 3188 --------------------------- protobufs/livekit_cloud_agent.proto | 5 + 2 files changed, 5 insertions(+), 3188 deletions(-) delete mode 100644 livekit/livekit_cloud_agent.pb.go diff --git a/livekit/livekit_cloud_agent.pb.go b/livekit/livekit_cloud_agent.pb.go deleted file mode 100644 index 28f987916..000000000 --- a/livekit/livekit_cloud_agent.pb.go +++ /dev/null @@ -1,3188 +0,0 @@ -// Copyright 2023 LiveKit, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.11 -// protoc v4.23.4 -// source: livekit_cloud_agent.proto - -package livekit - -import ( - _ "github.com/livekit/protocol/livekit/logger" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - timestamppb "google.golang.org/protobuf/types/known/timestamppb" - reflect "reflect" - sync "sync" - unsafe "unsafe" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type AgentSecretKind int32 - -const ( - AgentSecretKind_AGENT_SECRET_KIND_UNKNOWN AgentSecretKind = 0 - AgentSecretKind_AGENT_SECRET_KIND_ENVIRONMENT AgentSecretKind = 1 - AgentSecretKind_AGENT_SECRET_KIND_FILE AgentSecretKind = 2 -) - -// Enum value maps for AgentSecretKind. -var ( - AgentSecretKind_name = map[int32]string{ - 0: "AGENT_SECRET_KIND_UNKNOWN", - 1: "AGENT_SECRET_KIND_ENVIRONMENT", - 2: "AGENT_SECRET_KIND_FILE", - } - AgentSecretKind_value = map[string]int32{ - "AGENT_SECRET_KIND_UNKNOWN": 0, - "AGENT_SECRET_KIND_ENVIRONMENT": 1, - "AGENT_SECRET_KIND_FILE": 2, - } -) - -func (x AgentSecretKind) Enum() *AgentSecretKind { - p := new(AgentSecretKind) - *p = x - return p -} - -func (x AgentSecretKind) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (AgentSecretKind) Descriptor() protoreflect.EnumDescriptor { - return file_livekit_cloud_agent_proto_enumTypes[0].Descriptor() -} - -func (AgentSecretKind) Type() protoreflect.EnumType { - return &file_livekit_cloud_agent_proto_enumTypes[0] -} - -func (x AgentSecretKind) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use AgentSecretKind.Descriptor instead. -func (AgentSecretKind) EnumDescriptor() ([]byte, []int) { - return file_livekit_cloud_agent_proto_rawDescGZIP(), []int{0} -} - -type AgentEventType int32 - -const ( - AgentEventType_AGENT_EVENT_TYPE_UNKNOWN AgentEventType = 0 - AgentEventType_AGENT_EVENT_TYPE_APPLICATION_CRASHED AgentEventType = 1 - AgentEventType_AGENT_EVENT_TYPE_RESTARTED_HIGH_DISK_USAGE AgentEventType = 2 - AgentEventType_AGENT_EVENT_TYPE_RESTARTED_HIGH_MEMORY_USAGE AgentEventType = 3 -) - -// Enum value maps for AgentEventType. -var ( - AgentEventType_name = map[int32]string{ - 0: "AGENT_EVENT_TYPE_UNKNOWN", - 1: "AGENT_EVENT_TYPE_APPLICATION_CRASHED", - 2: "AGENT_EVENT_TYPE_RESTARTED_HIGH_DISK_USAGE", - 3: "AGENT_EVENT_TYPE_RESTARTED_HIGH_MEMORY_USAGE", - } - AgentEventType_value = map[string]int32{ - "AGENT_EVENT_TYPE_UNKNOWN": 0, - "AGENT_EVENT_TYPE_APPLICATION_CRASHED": 1, - "AGENT_EVENT_TYPE_RESTARTED_HIGH_DISK_USAGE": 2, - "AGENT_EVENT_TYPE_RESTARTED_HIGH_MEMORY_USAGE": 3, - } -) - -func (x AgentEventType) Enum() *AgentEventType { - p := new(AgentEventType) - *p = x - return p -} - -func (x AgentEventType) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (AgentEventType) Descriptor() protoreflect.EnumDescriptor { - return file_livekit_cloud_agent_proto_enumTypes[1].Descriptor() -} - -func (AgentEventType) Type() protoreflect.EnumType { - return &file_livekit_cloud_agent_proto_enumTypes[1] -} - -func (x AgentEventType) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use AgentEventType.Descriptor instead. -func (AgentEventType) EnumDescriptor() ([]byte, []int) { - return file_livekit_cloud_agent_proto_rawDescGZIP(), []int{1} -} - -type PrivateLinkStatus_Status int32 - -const ( - PrivateLinkStatus_PRIVATE_LINK_STATUS_UNKNOWN PrivateLinkStatus_Status = 0 - PrivateLinkStatus_PRIVATE_LINK_STATUS_PROVISIONING PrivateLinkStatus_Status = 1 - PrivateLinkStatus_PRIVATE_LINK_STATUS_PENDING_APPROVAL PrivateLinkStatus_Status = 2 - PrivateLinkStatus_PRIVATE_LINK_STATUS_HEALTHY PrivateLinkStatus_Status = 3 - PrivateLinkStatus_PRIVATE_LINK_STATUS_UNHEALTHY PrivateLinkStatus_Status = 4 - PrivateLinkStatus_PRIVATE_LINK_STATUS_APPROVED PrivateLinkStatus_Status = 5 -) - -// Enum value maps for PrivateLinkStatus_Status. -var ( - PrivateLinkStatus_Status_name = map[int32]string{ - 0: "PRIVATE_LINK_STATUS_UNKNOWN", - 1: "PRIVATE_LINK_STATUS_PROVISIONING", - 2: "PRIVATE_LINK_STATUS_PENDING_APPROVAL", - 3: "PRIVATE_LINK_STATUS_HEALTHY", - 4: "PRIVATE_LINK_STATUS_UNHEALTHY", - 5: "PRIVATE_LINK_STATUS_APPROVED", - } - PrivateLinkStatus_Status_value = map[string]int32{ - "PRIVATE_LINK_STATUS_UNKNOWN": 0, - "PRIVATE_LINK_STATUS_PROVISIONING": 1, - "PRIVATE_LINK_STATUS_PENDING_APPROVAL": 2, - "PRIVATE_LINK_STATUS_HEALTHY": 3, - "PRIVATE_LINK_STATUS_UNHEALTHY": 4, - "PRIVATE_LINK_STATUS_APPROVED": 5, - } -) - -func (x PrivateLinkStatus_Status) Enum() *PrivateLinkStatus_Status { - p := new(PrivateLinkStatus_Status) - *p = x - return p -} - -func (x PrivateLinkStatus_Status) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (PrivateLinkStatus_Status) Descriptor() protoreflect.EnumDescriptor { - return file_livekit_cloud_agent_proto_enumTypes[2].Descriptor() -} - -func (PrivateLinkStatus_Status) Type() protoreflect.EnumType { - return &file_livekit_cloud_agent_proto_enumTypes[2] -} - -func (x PrivateLinkStatus_Status) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use PrivateLinkStatus_Status.Descriptor instead. -func (PrivateLinkStatus_Status) EnumDescriptor() ([]byte, []int) { - return file_livekit_cloud_agent_proto_rawDescGZIP(), []int{30, 0} -} - -type AgentEvent struct { - state protoimpl.MessageState `protogen:"open.v1"` - Type AgentEventType `protobuf:"varint,1,opt,name=type,proto3,enum=livekit.AgentEventType" json:"type,omitempty"` - Count int32 `protobuf:"varint,2,opt,name=count,proto3" json:"count,omitempty"` - Timestamp *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=timestamp,proto3" json:"timestamp,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *AgentEvent) Reset() { - *x = AgentEvent{} - mi := &file_livekit_cloud_agent_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *AgentEvent) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AgentEvent) ProtoMessage() {} - -func (x *AgentEvent) ProtoReflect() protoreflect.Message { - mi := &file_livekit_cloud_agent_proto_msgTypes[0] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use AgentEvent.ProtoReflect.Descriptor instead. -func (*AgentEvent) Descriptor() ([]byte, []int) { - return file_livekit_cloud_agent_proto_rawDescGZIP(), []int{0} -} - -func (x *AgentEvent) GetType() AgentEventType { - if x != nil { - return x.Type - } - return AgentEventType_AGENT_EVENT_TYPE_UNKNOWN -} - -func (x *AgentEvent) GetCount() int32 { - if x != nil { - return x.Count - } - return 0 -} - -func (x *AgentEvent) GetTimestamp() *timestamppb.Timestamp { - if x != nil { - return x.Timestamp - } - return nil -} - -type AgentSecret struct { - state protoimpl.MessageState `protogen:"open.v1"` - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` - CreatedAt *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` - UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` - Kind AgentSecretKind `protobuf:"varint,5,opt,name=kind,proto3,enum=livekit.AgentSecretKind" json:"kind,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *AgentSecret) Reset() { - *x = AgentSecret{} - mi := &file_livekit_cloud_agent_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *AgentSecret) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AgentSecret) ProtoMessage() {} - -func (x *AgentSecret) ProtoReflect() protoreflect.Message { - mi := &file_livekit_cloud_agent_proto_msgTypes[1] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use AgentSecret.ProtoReflect.Descriptor instead. -func (*AgentSecret) Descriptor() ([]byte, []int) { - return file_livekit_cloud_agent_proto_rawDescGZIP(), []int{1} -} - -func (x *AgentSecret) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *AgentSecret) GetValue() []byte { - if x != nil { - return x.Value - } - return nil -} - -func (x *AgentSecret) GetCreatedAt() *timestamppb.Timestamp { - if x != nil { - return x.CreatedAt - } - return nil -} - -func (x *AgentSecret) GetUpdatedAt() *timestamppb.Timestamp { - if x != nil { - return x.UpdatedAt - } - return nil -} - -func (x *AgentSecret) GetKind() AgentSecretKind { - if x != nil { - return x.Kind - } - return AgentSecretKind_AGENT_SECRET_KIND_UNKNOWN -} - -type CreateAgentRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Deprecated: Marked as deprecated in livekit_cloud_agent.proto. - AgentName string `protobuf:"bytes,1,opt,name=agent_name,json=agentName,proto3" json:"agent_name,omitempty"` - Secrets []*AgentSecret `protobuf:"bytes,2,rep,name=secrets,proto3" json:"secrets,omitempty"` - // Deprecated: Marked as deprecated in livekit_cloud_agent.proto. - Replicas int32 `protobuf:"varint,3,opt,name=replicas,proto3" json:"replicas,omitempty"` - // Deprecated: Marked as deprecated in livekit_cloud_agent.proto. - MaxReplicas int32 `protobuf:"varint,4,opt,name=max_replicas,json=maxReplicas,proto3" json:"max_replicas,omitempty"` - // Deprecated: Marked as deprecated in livekit_cloud_agent.proto. - CpuReq string `protobuf:"bytes,5,opt,name=cpu_req,json=cpuReq,proto3" json:"cpu_req,omitempty"` - Regions []string `protobuf:"bytes,6,rep,name=regions,proto3" json:"regions,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *CreateAgentRequest) Reset() { - *x = CreateAgentRequest{} - mi := &file_livekit_cloud_agent_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *CreateAgentRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateAgentRequest) ProtoMessage() {} - -func (x *CreateAgentRequest) ProtoReflect() protoreflect.Message { - mi := &file_livekit_cloud_agent_proto_msgTypes[2] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CreateAgentRequest.ProtoReflect.Descriptor instead. -func (*CreateAgentRequest) Descriptor() ([]byte, []int) { - return file_livekit_cloud_agent_proto_rawDescGZIP(), []int{2} -} - -// Deprecated: Marked as deprecated in livekit_cloud_agent.proto. -func (x *CreateAgentRequest) GetAgentName() string { - if x != nil { - return x.AgentName - } - return "" -} - -func (x *CreateAgentRequest) GetSecrets() []*AgentSecret { - if x != nil { - return x.Secrets - } - return nil -} - -// Deprecated: Marked as deprecated in livekit_cloud_agent.proto. -func (x *CreateAgentRequest) GetReplicas() int32 { - if x != nil { - return x.Replicas - } - return 0 -} - -// Deprecated: Marked as deprecated in livekit_cloud_agent.proto. -func (x *CreateAgentRequest) GetMaxReplicas() int32 { - if x != nil { - return x.MaxReplicas - } - return 0 -} - -// Deprecated: Marked as deprecated in livekit_cloud_agent.proto. -func (x *CreateAgentRequest) GetCpuReq() string { - if x != nil { - return x.CpuReq - } - return "" -} - -func (x *CreateAgentRequest) GetRegions() []string { - if x != nil { - return x.Regions - } - return nil -} - -type CreateAgentResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - AgentId string `protobuf:"bytes,1,opt,name=agent_id,json=agentId,proto3" json:"agent_id,omitempty"` - AgentName string `protobuf:"bytes,2,opt,name=agent_name,json=agentName,proto3" json:"agent_name,omitempty"` - Status string `protobuf:"bytes,3,opt,name=status,proto3" json:"status,omitempty"` - Version string `protobuf:"bytes,4,opt,name=version,proto3" json:"version,omitempty"` - PresignedUrl string `protobuf:"bytes,5,opt,name=presigned_url,json=presignedUrl,proto3" json:"presigned_url,omitempty"` - Tag string `protobuf:"bytes,6,opt,name=tag,proto3" json:"tag,omitempty"` - ServerRegions []string `protobuf:"bytes,7,rep,name=server_regions,json=serverRegions,proto3" json:"server_regions,omitempty"` - PresignedPostRequest *PresignedPostRequest `protobuf:"bytes,8,opt,name=presigned_post_request,json=presignedPostRequest,proto3" json:"presigned_post_request,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *CreateAgentResponse) Reset() { - *x = CreateAgentResponse{} - mi := &file_livekit_cloud_agent_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *CreateAgentResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateAgentResponse) ProtoMessage() {} - -func (x *CreateAgentResponse) ProtoReflect() protoreflect.Message { - mi := &file_livekit_cloud_agent_proto_msgTypes[3] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CreateAgentResponse.ProtoReflect.Descriptor instead. -func (*CreateAgentResponse) Descriptor() ([]byte, []int) { - return file_livekit_cloud_agent_proto_rawDescGZIP(), []int{3} -} - -func (x *CreateAgentResponse) GetAgentId() string { - if x != nil { - return x.AgentId - } - return "" -} - -func (x *CreateAgentResponse) GetAgentName() string { - if x != nil { - return x.AgentName - } - return "" -} - -func (x *CreateAgentResponse) GetStatus() string { - if x != nil { - return x.Status - } - return "" -} - -func (x *CreateAgentResponse) GetVersion() string { - if x != nil { - return x.Version - } - return "" -} - -func (x *CreateAgentResponse) GetPresignedUrl() string { - if x != nil { - return x.PresignedUrl - } - return "" -} - -func (x *CreateAgentResponse) GetTag() string { - if x != nil { - return x.Tag - } - return "" -} - -func (x *CreateAgentResponse) GetServerRegions() []string { - if x != nil { - return x.ServerRegions - } - return nil -} - -func (x *CreateAgentResponse) GetPresignedPostRequest() *PresignedPostRequest { - if x != nil { - return x.PresignedPostRequest - } - return nil -} - -type PresignedPostRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - Url string `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"` - Values map[string]string `protobuf:"bytes,2,rep,name=values,proto3" json:"values,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *PresignedPostRequest) Reset() { - *x = PresignedPostRequest{} - mi := &file_livekit_cloud_agent_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *PresignedPostRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PresignedPostRequest) ProtoMessage() {} - -func (x *PresignedPostRequest) ProtoReflect() protoreflect.Message { - mi := &file_livekit_cloud_agent_proto_msgTypes[4] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use PresignedPostRequest.ProtoReflect.Descriptor instead. -func (*PresignedPostRequest) Descriptor() ([]byte, []int) { - return file_livekit_cloud_agent_proto_rawDescGZIP(), []int{4} -} - -func (x *PresignedPostRequest) GetUrl() string { - if x != nil { - return x.Url - } - return "" -} - -func (x *PresignedPostRequest) GetValues() map[string]string { - if x != nil { - return x.Values - } - return nil -} - -type AgentDeployment struct { - state protoimpl.MessageState `protogen:"open.v1"` - Region string `protobuf:"bytes,1,opt,name=region,proto3" json:"region,omitempty"` - AgentId string `protobuf:"bytes,2,opt,name=agent_id,json=agentId,proto3" json:"agent_id,omitempty"` - Status string `protobuf:"bytes,3,opt,name=status,proto3" json:"status,omitempty"` - Replicas int32 `protobuf:"varint,4,opt,name=replicas,proto3" json:"replicas,omitempty"` - MinReplicas int32 `protobuf:"varint,5,opt,name=min_replicas,json=minReplicas,proto3" json:"min_replicas,omitempty"` - MaxReplicas int32 `protobuf:"varint,6,opt,name=max_replicas,json=maxReplicas,proto3" json:"max_replicas,omitempty"` - CpuReq string `protobuf:"bytes,7,opt,name=cpu_req,json=cpuReq,proto3" json:"cpu_req,omitempty"` - CurCpu string `protobuf:"bytes,8,opt,name=cur_cpu,json=curCpu,proto3" json:"cur_cpu,omitempty"` - CurMem string `protobuf:"bytes,9,opt,name=cur_mem,json=curMem,proto3" json:"cur_mem,omitempty"` - MemReq string `protobuf:"bytes,10,opt,name=mem_req,json=memReq,proto3" json:"mem_req,omitempty"` - MemLimit string `protobuf:"bytes,11,opt,name=mem_limit,json=memLimit,proto3" json:"mem_limit,omitempty"` - CpuLimit string `protobuf:"bytes,12,opt,name=cpu_limit,json=cpuLimit,proto3" json:"cpu_limit,omitempty"` - ServerRegion string `protobuf:"bytes,13,opt,name=server_region,json=serverRegion,proto3" json:"server_region,omitempty"` - Events []*AgentEvent `protobuf:"bytes,14,rep,name=events,proto3" json:"events,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *AgentDeployment) Reset() { - *x = AgentDeployment{} - mi := &file_livekit_cloud_agent_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *AgentDeployment) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AgentDeployment) ProtoMessage() {} - -func (x *AgentDeployment) ProtoReflect() protoreflect.Message { - mi := &file_livekit_cloud_agent_proto_msgTypes[5] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use AgentDeployment.ProtoReflect.Descriptor instead. -func (*AgentDeployment) Descriptor() ([]byte, []int) { - return file_livekit_cloud_agent_proto_rawDescGZIP(), []int{5} -} - -func (x *AgentDeployment) GetRegion() string { - if x != nil { - return x.Region - } - return "" -} - -func (x *AgentDeployment) GetAgentId() string { - if x != nil { - return x.AgentId - } - return "" -} - -func (x *AgentDeployment) GetStatus() string { - if x != nil { - return x.Status - } - return "" -} - -func (x *AgentDeployment) GetReplicas() int32 { - if x != nil { - return x.Replicas - } - return 0 -} - -func (x *AgentDeployment) GetMinReplicas() int32 { - if x != nil { - return x.MinReplicas - } - return 0 -} - -func (x *AgentDeployment) GetMaxReplicas() int32 { - if x != nil { - return x.MaxReplicas - } - return 0 -} - -func (x *AgentDeployment) GetCpuReq() string { - if x != nil { - return x.CpuReq - } - return "" -} - -func (x *AgentDeployment) GetCurCpu() string { - if x != nil { - return x.CurCpu - } - return "" -} - -func (x *AgentDeployment) GetCurMem() string { - if x != nil { - return x.CurMem - } - return "" -} - -func (x *AgentDeployment) GetMemReq() string { - if x != nil { - return x.MemReq - } - return "" -} - -func (x *AgentDeployment) GetMemLimit() string { - if x != nil { - return x.MemLimit - } - return "" -} - -func (x *AgentDeployment) GetCpuLimit() string { - if x != nil { - return x.CpuLimit - } - return "" -} - -func (x *AgentDeployment) GetServerRegion() string { - if x != nil { - return x.ServerRegion - } - return "" -} - -func (x *AgentDeployment) GetEvents() []*AgentEvent { - if x != nil { - return x.Events - } - return nil -} - -type AgentInfo struct { - state protoimpl.MessageState `protogen:"open.v1"` - AgentId string `protobuf:"bytes,1,opt,name=agent_id,json=agentId,proto3" json:"agent_id,omitempty"` - AgentName string `protobuf:"bytes,2,opt,name=agent_name,json=agentName,proto3" json:"agent_name,omitempty"` - Version string `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"` - AgentDeployments []*AgentDeployment `protobuf:"bytes,4,rep,name=agent_deployments,json=agentDeployments,proto3" json:"agent_deployments,omitempty"` - Secrets []*AgentSecret `protobuf:"bytes,5,rep,name=secrets,proto3" json:"secrets,omitempty"` - DeployedAt *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=deployed_at,json=deployedAt,proto3" json:"deployed_at,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *AgentInfo) Reset() { - *x = AgentInfo{} - mi := &file_livekit_cloud_agent_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *AgentInfo) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AgentInfo) ProtoMessage() {} - -func (x *AgentInfo) ProtoReflect() protoreflect.Message { - mi := &file_livekit_cloud_agent_proto_msgTypes[6] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use AgentInfo.ProtoReflect.Descriptor instead. -func (*AgentInfo) Descriptor() ([]byte, []int) { - return file_livekit_cloud_agent_proto_rawDescGZIP(), []int{6} -} - -func (x *AgentInfo) GetAgentId() string { - if x != nil { - return x.AgentId - } - return "" -} - -func (x *AgentInfo) GetAgentName() string { - if x != nil { - return x.AgentName - } - return "" -} - -func (x *AgentInfo) GetVersion() string { - if x != nil { - return x.Version - } - return "" -} - -func (x *AgentInfo) GetAgentDeployments() []*AgentDeployment { - if x != nil { - return x.AgentDeployments - } - return nil -} - -func (x *AgentInfo) GetSecrets() []*AgentSecret { - if x != nil { - return x.Secrets - } - return nil -} - -func (x *AgentInfo) GetDeployedAt() *timestamppb.Timestamp { - if x != nil { - return x.DeployedAt - } - return nil -} - -type ListAgentsRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - AgentName string `protobuf:"bytes,1,opt,name=agent_name,json=agentName,proto3" json:"agent_name,omitempty"` - AgentId string `protobuf:"bytes,2,opt,name=agent_id,json=agentId,proto3" json:"agent_id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ListAgentsRequest) Reset() { - *x = ListAgentsRequest{} - mi := &file_livekit_cloud_agent_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ListAgentsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListAgentsRequest) ProtoMessage() {} - -func (x *ListAgentsRequest) ProtoReflect() protoreflect.Message { - mi := &file_livekit_cloud_agent_proto_msgTypes[7] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListAgentsRequest.ProtoReflect.Descriptor instead. -func (*ListAgentsRequest) Descriptor() ([]byte, []int) { - return file_livekit_cloud_agent_proto_rawDescGZIP(), []int{7} -} - -func (x *ListAgentsRequest) GetAgentName() string { - if x != nil { - return x.AgentName - } - return "" -} - -func (x *ListAgentsRequest) GetAgentId() string { - if x != nil { - return x.AgentId - } - return "" -} - -type ListAgentsResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Agents []*AgentInfo `protobuf:"bytes,1,rep,name=agents,proto3" json:"agents,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ListAgentsResponse) Reset() { - *x = ListAgentsResponse{} - mi := &file_livekit_cloud_agent_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ListAgentsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListAgentsResponse) ProtoMessage() {} - -func (x *ListAgentsResponse) ProtoReflect() protoreflect.Message { - mi := &file_livekit_cloud_agent_proto_msgTypes[8] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListAgentsResponse.ProtoReflect.Descriptor instead. -func (*ListAgentsResponse) Descriptor() ([]byte, []int) { - return file_livekit_cloud_agent_proto_rawDescGZIP(), []int{8} -} - -func (x *ListAgentsResponse) GetAgents() []*AgentInfo { - if x != nil { - return x.Agents - } - return nil -} - -type AgentVersion struct { - state protoimpl.MessageState `protogen:"open.v1"` - Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` - Current bool `protobuf:"varint,2,opt,name=current,proto3" json:"current,omitempty"` - CreatedAt *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` - DeployedAt *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=deployed_at,json=deployedAt,proto3" json:"deployed_at,omitempty"` - Attributes map[string]string `protobuf:"bytes,5,rep,name=attributes,proto3" json:"attributes,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - Status string `protobuf:"bytes,6,opt,name=status,proto3" json:"status,omitempty"` - Owner string `protobuf:"bytes,7,opt,name=owner,proto3" json:"owner,omitempty"` - Draining bool `protobuf:"varint,8,opt,name=draining,proto3" json:"draining,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *AgentVersion) Reset() { - *x = AgentVersion{} - mi := &file_livekit_cloud_agent_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *AgentVersion) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AgentVersion) ProtoMessage() {} - -func (x *AgentVersion) ProtoReflect() protoreflect.Message { - mi := &file_livekit_cloud_agent_proto_msgTypes[9] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use AgentVersion.ProtoReflect.Descriptor instead. -func (*AgentVersion) Descriptor() ([]byte, []int) { - return file_livekit_cloud_agent_proto_rawDescGZIP(), []int{9} -} - -func (x *AgentVersion) GetVersion() string { - if x != nil { - return x.Version - } - return "" -} - -func (x *AgentVersion) GetCurrent() bool { - if x != nil { - return x.Current - } - return false -} - -func (x *AgentVersion) GetCreatedAt() *timestamppb.Timestamp { - if x != nil { - return x.CreatedAt - } - return nil -} - -func (x *AgentVersion) GetDeployedAt() *timestamppb.Timestamp { - if x != nil { - return x.DeployedAt - } - return nil -} - -func (x *AgentVersion) GetAttributes() map[string]string { - if x != nil { - return x.Attributes - } - return nil -} - -func (x *AgentVersion) GetStatus() string { - if x != nil { - return x.Status - } - return "" -} - -func (x *AgentVersion) GetOwner() string { - if x != nil { - return x.Owner - } - return "" -} - -func (x *AgentVersion) GetDraining() bool { - if x != nil { - return x.Draining - } - return false -} - -type ListAgentVersionsRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - AgentId string `protobuf:"bytes,1,opt,name=agent_id,json=agentId,proto3" json:"agent_id,omitempty"` - AgentName string `protobuf:"bytes,2,opt,name=agent_name,json=agentName,proto3" json:"agent_name,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ListAgentVersionsRequest) Reset() { - *x = ListAgentVersionsRequest{} - mi := &file_livekit_cloud_agent_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ListAgentVersionsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListAgentVersionsRequest) ProtoMessage() {} - -func (x *ListAgentVersionsRequest) ProtoReflect() protoreflect.Message { - mi := &file_livekit_cloud_agent_proto_msgTypes[10] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListAgentVersionsRequest.ProtoReflect.Descriptor instead. -func (*ListAgentVersionsRequest) Descriptor() ([]byte, []int) { - return file_livekit_cloud_agent_proto_rawDescGZIP(), []int{10} -} - -func (x *ListAgentVersionsRequest) GetAgentId() string { - if x != nil { - return x.AgentId - } - return "" -} - -func (x *ListAgentVersionsRequest) GetAgentName() string { - if x != nil { - return x.AgentName - } - return "" -} - -type ListAgentVersionsResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Versions []*AgentVersion `protobuf:"bytes,1,rep,name=versions,proto3" json:"versions,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ListAgentVersionsResponse) Reset() { - *x = ListAgentVersionsResponse{} - mi := &file_livekit_cloud_agent_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ListAgentVersionsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListAgentVersionsResponse) ProtoMessage() {} - -func (x *ListAgentVersionsResponse) ProtoReflect() protoreflect.Message { - mi := &file_livekit_cloud_agent_proto_msgTypes[11] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListAgentVersionsResponse.ProtoReflect.Descriptor instead. -func (*ListAgentVersionsResponse) Descriptor() ([]byte, []int) { - return file_livekit_cloud_agent_proto_rawDescGZIP(), []int{11} -} - -func (x *ListAgentVersionsResponse) GetVersions() []*AgentVersion { - if x != nil { - return x.Versions - } - return nil -} - -type UpdateAgentRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - AgentId string `protobuf:"bytes,1,opt,name=agent_id,json=agentId,proto3" json:"agent_id,omitempty"` - // Deprecated: Marked as deprecated in livekit_cloud_agent.proto. - AgentName string `protobuf:"bytes,2,opt,name=agent_name,json=agentName,proto3" json:"agent_name,omitempty"` - // Deprecated: Marked as deprecated in livekit_cloud_agent.proto. - Replicas int32 `protobuf:"varint,3,opt,name=replicas,proto3" json:"replicas,omitempty"` - // Deprecated: Marked as deprecated in livekit_cloud_agent.proto. - MaxReplicas int32 `protobuf:"varint,4,opt,name=max_replicas,json=maxReplicas,proto3" json:"max_replicas,omitempty"` - // Deprecated: Marked as deprecated in livekit_cloud_agent.proto. - CpuReq string `protobuf:"bytes,5,opt,name=cpu_req,json=cpuReq,proto3" json:"cpu_req,omitempty"` - Regions []string `protobuf:"bytes,6,rep,name=regions,proto3" json:"regions,omitempty"` - Secrets []*AgentSecret `protobuf:"bytes,7,rep,name=secrets,proto3" json:"secrets,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *UpdateAgentRequest) Reset() { - *x = UpdateAgentRequest{} - mi := &file_livekit_cloud_agent_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *UpdateAgentRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateAgentRequest) ProtoMessage() {} - -func (x *UpdateAgentRequest) ProtoReflect() protoreflect.Message { - mi := &file_livekit_cloud_agent_proto_msgTypes[12] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UpdateAgentRequest.ProtoReflect.Descriptor instead. -func (*UpdateAgentRequest) Descriptor() ([]byte, []int) { - return file_livekit_cloud_agent_proto_rawDescGZIP(), []int{12} -} - -func (x *UpdateAgentRequest) GetAgentId() string { - if x != nil { - return x.AgentId - } - return "" -} - -// Deprecated: Marked as deprecated in livekit_cloud_agent.proto. -func (x *UpdateAgentRequest) GetAgentName() string { - if x != nil { - return x.AgentName - } - return "" -} - -// Deprecated: Marked as deprecated in livekit_cloud_agent.proto. -func (x *UpdateAgentRequest) GetReplicas() int32 { - if x != nil { - return x.Replicas - } - return 0 -} - -// Deprecated: Marked as deprecated in livekit_cloud_agent.proto. -func (x *UpdateAgentRequest) GetMaxReplicas() int32 { - if x != nil { - return x.MaxReplicas - } - return 0 -} - -// Deprecated: Marked as deprecated in livekit_cloud_agent.proto. -func (x *UpdateAgentRequest) GetCpuReq() string { - if x != nil { - return x.CpuReq - } - return "" -} - -func (x *UpdateAgentRequest) GetRegions() []string { - if x != nil { - return x.Regions - } - return nil -} - -func (x *UpdateAgentRequest) GetSecrets() []*AgentSecret { - if x != nil { - return x.Secrets - } - return nil -} - -type UpdateAgentResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` - Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *UpdateAgentResponse) Reset() { - *x = UpdateAgentResponse{} - mi := &file_livekit_cloud_agent_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *UpdateAgentResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateAgentResponse) ProtoMessage() {} - -func (x *UpdateAgentResponse) ProtoReflect() protoreflect.Message { - mi := &file_livekit_cloud_agent_proto_msgTypes[13] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UpdateAgentResponse.ProtoReflect.Descriptor instead. -func (*UpdateAgentResponse) Descriptor() ([]byte, []int) { - return file_livekit_cloud_agent_proto_rawDescGZIP(), []int{13} -} - -func (x *UpdateAgentResponse) GetSuccess() bool { - if x != nil { - return x.Success - } - return false -} - -func (x *UpdateAgentResponse) GetMessage() string { - if x != nil { - return x.Message - } - return "" -} - -type RestartAgentRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - AgentId string `protobuf:"bytes,1,opt,name=agent_id,json=agentId,proto3" json:"agent_id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *RestartAgentRequest) Reset() { - *x = RestartAgentRequest{} - mi := &file_livekit_cloud_agent_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *RestartAgentRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RestartAgentRequest) ProtoMessage() {} - -func (x *RestartAgentRequest) ProtoReflect() protoreflect.Message { - mi := &file_livekit_cloud_agent_proto_msgTypes[14] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RestartAgentRequest.ProtoReflect.Descriptor instead. -func (*RestartAgentRequest) Descriptor() ([]byte, []int) { - return file_livekit_cloud_agent_proto_rawDescGZIP(), []int{14} -} - -func (x *RestartAgentRequest) GetAgentId() string { - if x != nil { - return x.AgentId - } - return "" -} - -type RestartAgentResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` - Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *RestartAgentResponse) Reset() { - *x = RestartAgentResponse{} - mi := &file_livekit_cloud_agent_proto_msgTypes[15] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *RestartAgentResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RestartAgentResponse) ProtoMessage() {} - -func (x *RestartAgentResponse) ProtoReflect() protoreflect.Message { - mi := &file_livekit_cloud_agent_proto_msgTypes[15] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RestartAgentResponse.ProtoReflect.Descriptor instead. -func (*RestartAgentResponse) Descriptor() ([]byte, []int) { - return file_livekit_cloud_agent_proto_rawDescGZIP(), []int{15} -} - -func (x *RestartAgentResponse) GetSuccess() bool { - if x != nil { - return x.Success - } - return false -} - -func (x *RestartAgentResponse) GetMessage() string { - if x != nil { - return x.Message - } - return "" -} - -type DeployAgentRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - AgentId string `protobuf:"bytes,1,opt,name=agent_id,json=agentId,proto3" json:"agent_id,omitempty"` - // Deprecated: Marked as deprecated in livekit_cloud_agent.proto. - AgentName string `protobuf:"bytes,2,opt,name=agent_name,json=agentName,proto3" json:"agent_name,omitempty"` - Secrets []*AgentSecret `protobuf:"bytes,3,rep,name=secrets,proto3" json:"secrets,omitempty"` - // Deprecated: Marked as deprecated in livekit_cloud_agent.proto. - Replicas int32 `protobuf:"varint,4,opt,name=replicas,proto3" json:"replicas,omitempty"` - // Deprecated: Marked as deprecated in livekit_cloud_agent.proto. - MaxReplicas int32 `protobuf:"varint,5,opt,name=max_replicas,json=maxReplicas,proto3" json:"max_replicas,omitempty"` - // Deprecated: Marked as deprecated in livekit_cloud_agent.proto. - CpuReq string `protobuf:"bytes,6,opt,name=cpu_req,json=cpuReq,proto3" json:"cpu_req,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *DeployAgentRequest) Reset() { - *x = DeployAgentRequest{} - mi := &file_livekit_cloud_agent_proto_msgTypes[16] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *DeployAgentRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeployAgentRequest) ProtoMessage() {} - -func (x *DeployAgentRequest) ProtoReflect() protoreflect.Message { - mi := &file_livekit_cloud_agent_proto_msgTypes[16] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DeployAgentRequest.ProtoReflect.Descriptor instead. -func (*DeployAgentRequest) Descriptor() ([]byte, []int) { - return file_livekit_cloud_agent_proto_rawDescGZIP(), []int{16} -} - -func (x *DeployAgentRequest) GetAgentId() string { - if x != nil { - return x.AgentId - } - return "" -} - -// Deprecated: Marked as deprecated in livekit_cloud_agent.proto. -func (x *DeployAgentRequest) GetAgentName() string { - if x != nil { - return x.AgentName - } - return "" -} - -func (x *DeployAgentRequest) GetSecrets() []*AgentSecret { - if x != nil { - return x.Secrets - } - return nil -} - -// Deprecated: Marked as deprecated in livekit_cloud_agent.proto. -func (x *DeployAgentRequest) GetReplicas() int32 { - if x != nil { - return x.Replicas - } - return 0 -} - -// Deprecated: Marked as deprecated in livekit_cloud_agent.proto. -func (x *DeployAgentRequest) GetMaxReplicas() int32 { - if x != nil { - return x.MaxReplicas - } - return 0 -} - -// Deprecated: Marked as deprecated in livekit_cloud_agent.proto. -func (x *DeployAgentRequest) GetCpuReq() string { - if x != nil { - return x.CpuReq - } - return "" -} - -type DeployAgentResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` - Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` - AgentId string `protobuf:"bytes,3,opt,name=agent_id,json=agentId,proto3" json:"agent_id,omitempty"` - PresignedUrl string `protobuf:"bytes,4,opt,name=presigned_url,json=presignedUrl,proto3" json:"presigned_url,omitempty"` - Tag string `protobuf:"bytes,5,opt,name=tag,proto3" json:"tag,omitempty"` - PresignedPostRequest *PresignedPostRequest `protobuf:"bytes,6,opt,name=presigned_post_request,json=presignedPostRequest,proto3" json:"presigned_post_request,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *DeployAgentResponse) Reset() { - *x = DeployAgentResponse{} - mi := &file_livekit_cloud_agent_proto_msgTypes[17] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *DeployAgentResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeployAgentResponse) ProtoMessage() {} - -func (x *DeployAgentResponse) ProtoReflect() protoreflect.Message { - mi := &file_livekit_cloud_agent_proto_msgTypes[17] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DeployAgentResponse.ProtoReflect.Descriptor instead. -func (*DeployAgentResponse) Descriptor() ([]byte, []int) { - return file_livekit_cloud_agent_proto_rawDescGZIP(), []int{17} -} - -func (x *DeployAgentResponse) GetSuccess() bool { - if x != nil { - return x.Success - } - return false -} - -func (x *DeployAgentResponse) GetMessage() string { - if x != nil { - return x.Message - } - return "" -} - -func (x *DeployAgentResponse) GetAgentId() string { - if x != nil { - return x.AgentId - } - return "" -} - -func (x *DeployAgentResponse) GetPresignedUrl() string { - if x != nil { - return x.PresignedUrl - } - return "" -} - -func (x *DeployAgentResponse) GetTag() string { - if x != nil { - return x.Tag - } - return "" -} - -func (x *DeployAgentResponse) GetPresignedPostRequest() *PresignedPostRequest { - if x != nil { - return x.PresignedPostRequest - } - return nil -} - -type UpdateAgentSecretsRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - AgentId string `protobuf:"bytes,1,opt,name=agent_id,json=agentId,proto3" json:"agent_id,omitempty"` - AgentName string `protobuf:"bytes,2,opt,name=agent_name,json=agentName,proto3" json:"agent_name,omitempty"` - Overwrite bool `protobuf:"varint,3,opt,name=overwrite,proto3" json:"overwrite,omitempty"` - Secrets []*AgentSecret `protobuf:"bytes,4,rep,name=secrets,proto3" json:"secrets,omitempty"` - Remove []string `protobuf:"bytes,5,rep,name=remove,proto3" json:"remove,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *UpdateAgentSecretsRequest) Reset() { - *x = UpdateAgentSecretsRequest{} - mi := &file_livekit_cloud_agent_proto_msgTypes[18] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *UpdateAgentSecretsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateAgentSecretsRequest) ProtoMessage() {} - -func (x *UpdateAgentSecretsRequest) ProtoReflect() protoreflect.Message { - mi := &file_livekit_cloud_agent_proto_msgTypes[18] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UpdateAgentSecretsRequest.ProtoReflect.Descriptor instead. -func (*UpdateAgentSecretsRequest) Descriptor() ([]byte, []int) { - return file_livekit_cloud_agent_proto_rawDescGZIP(), []int{18} -} - -func (x *UpdateAgentSecretsRequest) GetAgentId() string { - if x != nil { - return x.AgentId - } - return "" -} - -func (x *UpdateAgentSecretsRequest) GetAgentName() string { - if x != nil { - return x.AgentName - } - return "" -} - -func (x *UpdateAgentSecretsRequest) GetOverwrite() bool { - if x != nil { - return x.Overwrite - } - return false -} - -func (x *UpdateAgentSecretsRequest) GetSecrets() []*AgentSecret { - if x != nil { - return x.Secrets - } - return nil -} - -func (x *UpdateAgentSecretsRequest) GetRemove() []string { - if x != nil { - return x.Remove - } - return nil -} - -type UpdateAgentSecretsResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` - Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *UpdateAgentSecretsResponse) Reset() { - *x = UpdateAgentSecretsResponse{} - mi := &file_livekit_cloud_agent_proto_msgTypes[19] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *UpdateAgentSecretsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateAgentSecretsResponse) ProtoMessage() {} - -func (x *UpdateAgentSecretsResponse) ProtoReflect() protoreflect.Message { - mi := &file_livekit_cloud_agent_proto_msgTypes[19] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UpdateAgentSecretsResponse.ProtoReflect.Descriptor instead. -func (*UpdateAgentSecretsResponse) Descriptor() ([]byte, []int) { - return file_livekit_cloud_agent_proto_rawDescGZIP(), []int{19} -} - -func (x *UpdateAgentSecretsResponse) GetSuccess() bool { - if x != nil { - return x.Success - } - return false -} - -func (x *UpdateAgentSecretsResponse) GetMessage() string { - if x != nil { - return x.Message - } - return "" -} - -type RollbackAgentRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - AgentId string `protobuf:"bytes,1,opt,name=agent_id,json=agentId,proto3" json:"agent_id,omitempty"` - AgentName string `protobuf:"bytes,2,opt,name=agent_name,json=agentName,proto3" json:"agent_name,omitempty"` - Version string `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *RollbackAgentRequest) Reset() { - *x = RollbackAgentRequest{} - mi := &file_livekit_cloud_agent_proto_msgTypes[20] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *RollbackAgentRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RollbackAgentRequest) ProtoMessage() {} - -func (x *RollbackAgentRequest) ProtoReflect() protoreflect.Message { - mi := &file_livekit_cloud_agent_proto_msgTypes[20] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RollbackAgentRequest.ProtoReflect.Descriptor instead. -func (*RollbackAgentRequest) Descriptor() ([]byte, []int) { - return file_livekit_cloud_agent_proto_rawDescGZIP(), []int{20} -} - -func (x *RollbackAgentRequest) GetAgentId() string { - if x != nil { - return x.AgentId - } - return "" -} - -func (x *RollbackAgentRequest) GetAgentName() string { - if x != nil { - return x.AgentName - } - return "" -} - -func (x *RollbackAgentRequest) GetVersion() string { - if x != nil { - return x.Version - } - return "" -} - -type RollbackAgentResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` - Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *RollbackAgentResponse) Reset() { - *x = RollbackAgentResponse{} - mi := &file_livekit_cloud_agent_proto_msgTypes[21] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *RollbackAgentResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RollbackAgentResponse) ProtoMessage() {} - -func (x *RollbackAgentResponse) ProtoReflect() protoreflect.Message { - mi := &file_livekit_cloud_agent_proto_msgTypes[21] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RollbackAgentResponse.ProtoReflect.Descriptor instead. -func (*RollbackAgentResponse) Descriptor() ([]byte, []int) { - return file_livekit_cloud_agent_proto_rawDescGZIP(), []int{21} -} - -func (x *RollbackAgentResponse) GetSuccess() bool { - if x != nil { - return x.Success - } - return false -} - -func (x *RollbackAgentResponse) GetMessage() string { - if x != nil { - return x.Message - } - return "" -} - -type DeleteAgentRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - AgentId string `protobuf:"bytes,1,opt,name=agent_id,json=agentId,proto3" json:"agent_id,omitempty"` - AgentName string `protobuf:"bytes,2,opt,name=agent_name,json=agentName,proto3" json:"agent_name,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *DeleteAgentRequest) Reset() { - *x = DeleteAgentRequest{} - mi := &file_livekit_cloud_agent_proto_msgTypes[22] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *DeleteAgentRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteAgentRequest) ProtoMessage() {} - -func (x *DeleteAgentRequest) ProtoReflect() protoreflect.Message { - mi := &file_livekit_cloud_agent_proto_msgTypes[22] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DeleteAgentRequest.ProtoReflect.Descriptor instead. -func (*DeleteAgentRequest) Descriptor() ([]byte, []int) { - return file_livekit_cloud_agent_proto_rawDescGZIP(), []int{22} -} - -func (x *DeleteAgentRequest) GetAgentId() string { - if x != nil { - return x.AgentId - } - return "" -} - -func (x *DeleteAgentRequest) GetAgentName() string { - if x != nil { - return x.AgentName - } - return "" -} - -type DeleteAgentResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` - Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *DeleteAgentResponse) Reset() { - *x = DeleteAgentResponse{} - mi := &file_livekit_cloud_agent_proto_msgTypes[23] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *DeleteAgentResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteAgentResponse) ProtoMessage() {} - -func (x *DeleteAgentResponse) ProtoReflect() protoreflect.Message { - mi := &file_livekit_cloud_agent_proto_msgTypes[23] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DeleteAgentResponse.ProtoReflect.Descriptor instead. -func (*DeleteAgentResponse) Descriptor() ([]byte, []int) { - return file_livekit_cloud_agent_proto_rawDescGZIP(), []int{23} -} - -func (x *DeleteAgentResponse) GetSuccess() bool { - if x != nil { - return x.Success - } - return false -} - -func (x *DeleteAgentResponse) GetMessage() string { - if x != nil { - return x.Message - } - return "" -} - -type ListAgentSecretsRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - AgentId string `protobuf:"bytes,1,opt,name=agent_id,json=agentId,proto3" json:"agent_id,omitempty"` - AgentName string `protobuf:"bytes,2,opt,name=agent_name,json=agentName,proto3" json:"agent_name,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ListAgentSecretsRequest) Reset() { - *x = ListAgentSecretsRequest{} - mi := &file_livekit_cloud_agent_proto_msgTypes[24] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ListAgentSecretsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListAgentSecretsRequest) ProtoMessage() {} - -func (x *ListAgentSecretsRequest) ProtoReflect() protoreflect.Message { - mi := &file_livekit_cloud_agent_proto_msgTypes[24] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListAgentSecretsRequest.ProtoReflect.Descriptor instead. -func (*ListAgentSecretsRequest) Descriptor() ([]byte, []int) { - return file_livekit_cloud_agent_proto_rawDescGZIP(), []int{24} -} - -func (x *ListAgentSecretsRequest) GetAgentId() string { - if x != nil { - return x.AgentId - } - return "" -} - -func (x *ListAgentSecretsRequest) GetAgentName() string { - if x != nil { - return x.AgentName - } - return "" -} - -type ListAgentSecretsResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Secrets []*AgentSecret `protobuf:"bytes,1,rep,name=secrets,proto3" json:"secrets,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ListAgentSecretsResponse) Reset() { - *x = ListAgentSecretsResponse{} - mi := &file_livekit_cloud_agent_proto_msgTypes[25] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ListAgentSecretsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListAgentSecretsResponse) ProtoMessage() {} - -func (x *ListAgentSecretsResponse) ProtoReflect() protoreflect.Message { - mi := &file_livekit_cloud_agent_proto_msgTypes[25] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListAgentSecretsResponse.ProtoReflect.Descriptor instead. -func (*ListAgentSecretsResponse) Descriptor() ([]byte, []int) { - return file_livekit_cloud_agent_proto_rawDescGZIP(), []int{25} -} - -func (x *ListAgentSecretsResponse) GetSecrets() []*AgentSecret { - if x != nil { - return x.Secrets - } - return nil -} - -type SettingsParam struct { - state protoimpl.MessageState `protogen:"open.v1"` - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SettingsParam) Reset() { - *x = SettingsParam{} - mi := &file_livekit_cloud_agent_proto_msgTypes[26] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SettingsParam) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SettingsParam) ProtoMessage() {} - -func (x *SettingsParam) ProtoReflect() protoreflect.Message { - mi := &file_livekit_cloud_agent_proto_msgTypes[26] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SettingsParam.ProtoReflect.Descriptor instead. -func (*SettingsParam) Descriptor() ([]byte, []int) { - return file_livekit_cloud_agent_proto_rawDescGZIP(), []int{26} -} - -func (x *SettingsParam) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *SettingsParam) GetValue() string { - if x != nil { - return x.Value - } - return "" -} - -type ClientSettingsResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Params []*SettingsParam `protobuf:"bytes,1,rep,name=params,proto3" json:"params,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ClientSettingsResponse) Reset() { - *x = ClientSettingsResponse{} - mi := &file_livekit_cloud_agent_proto_msgTypes[27] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ClientSettingsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ClientSettingsResponse) ProtoMessage() {} - -func (x *ClientSettingsResponse) ProtoReflect() protoreflect.Message { - mi := &file_livekit_cloud_agent_proto_msgTypes[27] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ClientSettingsResponse.ProtoReflect.Descriptor instead. -func (*ClientSettingsResponse) Descriptor() ([]byte, []int) { - return file_livekit_cloud_agent_proto_rawDescGZIP(), []int{27} -} - -func (x *ClientSettingsResponse) GetParams() []*SettingsParam { - if x != nil { - return x.Params - } - return nil -} - -type ClientSettingsRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ClientSettingsRequest) Reset() { - *x = ClientSettingsRequest{} - mi := &file_livekit_cloud_agent_proto_msgTypes[28] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ClientSettingsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ClientSettingsRequest) ProtoMessage() {} - -func (x *ClientSettingsRequest) ProtoReflect() protoreflect.Message { - mi := &file_livekit_cloud_agent_proto_msgTypes[28] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ClientSettingsRequest.ProtoReflect.Descriptor instead. -func (*ClientSettingsRequest) Descriptor() ([]byte, []int) { - return file_livekit_cloud_agent_proto_rawDescGZIP(), []int{28} -} - -type PrivateLink struct { - state protoimpl.MessageState `protogen:"open.v1"` - PrivateLinkId string `protobuf:"bytes,1,opt,name=private_link_id,json=privateLinkId,proto3" json:"private_link_id,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Region string `protobuf:"bytes,4,opt,name=region,proto3" json:"region,omitempty"` - Port uint32 `protobuf:"varint,5,opt,name=port,proto3" json:"port,omitempty"` - Endpoint string `protobuf:"bytes,6,opt,name=endpoint,proto3" json:"endpoint,omitempty"` - ConnectionEndpoint string `protobuf:"bytes,7,opt,name=connection_endpoint,json=connectionEndpoint,proto3" json:"connection_endpoint,omitempty"` - CloudRegion string `protobuf:"bytes,8,opt,name=cloud_region,json=cloudRegion,proto3" json:"cloud_region,omitempty"` - // Types that are valid to be assigned to Config: - // - // *PrivateLink_Aws - Config isPrivateLink_Config `protobuf_oneof:"config"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *PrivateLink) Reset() { - *x = PrivateLink{} - mi := &file_livekit_cloud_agent_proto_msgTypes[29] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *PrivateLink) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PrivateLink) ProtoMessage() {} - -func (x *PrivateLink) ProtoReflect() protoreflect.Message { - mi := &file_livekit_cloud_agent_proto_msgTypes[29] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use PrivateLink.ProtoReflect.Descriptor instead. -func (*PrivateLink) Descriptor() ([]byte, []int) { - return file_livekit_cloud_agent_proto_rawDescGZIP(), []int{29} -} - -func (x *PrivateLink) GetPrivateLinkId() string { - if x != nil { - return x.PrivateLinkId - } - return "" -} - -func (x *PrivateLink) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *PrivateLink) GetRegion() string { - if x != nil { - return x.Region - } - return "" -} - -func (x *PrivateLink) GetPort() uint32 { - if x != nil { - return x.Port - } - return 0 -} - -func (x *PrivateLink) GetEndpoint() string { - if x != nil { - return x.Endpoint - } - return "" -} - -func (x *PrivateLink) GetConnectionEndpoint() string { - if x != nil { - return x.ConnectionEndpoint - } - return "" -} - -func (x *PrivateLink) GetCloudRegion() string { - if x != nil { - return x.CloudRegion - } - return "" -} - -func (x *PrivateLink) GetConfig() isPrivateLink_Config { - if x != nil { - return x.Config - } - return nil -} - -// Deprecated: Marked as deprecated in livekit_cloud_agent.proto. -func (x *PrivateLink) GetAws() *PrivateLink_AWSConfig { - if x != nil { - if x, ok := x.Config.(*PrivateLink_Aws); ok { - return x.Aws - } - } - return nil -} - -type isPrivateLink_Config interface { - isPrivateLink_Config() -} - -type PrivateLink_Aws struct { - // Deprecated: Marked as deprecated in livekit_cloud_agent.proto. - Aws *PrivateLink_AWSConfig `protobuf:"bytes,3,opt,name=aws,proto3,oneof"` -} - -func (*PrivateLink_Aws) isPrivateLink_Config() {} - -type PrivateLinkStatus struct { - state protoimpl.MessageState `protogen:"open.v1"` - Status PrivateLinkStatus_Status `protobuf:"varint,1,opt,name=status,proto3,enum=livekit.PrivateLinkStatus_Status" json:"status,omitempty"` - UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` - Reason string `protobuf:"bytes,3,opt,name=reason,proto3" json:"reason,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *PrivateLinkStatus) Reset() { - *x = PrivateLinkStatus{} - mi := &file_livekit_cloud_agent_proto_msgTypes[30] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *PrivateLinkStatus) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PrivateLinkStatus) ProtoMessage() {} - -func (x *PrivateLinkStatus) ProtoReflect() protoreflect.Message { - mi := &file_livekit_cloud_agent_proto_msgTypes[30] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use PrivateLinkStatus.ProtoReflect.Descriptor instead. -func (*PrivateLinkStatus) Descriptor() ([]byte, []int) { - return file_livekit_cloud_agent_proto_rawDescGZIP(), []int{30} -} - -func (x *PrivateLinkStatus) GetStatus() PrivateLinkStatus_Status { - if x != nil { - return x.Status - } - return PrivateLinkStatus_PRIVATE_LINK_STATUS_UNKNOWN -} - -func (x *PrivateLinkStatus) GetUpdatedAt() *timestamppb.Timestamp { - if x != nil { - return x.UpdatedAt - } - return nil -} - -func (x *PrivateLinkStatus) GetReason() string { - if x != nil { - return x.Reason - } - return "" -} - -type CreatePrivateLinkRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Region string `protobuf:"bytes,3,opt,name=region,proto3" json:"region,omitempty"` - Port uint32 `protobuf:"varint,4,opt,name=port,proto3" json:"port,omitempty"` - Endpoint string `protobuf:"bytes,5,opt,name=endpoint,proto3" json:"endpoint,omitempty"` - CloudRegion *string `protobuf:"bytes,6,opt,name=cloud_region,json=cloudRegion,proto3,oneof" json:"cloud_region,omitempty"` - // Types that are valid to be assigned to Config: - // - // *CreatePrivateLinkRequest_Aws - Config isCreatePrivateLinkRequest_Config `protobuf_oneof:"config"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *CreatePrivateLinkRequest) Reset() { - *x = CreatePrivateLinkRequest{} - mi := &file_livekit_cloud_agent_proto_msgTypes[31] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *CreatePrivateLinkRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreatePrivateLinkRequest) ProtoMessage() {} - -func (x *CreatePrivateLinkRequest) ProtoReflect() protoreflect.Message { - mi := &file_livekit_cloud_agent_proto_msgTypes[31] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CreatePrivateLinkRequest.ProtoReflect.Descriptor instead. -func (*CreatePrivateLinkRequest) Descriptor() ([]byte, []int) { - return file_livekit_cloud_agent_proto_rawDescGZIP(), []int{31} -} - -func (x *CreatePrivateLinkRequest) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *CreatePrivateLinkRequest) GetRegion() string { - if x != nil { - return x.Region - } - return "" -} - -func (x *CreatePrivateLinkRequest) GetPort() uint32 { - if x != nil { - return x.Port - } - return 0 -} - -func (x *CreatePrivateLinkRequest) GetEndpoint() string { - if x != nil { - return x.Endpoint - } - return "" -} - -func (x *CreatePrivateLinkRequest) GetCloudRegion() string { - if x != nil && x.CloudRegion != nil { - return *x.CloudRegion - } - return "" -} - -func (x *CreatePrivateLinkRequest) GetConfig() isCreatePrivateLinkRequest_Config { - if x != nil { - return x.Config - } - return nil -} - -// Deprecated: Marked as deprecated in livekit_cloud_agent.proto. -func (x *CreatePrivateLinkRequest) GetAws() *CreatePrivateLinkRequest_AWSCreateConfig { - if x != nil { - if x, ok := x.Config.(*CreatePrivateLinkRequest_Aws); ok { - return x.Aws - } - } - return nil -} - -type isCreatePrivateLinkRequest_Config interface { - isCreatePrivateLinkRequest_Config() -} - -type CreatePrivateLinkRequest_Aws struct { - // Deprecated: Marked as deprecated in livekit_cloud_agent.proto. - Aws *CreatePrivateLinkRequest_AWSCreateConfig `protobuf:"bytes,2,opt,name=aws,proto3,oneof"` -} - -func (*CreatePrivateLinkRequest_Aws) isCreatePrivateLinkRequest_Config() {} - -type CreatePrivateLinkResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - PrivateLink *PrivateLink `protobuf:"bytes,1,opt,name=private_link,json=privateLink,proto3" json:"private_link,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *CreatePrivateLinkResponse) Reset() { - *x = CreatePrivateLinkResponse{} - mi := &file_livekit_cloud_agent_proto_msgTypes[32] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *CreatePrivateLinkResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreatePrivateLinkResponse) ProtoMessage() {} - -func (x *CreatePrivateLinkResponse) ProtoReflect() protoreflect.Message { - mi := &file_livekit_cloud_agent_proto_msgTypes[32] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CreatePrivateLinkResponse.ProtoReflect.Descriptor instead. -func (*CreatePrivateLinkResponse) Descriptor() ([]byte, []int) { - return file_livekit_cloud_agent_proto_rawDescGZIP(), []int{32} -} - -func (x *CreatePrivateLinkResponse) GetPrivateLink() *PrivateLink { - if x != nil { - return x.PrivateLink - } - return nil -} - -type DestroyPrivateLinkRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - PrivateLinkId string `protobuf:"bytes,1,opt,name=private_link_id,json=privateLinkId,proto3" json:"private_link_id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *DestroyPrivateLinkRequest) Reset() { - *x = DestroyPrivateLinkRequest{} - mi := &file_livekit_cloud_agent_proto_msgTypes[33] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *DestroyPrivateLinkRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DestroyPrivateLinkRequest) ProtoMessage() {} - -func (x *DestroyPrivateLinkRequest) ProtoReflect() protoreflect.Message { - mi := &file_livekit_cloud_agent_proto_msgTypes[33] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DestroyPrivateLinkRequest.ProtoReflect.Descriptor instead. -func (*DestroyPrivateLinkRequest) Descriptor() ([]byte, []int) { - return file_livekit_cloud_agent_proto_rawDescGZIP(), []int{33} -} - -func (x *DestroyPrivateLinkRequest) GetPrivateLinkId() string { - if x != nil { - return x.PrivateLinkId - } - return "" -} - -type DestroyPrivateLinkResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *DestroyPrivateLinkResponse) Reset() { - *x = DestroyPrivateLinkResponse{} - mi := &file_livekit_cloud_agent_proto_msgTypes[34] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *DestroyPrivateLinkResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DestroyPrivateLinkResponse) ProtoMessage() {} - -func (x *DestroyPrivateLinkResponse) ProtoReflect() protoreflect.Message { - mi := &file_livekit_cloud_agent_proto_msgTypes[34] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DestroyPrivateLinkResponse.ProtoReflect.Descriptor instead. -func (*DestroyPrivateLinkResponse) Descriptor() ([]byte, []int) { - return file_livekit_cloud_agent_proto_rawDescGZIP(), []int{34} -} - -type ListPrivateLinksRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ListPrivateLinksRequest) Reset() { - *x = ListPrivateLinksRequest{} - mi := &file_livekit_cloud_agent_proto_msgTypes[35] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ListPrivateLinksRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListPrivateLinksRequest) ProtoMessage() {} - -func (x *ListPrivateLinksRequest) ProtoReflect() protoreflect.Message { - mi := &file_livekit_cloud_agent_proto_msgTypes[35] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListPrivateLinksRequest.ProtoReflect.Descriptor instead. -func (*ListPrivateLinksRequest) Descriptor() ([]byte, []int) { - return file_livekit_cloud_agent_proto_rawDescGZIP(), []int{35} -} - -type ListPrivateLinksResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Items []*PrivateLink `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ListPrivateLinksResponse) Reset() { - *x = ListPrivateLinksResponse{} - mi := &file_livekit_cloud_agent_proto_msgTypes[36] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ListPrivateLinksResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListPrivateLinksResponse) ProtoMessage() {} - -func (x *ListPrivateLinksResponse) ProtoReflect() protoreflect.Message { - mi := &file_livekit_cloud_agent_proto_msgTypes[36] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListPrivateLinksResponse.ProtoReflect.Descriptor instead. -func (*ListPrivateLinksResponse) Descriptor() ([]byte, []int) { - return file_livekit_cloud_agent_proto_rawDescGZIP(), []int{36} -} - -func (x *ListPrivateLinksResponse) GetItems() []*PrivateLink { - if x != nil { - return x.Items - } - return nil -} - -type GetPrivateLinkStatusRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - PrivateLinkId string `protobuf:"bytes,1,opt,name=private_link_id,json=privateLinkId,proto3" json:"private_link_id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetPrivateLinkStatusRequest) Reset() { - *x = GetPrivateLinkStatusRequest{} - mi := &file_livekit_cloud_agent_proto_msgTypes[37] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetPrivateLinkStatusRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetPrivateLinkStatusRequest) ProtoMessage() {} - -func (x *GetPrivateLinkStatusRequest) ProtoReflect() protoreflect.Message { - mi := &file_livekit_cloud_agent_proto_msgTypes[37] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetPrivateLinkStatusRequest.ProtoReflect.Descriptor instead. -func (*GetPrivateLinkStatusRequest) Descriptor() ([]byte, []int) { - return file_livekit_cloud_agent_proto_rawDescGZIP(), []int{37} -} - -func (x *GetPrivateLinkStatusRequest) GetPrivateLinkId() string { - if x != nil { - return x.PrivateLinkId - } - return "" -} - -type GetPrivateLinkStatusResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Value *PrivateLinkStatus `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetPrivateLinkStatusResponse) Reset() { - *x = GetPrivateLinkStatusResponse{} - mi := &file_livekit_cloud_agent_proto_msgTypes[38] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetPrivateLinkStatusResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetPrivateLinkStatusResponse) ProtoMessage() {} - -func (x *GetPrivateLinkStatusResponse) ProtoReflect() protoreflect.Message { - mi := &file_livekit_cloud_agent_proto_msgTypes[38] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetPrivateLinkStatusResponse.ProtoReflect.Descriptor instead. -func (*GetPrivateLinkStatusResponse) Descriptor() ([]byte, []int) { - return file_livekit_cloud_agent_proto_rawDescGZIP(), []int{38} -} - -func (x *GetPrivateLinkStatusResponse) GetValue() *PrivateLinkStatus { - if x != nil { - return x.Value - } - return nil -} - -type PrivateLink_AWSConfig struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Deprecated: Marked as deprecated in livekit_cloud_agent.proto. - Endpoint string `protobuf:"bytes,1,opt,name=endpoint,proto3" json:"endpoint,omitempty"` // Use the generic "endpoint" instead - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *PrivateLink_AWSConfig) Reset() { - *x = PrivateLink_AWSConfig{} - mi := &file_livekit_cloud_agent_proto_msgTypes[41] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *PrivateLink_AWSConfig) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PrivateLink_AWSConfig) ProtoMessage() {} - -func (x *PrivateLink_AWSConfig) ProtoReflect() protoreflect.Message { - mi := &file_livekit_cloud_agent_proto_msgTypes[41] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use PrivateLink_AWSConfig.ProtoReflect.Descriptor instead. -func (*PrivateLink_AWSConfig) Descriptor() ([]byte, []int) { - return file_livekit_cloud_agent_proto_rawDescGZIP(), []int{29, 0} -} - -// Deprecated: Marked as deprecated in livekit_cloud_agent.proto. -func (x *PrivateLink_AWSConfig) GetEndpoint() string { - if x != nil { - return x.Endpoint - } - return "" -} - -type CreatePrivateLinkRequest_AWSCreateConfig struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Deprecated: Marked as deprecated in livekit_cloud_agent.proto. - Endpoint string `protobuf:"bytes,1,opt,name=endpoint,proto3" json:"endpoint,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *CreatePrivateLinkRequest_AWSCreateConfig) Reset() { - *x = CreatePrivateLinkRequest_AWSCreateConfig{} - mi := &file_livekit_cloud_agent_proto_msgTypes[42] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *CreatePrivateLinkRequest_AWSCreateConfig) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreatePrivateLinkRequest_AWSCreateConfig) ProtoMessage() {} - -func (x *CreatePrivateLinkRequest_AWSCreateConfig) ProtoReflect() protoreflect.Message { - mi := &file_livekit_cloud_agent_proto_msgTypes[42] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CreatePrivateLinkRequest_AWSCreateConfig.ProtoReflect.Descriptor instead. -func (*CreatePrivateLinkRequest_AWSCreateConfig) Descriptor() ([]byte, []int) { - return file_livekit_cloud_agent_proto_rawDescGZIP(), []int{31, 0} -} - -// Deprecated: Marked as deprecated in livekit_cloud_agent.proto. -func (x *CreatePrivateLinkRequest_AWSCreateConfig) GetEndpoint() string { - if x != nil { - return x.Endpoint - } - return "" -} - -var File_livekit_cloud_agent_proto protoreflect.FileDescriptor - -const file_livekit_cloud_agent_proto_rawDesc = "" + - "\n" + - "\x19livekit_cloud_agent.proto\x12\alivekit\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x14logger/options.proto\"\x89\x01\n" + - "\n" + - "AgentEvent\x12+\n" + - "\x04type\x18\x01 \x01(\x0e2\x17.livekit.AgentEventTypeR\x04type\x12\x14\n" + - "\x05count\x18\x02 \x01(\x05R\x05count\x128\n" + - "\ttimestamp\x18\x03 \x01(\v2\x1a.google.protobuf.TimestampR\ttimestamp\"\xdb\x01\n" + - "\vAgentSecret\x12\x12\n" + - "\x04name\x18\x01 \x01(\tR\x04name\x12\x14\n" + - "\x05value\x18\x02 \x01(\fR\x05value\x129\n" + - "\n" + - "created_at\x18\x03 \x01(\v2\x1a.google.protobuf.TimestampR\tcreatedAt\x129\n" + - "\n" + - "updated_at\x18\x04 \x01(\v2\x1a.google.protobuf.TimestampR\tupdatedAt\x12,\n" + - "\x04kind\x18\x05 \x01(\x0e2\x18.livekit.AgentSecretKindR\x04kind\"\xe5\x01\n" + - "\x12CreateAgentRequest\x12!\n" + - "\n" + - "agent_name\x18\x01 \x01(\tB\x02\x18\x01R\tagentName\x12.\n" + - "\asecrets\x18\x02 \x03(\v2\x14.livekit.AgentSecretR\asecrets\x12\x1e\n" + - "\breplicas\x18\x03 \x01(\x05B\x02\x18\x01R\breplicas\x12%\n" + - "\fmax_replicas\x18\x04 \x01(\x05B\x02\x18\x01R\vmaxReplicas\x12\x1b\n" + - "\acpu_req\x18\x05 \x01(\tB\x02\x18\x01R\x06cpuReq\x12\x18\n" + - "\aregions\x18\x06 \x03(\tR\aregions\"\xc0\x02\n" + - "\x13CreateAgentResponse\x12%\n" + - "\bagent_id\x18\x01 \x01(\tB\n" + - "\xbaP\aagentIDR\aagentId\x12\x1d\n" + - "\n" + - "agent_name\x18\x02 \x01(\tR\tagentName\x12\x16\n" + - "\x06status\x18\x03 \x01(\tR\x06status\x12\x18\n" + - "\aversion\x18\x04 \x01(\tR\aversion\x12#\n" + - "\rpresigned_url\x18\x05 \x01(\tR\fpresignedUrl\x12\x10\n" + - "\x03tag\x18\x06 \x01(\tR\x03tag\x12%\n" + - "\x0eserver_regions\x18\a \x03(\tR\rserverRegions\x12S\n" + - "\x16presigned_post_request\x18\b \x01(\v2\x1d.livekit.PresignedPostRequestR\x14presignedPostRequest\"\xa6\x01\n" + - "\x14PresignedPostRequest\x12\x10\n" + - "\x03url\x18\x01 \x01(\tR\x03url\x12A\n" + - "\x06values\x18\x02 \x03(\v2).livekit.PresignedPostRequest.ValuesEntryR\x06values\x1a9\n" + - "\vValuesEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\xba\x03\n" + - "\x0fAgentDeployment\x12\x16\n" + - "\x06region\x18\x01 \x01(\tR\x06region\x12%\n" + - "\bagent_id\x18\x02 \x01(\tB\n" + - "\xbaP\aagentIDR\aagentId\x12\x16\n" + - "\x06status\x18\x03 \x01(\tR\x06status\x12\x1a\n" + - "\breplicas\x18\x04 \x01(\x05R\breplicas\x12!\n" + - "\fmin_replicas\x18\x05 \x01(\x05R\vminReplicas\x12!\n" + - "\fmax_replicas\x18\x06 \x01(\x05R\vmaxReplicas\x12\x17\n" + - "\acpu_req\x18\a \x01(\tR\x06cpuReq\x12\x17\n" + - "\acur_cpu\x18\b \x01(\tR\x06curCpu\x12\x17\n" + - "\acur_mem\x18\t \x01(\tR\x06curMem\x12\x17\n" + - "\amem_req\x18\n" + - " \x01(\tR\x06memReq\x12\x1b\n" + - "\tmem_limit\x18\v \x01(\tR\bmemLimit\x12\x1b\n" + - "\tcpu_limit\x18\f \x01(\tR\bcpuLimit\x12#\n" + - "\rserver_region\x18\r \x01(\tR\fserverRegion\x12+\n" + - "\x06events\x18\x0e \x03(\v2\x13.livekit.AgentEventR\x06events\"\x9f\x02\n" + - "\tAgentInfo\x12%\n" + - "\bagent_id\x18\x01 \x01(\tB\n" + - "\xbaP\aagentIDR\aagentId\x12\x1d\n" + - "\n" + - "agent_name\x18\x02 \x01(\tR\tagentName\x12\x18\n" + - "\aversion\x18\x03 \x01(\tR\aversion\x12E\n" + - "\x11agent_deployments\x18\x04 \x03(\v2\x18.livekit.AgentDeploymentR\x10agentDeployments\x12.\n" + - "\asecrets\x18\x05 \x03(\v2\x14.livekit.AgentSecretR\asecrets\x12;\n" + - "\vdeployed_at\x18\x06 \x01(\v2\x1a.google.protobuf.TimestampR\n" + - "deployedAt\"Y\n" + - "\x11ListAgentsRequest\x12\x1d\n" + - "\n" + - "agent_name\x18\x01 \x01(\tR\tagentName\x12%\n" + - "\bagent_id\x18\x02 \x01(\tB\n" + - "\xbaP\aagentIDR\aagentId\"@\n" + - "\x12ListAgentsResponse\x12*\n" + - "\x06agents\x18\x01 \x03(\v2\x12.livekit.AgentInfoR\x06agents\"\x8a\x03\n" + - "\fAgentVersion\x12\x18\n" + - "\aversion\x18\x01 \x01(\tR\aversion\x12\x18\n" + - "\acurrent\x18\x02 \x01(\bR\acurrent\x129\n" + - "\n" + - "created_at\x18\x03 \x01(\v2\x1a.google.protobuf.TimestampR\tcreatedAt\x12;\n" + - "\vdeployed_at\x18\x04 \x01(\v2\x1a.google.protobuf.TimestampR\n" + - "deployedAt\x12E\n" + - "\n" + - "attributes\x18\x05 \x03(\v2%.livekit.AgentVersion.AttributesEntryR\n" + - "attributes\x12\x16\n" + - "\x06status\x18\x06 \x01(\tR\x06status\x12\x14\n" + - "\x05owner\x18\a \x01(\tR\x05owner\x12\x1a\n" + - "\bdraining\x18\b \x01(\bR\bdraining\x1a=\n" + - "\x0fAttributesEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"`\n" + - "\x18ListAgentVersionsRequest\x12%\n" + - "\bagent_id\x18\x01 \x01(\tB\n" + - "\xbaP\aagentIDR\aagentId\x12\x1d\n" + - "\n" + - "agent_name\x18\x02 \x01(\tR\tagentName\"N\n" + - "\x19ListAgentVersionsResponse\x121\n" + - "\bversions\x18\x01 \x03(\v2\x15.livekit.AgentVersionR\bversions\"\x8c\x02\n" + - "\x12UpdateAgentRequest\x12%\n" + - "\bagent_id\x18\x01 \x01(\tB\n" + - "\xbaP\aagentIDR\aagentId\x12!\n" + - "\n" + - "agent_name\x18\x02 \x01(\tB\x02\x18\x01R\tagentName\x12\x1e\n" + - "\breplicas\x18\x03 \x01(\x05B\x02\x18\x01R\breplicas\x12%\n" + - "\fmax_replicas\x18\x04 \x01(\x05B\x02\x18\x01R\vmaxReplicas\x12\x1b\n" + - "\acpu_req\x18\x05 \x01(\tB\x02\x18\x01R\x06cpuReq\x12\x18\n" + - "\aregions\x18\x06 \x03(\tR\aregions\x12.\n" + - "\asecrets\x18\a \x03(\v2\x14.livekit.AgentSecretR\asecrets\"I\n" + - "\x13UpdateAgentResponse\x12\x18\n" + - "\asuccess\x18\x01 \x01(\bR\asuccess\x12\x18\n" + - "\amessage\x18\x02 \x01(\tR\amessage\"<\n" + - "\x13RestartAgentRequest\x12%\n" + - "\bagent_id\x18\x01 \x01(\tB\n" + - "\xbaP\aagentIDR\aagentId\"J\n" + - "\x14RestartAgentResponse\x12\x18\n" + - "\asuccess\x18\x01 \x01(\bR\asuccess\x12\x18\n" + - "\amessage\x18\x02 \x01(\tR\amessage\"\xf2\x01\n" + - "\x12DeployAgentRequest\x12%\n" + - "\bagent_id\x18\x01 \x01(\tB\n" + - "\xbaP\aagentIDR\aagentId\x12!\n" + - "\n" + - "agent_name\x18\x02 \x01(\tB\x02\x18\x01R\tagentName\x12.\n" + - "\asecrets\x18\x03 \x03(\v2\x14.livekit.AgentSecretR\asecrets\x12\x1e\n" + - "\breplicas\x18\x04 \x01(\x05B\x02\x18\x01R\breplicas\x12%\n" + - "\fmax_replicas\x18\x05 \x01(\x05B\x02\x18\x01R\vmaxReplicas\x12\x1b\n" + - "\acpu_req\x18\x06 \x01(\tB\x02\x18\x01R\x06cpuReq\"\xfc\x01\n" + - "\x13DeployAgentResponse\x12\x18\n" + - "\asuccess\x18\x01 \x01(\bR\asuccess\x12\x18\n" + - "\amessage\x18\x02 \x01(\tR\amessage\x12%\n" + - "\bagent_id\x18\x03 \x01(\tB\n" + - "\xbaP\aagentIDR\aagentId\x12#\n" + - "\rpresigned_url\x18\x04 \x01(\tR\fpresignedUrl\x12\x10\n" + - "\x03tag\x18\x05 \x01(\tR\x03tag\x12S\n" + - "\x16presigned_post_request\x18\x06 \x01(\v2\x1d.livekit.PresignedPostRequestR\x14presignedPostRequest\"\xc7\x01\n" + - "\x19UpdateAgentSecretsRequest\x12%\n" + - "\bagent_id\x18\x01 \x01(\tB\n" + - "\xbaP\aagentIDR\aagentId\x12\x1d\n" + - "\n" + - "agent_name\x18\x02 \x01(\tR\tagentName\x12\x1c\n" + - "\toverwrite\x18\x03 \x01(\bR\toverwrite\x12.\n" + - "\asecrets\x18\x04 \x03(\v2\x14.livekit.AgentSecretR\asecrets\x12\x16\n" + - "\x06remove\x18\x05 \x03(\tR\x06remove\"P\n" + - "\x1aUpdateAgentSecretsResponse\x12\x18\n" + - "\asuccess\x18\x01 \x01(\bR\asuccess\x12\x18\n" + - "\amessage\x18\x02 \x01(\tR\amessage\"v\n" + - "\x14RollbackAgentRequest\x12%\n" + - "\bagent_id\x18\x01 \x01(\tB\n" + - "\xbaP\aagentIDR\aagentId\x12\x1d\n" + - "\n" + - "agent_name\x18\x02 \x01(\tR\tagentName\x12\x18\n" + - "\aversion\x18\x03 \x01(\tR\aversion\"K\n" + - "\x15RollbackAgentResponse\x12\x18\n" + - "\asuccess\x18\x01 \x01(\bR\asuccess\x12\x18\n" + - "\amessage\x18\x02 \x01(\tR\amessage\"Z\n" + - "\x12DeleteAgentRequest\x12%\n" + - "\bagent_id\x18\x01 \x01(\tB\n" + - "\xbaP\aagentIDR\aagentId\x12\x1d\n" + - "\n" + - "agent_name\x18\x02 \x01(\tR\tagentName\"I\n" + - "\x13DeleteAgentResponse\x12\x18\n" + - "\asuccess\x18\x01 \x01(\bR\asuccess\x12\x18\n" + - "\amessage\x18\x02 \x01(\tR\amessage\"_\n" + - "\x17ListAgentSecretsRequest\x12%\n" + - "\bagent_id\x18\x01 \x01(\tB\n" + - "\xbaP\aagentIDR\aagentId\x12\x1d\n" + - "\n" + - "agent_name\x18\x02 \x01(\tR\tagentName\"J\n" + - "\x18ListAgentSecretsResponse\x12.\n" + - "\asecrets\x18\x01 \x03(\v2\x14.livekit.AgentSecretR\asecrets\"9\n" + - "\rSettingsParam\x12\x12\n" + - "\x04name\x18\x01 \x01(\tR\x04name\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value\"H\n" + - "\x16ClientSettingsResponse\x12.\n" + - "\x06params\x18\x01 \x03(\v2\x16.livekit.SettingsParamR\x06params\"\x17\n" + - "\x15ClientSettingsRequest\"\xe6\x02\n" + - "\vPrivateLink\x128\n" + - "\x0fprivate_link_id\x18\x01 \x01(\tB\x10\xbaP\rprivateLinkIDR\rprivateLinkId\x12\x12\n" + - "\x04name\x18\x02 \x01(\tR\x04name\x12\x16\n" + - "\x06region\x18\x04 \x01(\tR\x06region\x12\x12\n" + - "\x04port\x18\x05 \x01(\rR\x04port\x12\x1a\n" + - "\bendpoint\x18\x06 \x01(\tR\bendpoint\x12/\n" + - "\x13connection_endpoint\x18\a \x01(\tR\x12connectionEndpoint\x12!\n" + - "\fcloud_region\x18\b \x01(\tR\vcloudRegion\x126\n" + - "\x03aws\x18\x03 \x01(\v2\x1e.livekit.PrivateLink.AWSConfigB\x02\x18\x01H\x00R\x03aws\x1a+\n" + - "\tAWSConfig\x12\x1e\n" + - "\bendpoint\x18\x01 \x01(\tB\x02\x18\x01R\bendpointB\b\n" + - "\x06config\"\x83\x03\n" + - "\x11PrivateLinkStatus\x129\n" + - "\x06status\x18\x01 \x01(\x0e2!.livekit.PrivateLinkStatus.StatusR\x06status\x129\n" + - "\n" + - "updated_at\x18\x02 \x01(\v2\x1a.google.protobuf.TimestampR\tupdatedAt\x12\x16\n" + - "\x06reason\x18\x03 \x01(\tR\x06reason\"\xdf\x01\n" + - "\x06Status\x12\x1f\n" + - "\x1bPRIVATE_LINK_STATUS_UNKNOWN\x10\x00\x12$\n" + - " PRIVATE_LINK_STATUS_PROVISIONING\x10\x01\x12(\n" + - "$PRIVATE_LINK_STATUS_PENDING_APPROVAL\x10\x02\x12\x1f\n" + - "\x1bPRIVATE_LINK_STATUS_HEALTHY\x10\x03\x12!\n" + - "\x1dPRIVATE_LINK_STATUS_UNHEALTHY\x10\x04\x12 \n" + - "\x1cPRIVATE_LINK_STATUS_APPROVED\x10\x05\"\xb7\x02\n" + - "\x18CreatePrivateLinkRequest\x12\x12\n" + - "\x04name\x18\x01 \x01(\tR\x04name\x12\x16\n" + - "\x06region\x18\x03 \x01(\tR\x06region\x12\x12\n" + - "\x04port\x18\x04 \x01(\rR\x04port\x12\x1a\n" + - "\bendpoint\x18\x05 \x01(\tR\bendpoint\x12&\n" + - "\fcloud_region\x18\x06 \x01(\tH\x01R\vcloudRegion\x88\x01\x01\x12I\n" + - "\x03aws\x18\x02 \x01(\v21.livekit.CreatePrivateLinkRequest.AWSCreateConfigB\x02\x18\x01H\x00R\x03aws\x1a1\n" + - "\x0fAWSCreateConfig\x12\x1e\n" + - "\bendpoint\x18\x01 \x01(\tB\x02\x18\x01R\bendpointB\b\n" + - "\x06configB\x0f\n" + - "\r_cloud_region\"T\n" + - "\x19CreatePrivateLinkResponse\x127\n" + - "\fprivate_link\x18\x01 \x01(\v2\x14.livekit.PrivateLinkR\vprivateLink\"U\n" + - "\x19DestroyPrivateLinkRequest\x128\n" + - "\x0fprivate_link_id\x18\x01 \x01(\tB\x10\xbaP\rprivateLinkIDR\rprivateLinkId\"\x1c\n" + - "\x1aDestroyPrivateLinkResponse\"\x19\n" + - "\x17ListPrivateLinksRequest\"F\n" + - "\x18ListPrivateLinksResponse\x12*\n" + - "\x05items\x18\x01 \x03(\v2\x14.livekit.PrivateLinkR\x05items\"W\n" + - "\x1bGetPrivateLinkStatusRequest\x128\n" + - "\x0fprivate_link_id\x18\x01 \x01(\tB\x10\xbaP\rprivateLinkIDR\rprivateLinkId\"P\n" + - "\x1cGetPrivateLinkStatusResponse\x120\n" + - "\x05value\x18\x01 \x01(\v2\x1a.livekit.PrivateLinkStatusR\x05value*o\n" + - "\x0fAgentSecretKind\x12\x1d\n" + - "\x19AGENT_SECRET_KIND_UNKNOWN\x10\x00\x12!\n" + - "\x1dAGENT_SECRET_KIND_ENVIRONMENT\x10\x01\x12\x1a\n" + - "\x16AGENT_SECRET_KIND_FILE\x10\x02*\xba\x01\n" + - "\x0eAgentEventType\x12\x1c\n" + - "\x18AGENT_EVENT_TYPE_UNKNOWN\x10\x00\x12(\n" + - "$AGENT_EVENT_TYPE_APPLICATION_CRASHED\x10\x01\x12.\n" + - "*AGENT_EVENT_TYPE_RESTARTED_HIGH_DISK_USAGE\x10\x02\x120\n" + - ",AGENT_EVENT_TYPE_RESTARTED_HIGH_MEMORY_USAGE\x10\x032\x99\n" + - "\n" + - "\n" + - "CloudAgent\x12J\n" + - "\vCreateAgent\x12\x1b.livekit.CreateAgentRequest\x1a\x1c.livekit.CreateAgentResponse\"\x00\x12G\n" + - "\n" + - "ListAgents\x12\x1a.livekit.ListAgentsRequest\x1a\x1b.livekit.ListAgentsResponse\"\x00\x12\\\n" + - "\x11ListAgentVersions\x12!.livekit.ListAgentVersionsRequest\x1a\".livekit.ListAgentVersionsResponse\"\x00\x12Y\n" + - "\x10ListAgentSecrets\x12 .livekit.ListAgentSecretsRequest\x1a!.livekit.ListAgentSecretsResponse\"\x00\x12J\n" + - "\vUpdateAgent\x12\x1b.livekit.UpdateAgentRequest\x1a\x1c.livekit.UpdateAgentResponse\"\x00\x12M\n" + - "\fRestartAgent\x12\x1c.livekit.RestartAgentRequest\x1a\x1d.livekit.RestartAgentResponse\"\x00\x12J\n" + - "\vDeployAgent\x12\x1b.livekit.DeployAgentRequest\x1a\x1c.livekit.DeployAgentResponse\"\x00\x12_\n" + - "\x12UpdateAgentSecrets\x12\".livekit.UpdateAgentSecretsRequest\x1a#.livekit.UpdateAgentSecretsResponse\"\x00\x12P\n" + - "\rRollbackAgent\x12\x1d.livekit.RollbackAgentRequest\x1a\x1e.livekit.RollbackAgentResponse\"\x00\x12J\n" + - "\vDeleteAgent\x12\x1b.livekit.DeleteAgentRequest\x1a\x1c.livekit.DeleteAgentResponse\"\x00\x12V\n" + - "\x11GetClientSettings\x12\x1e.livekit.ClientSettingsRequest\x1a\x1f.livekit.ClientSettingsResponse\"\x00\x12\\\n" + - "\x11CreatePrivateLink\x12!.livekit.CreatePrivateLinkRequest\x1a\".livekit.CreatePrivateLinkResponse\"\x00\x12_\n" + - "\x12DestroyPrivateLink\x12\".livekit.DestroyPrivateLinkRequest\x1a#.livekit.DestroyPrivateLinkResponse\"\x00\x12Y\n" + - "\x10ListPrivateLinks\x12 .livekit.ListPrivateLinksRequest\x1a!.livekit.ListPrivateLinksResponse\"\x00\x12e\n" + - "\x14GetPrivateLinkStatus\x12$.livekit.GetPrivateLinkStatusRequest\x1a%.livekit.GetPrivateLinkStatusResponse\"\x00BFZ#github.com/livekit/protocol/livekit\xaa\x02\rLiveKit.Proto\xea\x02\x0eLiveKit::Protob\x06proto3" - -var ( - file_livekit_cloud_agent_proto_rawDescOnce sync.Once - file_livekit_cloud_agent_proto_rawDescData []byte -) - -func file_livekit_cloud_agent_proto_rawDescGZIP() []byte { - file_livekit_cloud_agent_proto_rawDescOnce.Do(func() { - file_livekit_cloud_agent_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_livekit_cloud_agent_proto_rawDesc), len(file_livekit_cloud_agent_proto_rawDesc))) - }) - return file_livekit_cloud_agent_proto_rawDescData -} - -var file_livekit_cloud_agent_proto_enumTypes = make([]protoimpl.EnumInfo, 3) -var file_livekit_cloud_agent_proto_msgTypes = make([]protoimpl.MessageInfo, 43) -var file_livekit_cloud_agent_proto_goTypes = []any{ - (AgentSecretKind)(0), // 0: livekit.AgentSecretKind - (AgentEventType)(0), // 1: livekit.AgentEventType - (PrivateLinkStatus_Status)(0), // 2: livekit.PrivateLinkStatus.Status - (*AgentEvent)(nil), // 3: livekit.AgentEvent - (*AgentSecret)(nil), // 4: livekit.AgentSecret - (*CreateAgentRequest)(nil), // 5: livekit.CreateAgentRequest - (*CreateAgentResponse)(nil), // 6: livekit.CreateAgentResponse - (*PresignedPostRequest)(nil), // 7: livekit.PresignedPostRequest - (*AgentDeployment)(nil), // 8: livekit.AgentDeployment - (*AgentInfo)(nil), // 9: livekit.AgentInfo - (*ListAgentsRequest)(nil), // 10: livekit.ListAgentsRequest - (*ListAgentsResponse)(nil), // 11: livekit.ListAgentsResponse - (*AgentVersion)(nil), // 12: livekit.AgentVersion - (*ListAgentVersionsRequest)(nil), // 13: livekit.ListAgentVersionsRequest - (*ListAgentVersionsResponse)(nil), // 14: livekit.ListAgentVersionsResponse - (*UpdateAgentRequest)(nil), // 15: livekit.UpdateAgentRequest - (*UpdateAgentResponse)(nil), // 16: livekit.UpdateAgentResponse - (*RestartAgentRequest)(nil), // 17: livekit.RestartAgentRequest - (*RestartAgentResponse)(nil), // 18: livekit.RestartAgentResponse - (*DeployAgentRequest)(nil), // 19: livekit.DeployAgentRequest - (*DeployAgentResponse)(nil), // 20: livekit.DeployAgentResponse - (*UpdateAgentSecretsRequest)(nil), // 21: livekit.UpdateAgentSecretsRequest - (*UpdateAgentSecretsResponse)(nil), // 22: livekit.UpdateAgentSecretsResponse - (*RollbackAgentRequest)(nil), // 23: livekit.RollbackAgentRequest - (*RollbackAgentResponse)(nil), // 24: livekit.RollbackAgentResponse - (*DeleteAgentRequest)(nil), // 25: livekit.DeleteAgentRequest - (*DeleteAgentResponse)(nil), // 26: livekit.DeleteAgentResponse - (*ListAgentSecretsRequest)(nil), // 27: livekit.ListAgentSecretsRequest - (*ListAgentSecretsResponse)(nil), // 28: livekit.ListAgentSecretsResponse - (*SettingsParam)(nil), // 29: livekit.SettingsParam - (*ClientSettingsResponse)(nil), // 30: livekit.ClientSettingsResponse - (*ClientSettingsRequest)(nil), // 31: livekit.ClientSettingsRequest - (*PrivateLink)(nil), // 32: livekit.PrivateLink - (*PrivateLinkStatus)(nil), // 33: livekit.PrivateLinkStatus - (*CreatePrivateLinkRequest)(nil), // 34: livekit.CreatePrivateLinkRequest - (*CreatePrivateLinkResponse)(nil), // 35: livekit.CreatePrivateLinkResponse - (*DestroyPrivateLinkRequest)(nil), // 36: livekit.DestroyPrivateLinkRequest - (*DestroyPrivateLinkResponse)(nil), // 37: livekit.DestroyPrivateLinkResponse - (*ListPrivateLinksRequest)(nil), // 38: livekit.ListPrivateLinksRequest - (*ListPrivateLinksResponse)(nil), // 39: livekit.ListPrivateLinksResponse - (*GetPrivateLinkStatusRequest)(nil), // 40: livekit.GetPrivateLinkStatusRequest - (*GetPrivateLinkStatusResponse)(nil), // 41: livekit.GetPrivateLinkStatusResponse - nil, // 42: livekit.PresignedPostRequest.ValuesEntry - nil, // 43: livekit.AgentVersion.AttributesEntry - (*PrivateLink_AWSConfig)(nil), // 44: livekit.PrivateLink.AWSConfig - (*CreatePrivateLinkRequest_AWSCreateConfig)(nil), // 45: livekit.CreatePrivateLinkRequest.AWSCreateConfig - (*timestamppb.Timestamp)(nil), // 46: google.protobuf.Timestamp -} -var file_livekit_cloud_agent_proto_depIdxs = []int32{ - 1, // 0: livekit.AgentEvent.type:type_name -> livekit.AgentEventType - 46, // 1: livekit.AgentEvent.timestamp:type_name -> google.protobuf.Timestamp - 46, // 2: livekit.AgentSecret.created_at:type_name -> google.protobuf.Timestamp - 46, // 3: livekit.AgentSecret.updated_at:type_name -> google.protobuf.Timestamp - 0, // 4: livekit.AgentSecret.kind:type_name -> livekit.AgentSecretKind - 4, // 5: livekit.CreateAgentRequest.secrets:type_name -> livekit.AgentSecret - 7, // 6: livekit.CreateAgentResponse.presigned_post_request:type_name -> livekit.PresignedPostRequest - 42, // 7: livekit.PresignedPostRequest.values:type_name -> livekit.PresignedPostRequest.ValuesEntry - 3, // 8: livekit.AgentDeployment.events:type_name -> livekit.AgentEvent - 8, // 9: livekit.AgentInfo.agent_deployments:type_name -> livekit.AgentDeployment - 4, // 10: livekit.AgentInfo.secrets:type_name -> livekit.AgentSecret - 46, // 11: livekit.AgentInfo.deployed_at:type_name -> google.protobuf.Timestamp - 9, // 12: livekit.ListAgentsResponse.agents:type_name -> livekit.AgentInfo - 46, // 13: livekit.AgentVersion.created_at:type_name -> google.protobuf.Timestamp - 46, // 14: livekit.AgentVersion.deployed_at:type_name -> google.protobuf.Timestamp - 43, // 15: livekit.AgentVersion.attributes:type_name -> livekit.AgentVersion.AttributesEntry - 12, // 16: livekit.ListAgentVersionsResponse.versions:type_name -> livekit.AgentVersion - 4, // 17: livekit.UpdateAgentRequest.secrets:type_name -> livekit.AgentSecret - 4, // 18: livekit.DeployAgentRequest.secrets:type_name -> livekit.AgentSecret - 7, // 19: livekit.DeployAgentResponse.presigned_post_request:type_name -> livekit.PresignedPostRequest - 4, // 20: livekit.UpdateAgentSecretsRequest.secrets:type_name -> livekit.AgentSecret - 4, // 21: livekit.ListAgentSecretsResponse.secrets:type_name -> livekit.AgentSecret - 29, // 22: livekit.ClientSettingsResponse.params:type_name -> livekit.SettingsParam - 44, // 23: livekit.PrivateLink.aws:type_name -> livekit.PrivateLink.AWSConfig - 2, // 24: livekit.PrivateLinkStatus.status:type_name -> livekit.PrivateLinkStatus.Status - 46, // 25: livekit.PrivateLinkStatus.updated_at:type_name -> google.protobuf.Timestamp - 45, // 26: livekit.CreatePrivateLinkRequest.aws:type_name -> livekit.CreatePrivateLinkRequest.AWSCreateConfig - 32, // 27: livekit.CreatePrivateLinkResponse.private_link:type_name -> livekit.PrivateLink - 32, // 28: livekit.ListPrivateLinksResponse.items:type_name -> livekit.PrivateLink - 33, // 29: livekit.GetPrivateLinkStatusResponse.value:type_name -> livekit.PrivateLinkStatus - 5, // 30: livekit.CloudAgent.CreateAgent:input_type -> livekit.CreateAgentRequest - 10, // 31: livekit.CloudAgent.ListAgents:input_type -> livekit.ListAgentsRequest - 13, // 32: livekit.CloudAgent.ListAgentVersions:input_type -> livekit.ListAgentVersionsRequest - 27, // 33: livekit.CloudAgent.ListAgentSecrets:input_type -> livekit.ListAgentSecretsRequest - 15, // 34: livekit.CloudAgent.UpdateAgent:input_type -> livekit.UpdateAgentRequest - 17, // 35: livekit.CloudAgent.RestartAgent:input_type -> livekit.RestartAgentRequest - 19, // 36: livekit.CloudAgent.DeployAgent:input_type -> livekit.DeployAgentRequest - 21, // 37: livekit.CloudAgent.UpdateAgentSecrets:input_type -> livekit.UpdateAgentSecretsRequest - 23, // 38: livekit.CloudAgent.RollbackAgent:input_type -> livekit.RollbackAgentRequest - 25, // 39: livekit.CloudAgent.DeleteAgent:input_type -> livekit.DeleteAgentRequest - 31, // 40: livekit.CloudAgent.GetClientSettings:input_type -> livekit.ClientSettingsRequest - 34, // 41: livekit.CloudAgent.CreatePrivateLink:input_type -> livekit.CreatePrivateLinkRequest - 36, // 42: livekit.CloudAgent.DestroyPrivateLink:input_type -> livekit.DestroyPrivateLinkRequest - 38, // 43: livekit.CloudAgent.ListPrivateLinks:input_type -> livekit.ListPrivateLinksRequest - 40, // 44: livekit.CloudAgent.GetPrivateLinkStatus:input_type -> livekit.GetPrivateLinkStatusRequest - 6, // 45: livekit.CloudAgent.CreateAgent:output_type -> livekit.CreateAgentResponse - 11, // 46: livekit.CloudAgent.ListAgents:output_type -> livekit.ListAgentsResponse - 14, // 47: livekit.CloudAgent.ListAgentVersions:output_type -> livekit.ListAgentVersionsResponse - 28, // 48: livekit.CloudAgent.ListAgentSecrets:output_type -> livekit.ListAgentSecretsResponse - 16, // 49: livekit.CloudAgent.UpdateAgent:output_type -> livekit.UpdateAgentResponse - 18, // 50: livekit.CloudAgent.RestartAgent:output_type -> livekit.RestartAgentResponse - 20, // 51: livekit.CloudAgent.DeployAgent:output_type -> livekit.DeployAgentResponse - 22, // 52: livekit.CloudAgent.UpdateAgentSecrets:output_type -> livekit.UpdateAgentSecretsResponse - 24, // 53: livekit.CloudAgent.RollbackAgent:output_type -> livekit.RollbackAgentResponse - 26, // 54: livekit.CloudAgent.DeleteAgent:output_type -> livekit.DeleteAgentResponse - 30, // 55: livekit.CloudAgent.GetClientSettings:output_type -> livekit.ClientSettingsResponse - 35, // 56: livekit.CloudAgent.CreatePrivateLink:output_type -> livekit.CreatePrivateLinkResponse - 37, // 57: livekit.CloudAgent.DestroyPrivateLink:output_type -> livekit.DestroyPrivateLinkResponse - 39, // 58: livekit.CloudAgent.ListPrivateLinks:output_type -> livekit.ListPrivateLinksResponse - 41, // 59: livekit.CloudAgent.GetPrivateLinkStatus:output_type -> livekit.GetPrivateLinkStatusResponse - 45, // [45:60] is the sub-list for method output_type - 30, // [30:45] is the sub-list for method input_type - 30, // [30:30] is the sub-list for extension type_name - 30, // [30:30] is the sub-list for extension extendee - 0, // [0:30] is the sub-list for field type_name -} - -func init() { file_livekit_cloud_agent_proto_init() } -func file_livekit_cloud_agent_proto_init() { - if File_livekit_cloud_agent_proto != nil { - return - } - file_livekit_cloud_agent_proto_msgTypes[29].OneofWrappers = []any{ - (*PrivateLink_Aws)(nil), - } - file_livekit_cloud_agent_proto_msgTypes[31].OneofWrappers = []any{ - (*CreatePrivateLinkRequest_Aws)(nil), - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_livekit_cloud_agent_proto_rawDesc), len(file_livekit_cloud_agent_proto_rawDesc)), - NumEnums: 3, - NumMessages: 43, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_livekit_cloud_agent_proto_goTypes, - DependencyIndexes: file_livekit_cloud_agent_proto_depIdxs, - EnumInfos: file_livekit_cloud_agent_proto_enumTypes, - MessageInfos: file_livekit_cloud_agent_proto_msgTypes, - }.Build() - File_livekit_cloud_agent_proto = out.File - file_livekit_cloud_agent_proto_goTypes = nil - file_livekit_cloud_agent_proto_depIdxs = nil -} diff --git a/protobufs/livekit_cloud_agent.proto b/protobufs/livekit_cloud_agent.proto index ce9959311..998244dd8 100644 --- a/protobufs/livekit_cloud_agent.proto +++ b/protobufs/livekit_cloud_agent.proto @@ -47,6 +47,7 @@ message AgentSecret { google.protobuf.Timestamp created_at = 3; google.protobuf.Timestamp updated_at = 4; AgentSecretKind kind = 5; + repeated string environments = 6; } message CreateAgentRequest { @@ -56,6 +57,7 @@ message CreateAgentRequest { int32 max_replicas = 4 [deprecated=true]; string cpu_req = 5 [deprecated=true]; repeated string regions = 6; + string environment = 7; } message CreateAgentResponse { @@ -67,6 +69,7 @@ message CreateAgentResponse { string tag = 6; repeated string server_regions = 7; PresignedPostRequest presigned_post_request = 8; + string environment = 9; } message PresignedPostRequest { @@ -89,6 +92,7 @@ message AgentDeployment { string cpu_limit = 12; string server_region = 13; repeated AgentEvent events = 14; + string environment = 15; } message AgentInfo { @@ -160,6 +164,7 @@ message DeployAgentRequest { int32 replicas = 4 [deprecated=true]; int32 max_replicas = 5 [deprecated=true]; string cpu_req = 6 [deprecated=true]; + string environment = 7; } message DeployAgentResponse { From 4158a2d48638837e670303ec33d45cc075416150 Mon Sep 17 00:00:00 2001 From: Steve Yoon Date: Wed, 8 Apr 2026 09:26:18 -0400 Subject: [PATCH 2/8] remove env from create agent API --- protobufs/livekit_cloud_agent.proto | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/protobufs/livekit_cloud_agent.proto b/protobufs/livekit_cloud_agent.proto index 998244dd8..892fd836c 100644 --- a/protobufs/livekit_cloud_agent.proto +++ b/protobufs/livekit_cloud_agent.proto @@ -57,7 +57,6 @@ message CreateAgentRequest { int32 max_replicas = 4 [deprecated=true]; string cpu_req = 5 [deprecated=true]; repeated string regions = 6; - string environment = 7; } message CreateAgentResponse { @@ -69,7 +68,6 @@ message CreateAgentResponse { string tag = 6; repeated string server_regions = 7; PresignedPostRequest presigned_post_request = 8; - string environment = 9; } message PresignedPostRequest { @@ -174,6 +172,7 @@ message DeployAgentResponse { string presigned_url = 4; string tag = 5; PresignedPostRequest presigned_post_request = 6; + string environment = 7; } message UpdateAgentSecretsRequest { From 9561b442b4b1c15c29913a7494d97e0f54a1dfe6 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 8 Apr 2026 13:27:20 +0000 Subject: [PATCH 3/8] generated protobuf --- livekit/livekit_cloud_agent.twirp.go | 4568 -------------------------- 1 file changed, 4568 deletions(-) delete mode 100644 livekit/livekit_cloud_agent.twirp.go diff --git a/livekit/livekit_cloud_agent.twirp.go b/livekit/livekit_cloud_agent.twirp.go deleted file mode 100644 index 34a1010c9..000000000 --- a/livekit/livekit_cloud_agent.twirp.go +++ /dev/null @@ -1,4568 +0,0 @@ -// Code generated by protoc-gen-twirp v8.1.3, DO NOT EDIT. -// source: livekit_cloud_agent.proto - -package livekit - -import context "context" -import fmt "fmt" -import http "net/http" -import io "io" -import json "encoding/json" -import strconv "strconv" -import strings "strings" - -import protojson "google.golang.org/protobuf/encoding/protojson" -import proto "google.golang.org/protobuf/proto" -import twirp "github.com/twitchtv/twirp" -import ctxsetters "github.com/twitchtv/twirp/ctxsetters" - -// Version compatibility assertion. -// If the constant is not defined in the package, that likely means -// the package needs to be updated to work with this generated code. -// See https://twitchtv.github.io/twirp/docs/version_matrix.html -const _ = twirp.TwirpPackageMinVersion_8_1_0 - -// ==================== -// CloudAgent Interface -// ==================== - -type CloudAgent interface { - CreateAgent(context.Context, *CreateAgentRequest) (*CreateAgentResponse, error) - - ListAgents(context.Context, *ListAgentsRequest) (*ListAgentsResponse, error) - - ListAgentVersions(context.Context, *ListAgentVersionsRequest) (*ListAgentVersionsResponse, error) - - ListAgentSecrets(context.Context, *ListAgentSecretsRequest) (*ListAgentSecretsResponse, error) - - UpdateAgent(context.Context, *UpdateAgentRequest) (*UpdateAgentResponse, error) - - RestartAgent(context.Context, *RestartAgentRequest) (*RestartAgentResponse, error) - - DeployAgent(context.Context, *DeployAgentRequest) (*DeployAgentResponse, error) - - UpdateAgentSecrets(context.Context, *UpdateAgentSecretsRequest) (*UpdateAgentSecretsResponse, error) - - RollbackAgent(context.Context, *RollbackAgentRequest) (*RollbackAgentResponse, error) - - DeleteAgent(context.Context, *DeleteAgentRequest) (*DeleteAgentResponse, error) - - GetClientSettings(context.Context, *ClientSettingsRequest) (*ClientSettingsResponse, error) - - CreatePrivateLink(context.Context, *CreatePrivateLinkRequest) (*CreatePrivateLinkResponse, error) - - DestroyPrivateLink(context.Context, *DestroyPrivateLinkRequest) (*DestroyPrivateLinkResponse, error) - - ListPrivateLinks(context.Context, *ListPrivateLinksRequest) (*ListPrivateLinksResponse, error) - - GetPrivateLinkStatus(context.Context, *GetPrivateLinkStatusRequest) (*GetPrivateLinkStatusResponse, error) -} - -// ========================== -// CloudAgent Protobuf Client -// ========================== - -type cloudAgentProtobufClient struct { - client HTTPClient - urls [15]string - interceptor twirp.Interceptor - opts twirp.ClientOptions -} - -// NewCloudAgentProtobufClient creates a Protobuf client that implements the CloudAgent interface. -// It communicates using Protobuf and can be configured with a custom HTTPClient. -func NewCloudAgentProtobufClient(baseURL string, client HTTPClient, opts ...twirp.ClientOption) CloudAgent { - if c, ok := client.(*http.Client); ok { - client = withoutRedirects(c) - } - - clientOpts := twirp.ClientOptions{} - for _, o := range opts { - o(&clientOpts) - } - - // Using ReadOpt allows backwards and forwards compatibility with new options in the future - literalURLs := false - _ = clientOpts.ReadOpt("literalURLs", &literalURLs) - var pathPrefix string - if ok := clientOpts.ReadOpt("pathPrefix", &pathPrefix); !ok { - pathPrefix = "/twirp" // default prefix - } - - // Build method URLs: []/./ - serviceURL := sanitizeBaseURL(baseURL) - serviceURL += baseServicePath(pathPrefix, "livekit", "CloudAgent") - urls := [15]string{ - serviceURL + "CreateAgent", - serviceURL + "ListAgents", - serviceURL + "ListAgentVersions", - serviceURL + "ListAgentSecrets", - serviceURL + "UpdateAgent", - serviceURL + "RestartAgent", - serviceURL + "DeployAgent", - serviceURL + "UpdateAgentSecrets", - serviceURL + "RollbackAgent", - serviceURL + "DeleteAgent", - serviceURL + "GetClientSettings", - serviceURL + "CreatePrivateLink", - serviceURL + "DestroyPrivateLink", - serviceURL + "ListPrivateLinks", - serviceURL + "GetPrivateLinkStatus", - } - - return &cloudAgentProtobufClient{ - client: client, - urls: urls, - interceptor: twirp.ChainInterceptors(clientOpts.Interceptors...), - opts: clientOpts, - } -} - -func (c *cloudAgentProtobufClient) CreateAgent(ctx context.Context, in *CreateAgentRequest) (*CreateAgentResponse, error) { - ctx = ctxsetters.WithPackageName(ctx, "livekit") - ctx = ctxsetters.WithServiceName(ctx, "CloudAgent") - ctx = ctxsetters.WithMethodName(ctx, "CreateAgent") - caller := c.callCreateAgent - if c.interceptor != nil { - caller = func(ctx context.Context, req *CreateAgentRequest) (*CreateAgentResponse, error) { - resp, err := c.interceptor( - func(ctx context.Context, req interface{}) (interface{}, error) { - typedReq, ok := req.(*CreateAgentRequest) - if !ok { - return nil, twirp.InternalError("failed type assertion req.(*CreateAgentRequest) when calling interceptor") - } - return c.callCreateAgent(ctx, typedReq) - }, - )(ctx, req) - if resp != nil { - typedResp, ok := resp.(*CreateAgentResponse) - if !ok { - return nil, twirp.InternalError("failed type assertion resp.(*CreateAgentResponse) when calling interceptor") - } - return typedResp, err - } - return nil, err - } - } - return caller(ctx, in) -} - -func (c *cloudAgentProtobufClient) callCreateAgent(ctx context.Context, in *CreateAgentRequest) (*CreateAgentResponse, error) { - out := new(CreateAgentResponse) - ctx, err := doProtobufRequest(ctx, c.client, c.opts.Hooks, c.urls[0], in, out) - if err != nil { - twerr, ok := err.(twirp.Error) - if !ok { - twerr = twirp.InternalErrorWith(err) - } - callClientError(ctx, c.opts.Hooks, twerr) - return nil, err - } - - callClientResponseReceived(ctx, c.opts.Hooks) - - return out, nil -} - -func (c *cloudAgentProtobufClient) ListAgents(ctx context.Context, in *ListAgentsRequest) (*ListAgentsResponse, error) { - ctx = ctxsetters.WithPackageName(ctx, "livekit") - ctx = ctxsetters.WithServiceName(ctx, "CloudAgent") - ctx = ctxsetters.WithMethodName(ctx, "ListAgents") - caller := c.callListAgents - if c.interceptor != nil { - caller = func(ctx context.Context, req *ListAgentsRequest) (*ListAgentsResponse, error) { - resp, err := c.interceptor( - func(ctx context.Context, req interface{}) (interface{}, error) { - typedReq, ok := req.(*ListAgentsRequest) - if !ok { - return nil, twirp.InternalError("failed type assertion req.(*ListAgentsRequest) when calling interceptor") - } - return c.callListAgents(ctx, typedReq) - }, - )(ctx, req) - if resp != nil { - typedResp, ok := resp.(*ListAgentsResponse) - if !ok { - return nil, twirp.InternalError("failed type assertion resp.(*ListAgentsResponse) when calling interceptor") - } - return typedResp, err - } - return nil, err - } - } - return caller(ctx, in) -} - -func (c *cloudAgentProtobufClient) callListAgents(ctx context.Context, in *ListAgentsRequest) (*ListAgentsResponse, error) { - out := new(ListAgentsResponse) - ctx, err := doProtobufRequest(ctx, c.client, c.opts.Hooks, c.urls[1], in, out) - if err != nil { - twerr, ok := err.(twirp.Error) - if !ok { - twerr = twirp.InternalErrorWith(err) - } - callClientError(ctx, c.opts.Hooks, twerr) - return nil, err - } - - callClientResponseReceived(ctx, c.opts.Hooks) - - return out, nil -} - -func (c *cloudAgentProtobufClient) ListAgentVersions(ctx context.Context, in *ListAgentVersionsRequest) (*ListAgentVersionsResponse, error) { - ctx = ctxsetters.WithPackageName(ctx, "livekit") - ctx = ctxsetters.WithServiceName(ctx, "CloudAgent") - ctx = ctxsetters.WithMethodName(ctx, "ListAgentVersions") - caller := c.callListAgentVersions - if c.interceptor != nil { - caller = func(ctx context.Context, req *ListAgentVersionsRequest) (*ListAgentVersionsResponse, error) { - resp, err := c.interceptor( - func(ctx context.Context, req interface{}) (interface{}, error) { - typedReq, ok := req.(*ListAgentVersionsRequest) - if !ok { - return nil, twirp.InternalError("failed type assertion req.(*ListAgentVersionsRequest) when calling interceptor") - } - return c.callListAgentVersions(ctx, typedReq) - }, - )(ctx, req) - if resp != nil { - typedResp, ok := resp.(*ListAgentVersionsResponse) - if !ok { - return nil, twirp.InternalError("failed type assertion resp.(*ListAgentVersionsResponse) when calling interceptor") - } - return typedResp, err - } - return nil, err - } - } - return caller(ctx, in) -} - -func (c *cloudAgentProtobufClient) callListAgentVersions(ctx context.Context, in *ListAgentVersionsRequest) (*ListAgentVersionsResponse, error) { - out := new(ListAgentVersionsResponse) - ctx, err := doProtobufRequest(ctx, c.client, c.opts.Hooks, c.urls[2], in, out) - if err != nil { - twerr, ok := err.(twirp.Error) - if !ok { - twerr = twirp.InternalErrorWith(err) - } - callClientError(ctx, c.opts.Hooks, twerr) - return nil, err - } - - callClientResponseReceived(ctx, c.opts.Hooks) - - return out, nil -} - -func (c *cloudAgentProtobufClient) ListAgentSecrets(ctx context.Context, in *ListAgentSecretsRequest) (*ListAgentSecretsResponse, error) { - ctx = ctxsetters.WithPackageName(ctx, "livekit") - ctx = ctxsetters.WithServiceName(ctx, "CloudAgent") - ctx = ctxsetters.WithMethodName(ctx, "ListAgentSecrets") - caller := c.callListAgentSecrets - if c.interceptor != nil { - caller = func(ctx context.Context, req *ListAgentSecretsRequest) (*ListAgentSecretsResponse, error) { - resp, err := c.interceptor( - func(ctx context.Context, req interface{}) (interface{}, error) { - typedReq, ok := req.(*ListAgentSecretsRequest) - if !ok { - return nil, twirp.InternalError("failed type assertion req.(*ListAgentSecretsRequest) when calling interceptor") - } - return c.callListAgentSecrets(ctx, typedReq) - }, - )(ctx, req) - if resp != nil { - typedResp, ok := resp.(*ListAgentSecretsResponse) - if !ok { - return nil, twirp.InternalError("failed type assertion resp.(*ListAgentSecretsResponse) when calling interceptor") - } - return typedResp, err - } - return nil, err - } - } - return caller(ctx, in) -} - -func (c *cloudAgentProtobufClient) callListAgentSecrets(ctx context.Context, in *ListAgentSecretsRequest) (*ListAgentSecretsResponse, error) { - out := new(ListAgentSecretsResponse) - ctx, err := doProtobufRequest(ctx, c.client, c.opts.Hooks, c.urls[3], in, out) - if err != nil { - twerr, ok := err.(twirp.Error) - if !ok { - twerr = twirp.InternalErrorWith(err) - } - callClientError(ctx, c.opts.Hooks, twerr) - return nil, err - } - - callClientResponseReceived(ctx, c.opts.Hooks) - - return out, nil -} - -func (c *cloudAgentProtobufClient) UpdateAgent(ctx context.Context, in *UpdateAgentRequest) (*UpdateAgentResponse, error) { - ctx = ctxsetters.WithPackageName(ctx, "livekit") - ctx = ctxsetters.WithServiceName(ctx, "CloudAgent") - ctx = ctxsetters.WithMethodName(ctx, "UpdateAgent") - caller := c.callUpdateAgent - if c.interceptor != nil { - caller = func(ctx context.Context, req *UpdateAgentRequest) (*UpdateAgentResponse, error) { - resp, err := c.interceptor( - func(ctx context.Context, req interface{}) (interface{}, error) { - typedReq, ok := req.(*UpdateAgentRequest) - if !ok { - return nil, twirp.InternalError("failed type assertion req.(*UpdateAgentRequest) when calling interceptor") - } - return c.callUpdateAgent(ctx, typedReq) - }, - )(ctx, req) - if resp != nil { - typedResp, ok := resp.(*UpdateAgentResponse) - if !ok { - return nil, twirp.InternalError("failed type assertion resp.(*UpdateAgentResponse) when calling interceptor") - } - return typedResp, err - } - return nil, err - } - } - return caller(ctx, in) -} - -func (c *cloudAgentProtobufClient) callUpdateAgent(ctx context.Context, in *UpdateAgentRequest) (*UpdateAgentResponse, error) { - out := new(UpdateAgentResponse) - ctx, err := doProtobufRequest(ctx, c.client, c.opts.Hooks, c.urls[4], in, out) - if err != nil { - twerr, ok := err.(twirp.Error) - if !ok { - twerr = twirp.InternalErrorWith(err) - } - callClientError(ctx, c.opts.Hooks, twerr) - return nil, err - } - - callClientResponseReceived(ctx, c.opts.Hooks) - - return out, nil -} - -func (c *cloudAgentProtobufClient) RestartAgent(ctx context.Context, in *RestartAgentRequest) (*RestartAgentResponse, error) { - ctx = ctxsetters.WithPackageName(ctx, "livekit") - ctx = ctxsetters.WithServiceName(ctx, "CloudAgent") - ctx = ctxsetters.WithMethodName(ctx, "RestartAgent") - caller := c.callRestartAgent - if c.interceptor != nil { - caller = func(ctx context.Context, req *RestartAgentRequest) (*RestartAgentResponse, error) { - resp, err := c.interceptor( - func(ctx context.Context, req interface{}) (interface{}, error) { - typedReq, ok := req.(*RestartAgentRequest) - if !ok { - return nil, twirp.InternalError("failed type assertion req.(*RestartAgentRequest) when calling interceptor") - } - return c.callRestartAgent(ctx, typedReq) - }, - )(ctx, req) - if resp != nil { - typedResp, ok := resp.(*RestartAgentResponse) - if !ok { - return nil, twirp.InternalError("failed type assertion resp.(*RestartAgentResponse) when calling interceptor") - } - return typedResp, err - } - return nil, err - } - } - return caller(ctx, in) -} - -func (c *cloudAgentProtobufClient) callRestartAgent(ctx context.Context, in *RestartAgentRequest) (*RestartAgentResponse, error) { - out := new(RestartAgentResponse) - ctx, err := doProtobufRequest(ctx, c.client, c.opts.Hooks, c.urls[5], in, out) - if err != nil { - twerr, ok := err.(twirp.Error) - if !ok { - twerr = twirp.InternalErrorWith(err) - } - callClientError(ctx, c.opts.Hooks, twerr) - return nil, err - } - - callClientResponseReceived(ctx, c.opts.Hooks) - - return out, nil -} - -func (c *cloudAgentProtobufClient) DeployAgent(ctx context.Context, in *DeployAgentRequest) (*DeployAgentResponse, error) { - ctx = ctxsetters.WithPackageName(ctx, "livekit") - ctx = ctxsetters.WithServiceName(ctx, "CloudAgent") - ctx = ctxsetters.WithMethodName(ctx, "DeployAgent") - caller := c.callDeployAgent - if c.interceptor != nil { - caller = func(ctx context.Context, req *DeployAgentRequest) (*DeployAgentResponse, error) { - resp, err := c.interceptor( - func(ctx context.Context, req interface{}) (interface{}, error) { - typedReq, ok := req.(*DeployAgentRequest) - if !ok { - return nil, twirp.InternalError("failed type assertion req.(*DeployAgentRequest) when calling interceptor") - } - return c.callDeployAgent(ctx, typedReq) - }, - )(ctx, req) - if resp != nil { - typedResp, ok := resp.(*DeployAgentResponse) - if !ok { - return nil, twirp.InternalError("failed type assertion resp.(*DeployAgentResponse) when calling interceptor") - } - return typedResp, err - } - return nil, err - } - } - return caller(ctx, in) -} - -func (c *cloudAgentProtobufClient) callDeployAgent(ctx context.Context, in *DeployAgentRequest) (*DeployAgentResponse, error) { - out := new(DeployAgentResponse) - ctx, err := doProtobufRequest(ctx, c.client, c.opts.Hooks, c.urls[6], in, out) - if err != nil { - twerr, ok := err.(twirp.Error) - if !ok { - twerr = twirp.InternalErrorWith(err) - } - callClientError(ctx, c.opts.Hooks, twerr) - return nil, err - } - - callClientResponseReceived(ctx, c.opts.Hooks) - - return out, nil -} - -func (c *cloudAgentProtobufClient) UpdateAgentSecrets(ctx context.Context, in *UpdateAgentSecretsRequest) (*UpdateAgentSecretsResponse, error) { - ctx = ctxsetters.WithPackageName(ctx, "livekit") - ctx = ctxsetters.WithServiceName(ctx, "CloudAgent") - ctx = ctxsetters.WithMethodName(ctx, "UpdateAgentSecrets") - caller := c.callUpdateAgentSecrets - if c.interceptor != nil { - caller = func(ctx context.Context, req *UpdateAgentSecretsRequest) (*UpdateAgentSecretsResponse, error) { - resp, err := c.interceptor( - func(ctx context.Context, req interface{}) (interface{}, error) { - typedReq, ok := req.(*UpdateAgentSecretsRequest) - if !ok { - return nil, twirp.InternalError("failed type assertion req.(*UpdateAgentSecretsRequest) when calling interceptor") - } - return c.callUpdateAgentSecrets(ctx, typedReq) - }, - )(ctx, req) - if resp != nil { - typedResp, ok := resp.(*UpdateAgentSecretsResponse) - if !ok { - return nil, twirp.InternalError("failed type assertion resp.(*UpdateAgentSecretsResponse) when calling interceptor") - } - return typedResp, err - } - return nil, err - } - } - return caller(ctx, in) -} - -func (c *cloudAgentProtobufClient) callUpdateAgentSecrets(ctx context.Context, in *UpdateAgentSecretsRequest) (*UpdateAgentSecretsResponse, error) { - out := new(UpdateAgentSecretsResponse) - ctx, err := doProtobufRequest(ctx, c.client, c.opts.Hooks, c.urls[7], in, out) - if err != nil { - twerr, ok := err.(twirp.Error) - if !ok { - twerr = twirp.InternalErrorWith(err) - } - callClientError(ctx, c.opts.Hooks, twerr) - return nil, err - } - - callClientResponseReceived(ctx, c.opts.Hooks) - - return out, nil -} - -func (c *cloudAgentProtobufClient) RollbackAgent(ctx context.Context, in *RollbackAgentRequest) (*RollbackAgentResponse, error) { - ctx = ctxsetters.WithPackageName(ctx, "livekit") - ctx = ctxsetters.WithServiceName(ctx, "CloudAgent") - ctx = ctxsetters.WithMethodName(ctx, "RollbackAgent") - caller := c.callRollbackAgent - if c.interceptor != nil { - caller = func(ctx context.Context, req *RollbackAgentRequest) (*RollbackAgentResponse, error) { - resp, err := c.interceptor( - func(ctx context.Context, req interface{}) (interface{}, error) { - typedReq, ok := req.(*RollbackAgentRequest) - if !ok { - return nil, twirp.InternalError("failed type assertion req.(*RollbackAgentRequest) when calling interceptor") - } - return c.callRollbackAgent(ctx, typedReq) - }, - )(ctx, req) - if resp != nil { - typedResp, ok := resp.(*RollbackAgentResponse) - if !ok { - return nil, twirp.InternalError("failed type assertion resp.(*RollbackAgentResponse) when calling interceptor") - } - return typedResp, err - } - return nil, err - } - } - return caller(ctx, in) -} - -func (c *cloudAgentProtobufClient) callRollbackAgent(ctx context.Context, in *RollbackAgentRequest) (*RollbackAgentResponse, error) { - out := new(RollbackAgentResponse) - ctx, err := doProtobufRequest(ctx, c.client, c.opts.Hooks, c.urls[8], in, out) - if err != nil { - twerr, ok := err.(twirp.Error) - if !ok { - twerr = twirp.InternalErrorWith(err) - } - callClientError(ctx, c.opts.Hooks, twerr) - return nil, err - } - - callClientResponseReceived(ctx, c.opts.Hooks) - - return out, nil -} - -func (c *cloudAgentProtobufClient) DeleteAgent(ctx context.Context, in *DeleteAgentRequest) (*DeleteAgentResponse, error) { - ctx = ctxsetters.WithPackageName(ctx, "livekit") - ctx = ctxsetters.WithServiceName(ctx, "CloudAgent") - ctx = ctxsetters.WithMethodName(ctx, "DeleteAgent") - caller := c.callDeleteAgent - if c.interceptor != nil { - caller = func(ctx context.Context, req *DeleteAgentRequest) (*DeleteAgentResponse, error) { - resp, err := c.interceptor( - func(ctx context.Context, req interface{}) (interface{}, error) { - typedReq, ok := req.(*DeleteAgentRequest) - if !ok { - return nil, twirp.InternalError("failed type assertion req.(*DeleteAgentRequest) when calling interceptor") - } - return c.callDeleteAgent(ctx, typedReq) - }, - )(ctx, req) - if resp != nil { - typedResp, ok := resp.(*DeleteAgentResponse) - if !ok { - return nil, twirp.InternalError("failed type assertion resp.(*DeleteAgentResponse) when calling interceptor") - } - return typedResp, err - } - return nil, err - } - } - return caller(ctx, in) -} - -func (c *cloudAgentProtobufClient) callDeleteAgent(ctx context.Context, in *DeleteAgentRequest) (*DeleteAgentResponse, error) { - out := new(DeleteAgentResponse) - ctx, err := doProtobufRequest(ctx, c.client, c.opts.Hooks, c.urls[9], in, out) - if err != nil { - twerr, ok := err.(twirp.Error) - if !ok { - twerr = twirp.InternalErrorWith(err) - } - callClientError(ctx, c.opts.Hooks, twerr) - return nil, err - } - - callClientResponseReceived(ctx, c.opts.Hooks) - - return out, nil -} - -func (c *cloudAgentProtobufClient) GetClientSettings(ctx context.Context, in *ClientSettingsRequest) (*ClientSettingsResponse, error) { - ctx = ctxsetters.WithPackageName(ctx, "livekit") - ctx = ctxsetters.WithServiceName(ctx, "CloudAgent") - ctx = ctxsetters.WithMethodName(ctx, "GetClientSettings") - caller := c.callGetClientSettings - if c.interceptor != nil { - caller = func(ctx context.Context, req *ClientSettingsRequest) (*ClientSettingsResponse, error) { - resp, err := c.interceptor( - func(ctx context.Context, req interface{}) (interface{}, error) { - typedReq, ok := req.(*ClientSettingsRequest) - if !ok { - return nil, twirp.InternalError("failed type assertion req.(*ClientSettingsRequest) when calling interceptor") - } - return c.callGetClientSettings(ctx, typedReq) - }, - )(ctx, req) - if resp != nil { - typedResp, ok := resp.(*ClientSettingsResponse) - if !ok { - return nil, twirp.InternalError("failed type assertion resp.(*ClientSettingsResponse) when calling interceptor") - } - return typedResp, err - } - return nil, err - } - } - return caller(ctx, in) -} - -func (c *cloudAgentProtobufClient) callGetClientSettings(ctx context.Context, in *ClientSettingsRequest) (*ClientSettingsResponse, error) { - out := new(ClientSettingsResponse) - ctx, err := doProtobufRequest(ctx, c.client, c.opts.Hooks, c.urls[10], in, out) - if err != nil { - twerr, ok := err.(twirp.Error) - if !ok { - twerr = twirp.InternalErrorWith(err) - } - callClientError(ctx, c.opts.Hooks, twerr) - return nil, err - } - - callClientResponseReceived(ctx, c.opts.Hooks) - - return out, nil -} - -func (c *cloudAgentProtobufClient) CreatePrivateLink(ctx context.Context, in *CreatePrivateLinkRequest) (*CreatePrivateLinkResponse, error) { - ctx = ctxsetters.WithPackageName(ctx, "livekit") - ctx = ctxsetters.WithServiceName(ctx, "CloudAgent") - ctx = ctxsetters.WithMethodName(ctx, "CreatePrivateLink") - caller := c.callCreatePrivateLink - if c.interceptor != nil { - caller = func(ctx context.Context, req *CreatePrivateLinkRequest) (*CreatePrivateLinkResponse, error) { - resp, err := c.interceptor( - func(ctx context.Context, req interface{}) (interface{}, error) { - typedReq, ok := req.(*CreatePrivateLinkRequest) - if !ok { - return nil, twirp.InternalError("failed type assertion req.(*CreatePrivateLinkRequest) when calling interceptor") - } - return c.callCreatePrivateLink(ctx, typedReq) - }, - )(ctx, req) - if resp != nil { - typedResp, ok := resp.(*CreatePrivateLinkResponse) - if !ok { - return nil, twirp.InternalError("failed type assertion resp.(*CreatePrivateLinkResponse) when calling interceptor") - } - return typedResp, err - } - return nil, err - } - } - return caller(ctx, in) -} - -func (c *cloudAgentProtobufClient) callCreatePrivateLink(ctx context.Context, in *CreatePrivateLinkRequest) (*CreatePrivateLinkResponse, error) { - out := new(CreatePrivateLinkResponse) - ctx, err := doProtobufRequest(ctx, c.client, c.opts.Hooks, c.urls[11], in, out) - if err != nil { - twerr, ok := err.(twirp.Error) - if !ok { - twerr = twirp.InternalErrorWith(err) - } - callClientError(ctx, c.opts.Hooks, twerr) - return nil, err - } - - callClientResponseReceived(ctx, c.opts.Hooks) - - return out, nil -} - -func (c *cloudAgentProtobufClient) DestroyPrivateLink(ctx context.Context, in *DestroyPrivateLinkRequest) (*DestroyPrivateLinkResponse, error) { - ctx = ctxsetters.WithPackageName(ctx, "livekit") - ctx = ctxsetters.WithServiceName(ctx, "CloudAgent") - ctx = ctxsetters.WithMethodName(ctx, "DestroyPrivateLink") - caller := c.callDestroyPrivateLink - if c.interceptor != nil { - caller = func(ctx context.Context, req *DestroyPrivateLinkRequest) (*DestroyPrivateLinkResponse, error) { - resp, err := c.interceptor( - func(ctx context.Context, req interface{}) (interface{}, error) { - typedReq, ok := req.(*DestroyPrivateLinkRequest) - if !ok { - return nil, twirp.InternalError("failed type assertion req.(*DestroyPrivateLinkRequest) when calling interceptor") - } - return c.callDestroyPrivateLink(ctx, typedReq) - }, - )(ctx, req) - if resp != nil { - typedResp, ok := resp.(*DestroyPrivateLinkResponse) - if !ok { - return nil, twirp.InternalError("failed type assertion resp.(*DestroyPrivateLinkResponse) when calling interceptor") - } - return typedResp, err - } - return nil, err - } - } - return caller(ctx, in) -} - -func (c *cloudAgentProtobufClient) callDestroyPrivateLink(ctx context.Context, in *DestroyPrivateLinkRequest) (*DestroyPrivateLinkResponse, error) { - out := new(DestroyPrivateLinkResponse) - ctx, err := doProtobufRequest(ctx, c.client, c.opts.Hooks, c.urls[12], in, out) - if err != nil { - twerr, ok := err.(twirp.Error) - if !ok { - twerr = twirp.InternalErrorWith(err) - } - callClientError(ctx, c.opts.Hooks, twerr) - return nil, err - } - - callClientResponseReceived(ctx, c.opts.Hooks) - - return out, nil -} - -func (c *cloudAgentProtobufClient) ListPrivateLinks(ctx context.Context, in *ListPrivateLinksRequest) (*ListPrivateLinksResponse, error) { - ctx = ctxsetters.WithPackageName(ctx, "livekit") - ctx = ctxsetters.WithServiceName(ctx, "CloudAgent") - ctx = ctxsetters.WithMethodName(ctx, "ListPrivateLinks") - caller := c.callListPrivateLinks - if c.interceptor != nil { - caller = func(ctx context.Context, req *ListPrivateLinksRequest) (*ListPrivateLinksResponse, error) { - resp, err := c.interceptor( - func(ctx context.Context, req interface{}) (interface{}, error) { - typedReq, ok := req.(*ListPrivateLinksRequest) - if !ok { - return nil, twirp.InternalError("failed type assertion req.(*ListPrivateLinksRequest) when calling interceptor") - } - return c.callListPrivateLinks(ctx, typedReq) - }, - )(ctx, req) - if resp != nil { - typedResp, ok := resp.(*ListPrivateLinksResponse) - if !ok { - return nil, twirp.InternalError("failed type assertion resp.(*ListPrivateLinksResponse) when calling interceptor") - } - return typedResp, err - } - return nil, err - } - } - return caller(ctx, in) -} - -func (c *cloudAgentProtobufClient) callListPrivateLinks(ctx context.Context, in *ListPrivateLinksRequest) (*ListPrivateLinksResponse, error) { - out := new(ListPrivateLinksResponse) - ctx, err := doProtobufRequest(ctx, c.client, c.opts.Hooks, c.urls[13], in, out) - if err != nil { - twerr, ok := err.(twirp.Error) - if !ok { - twerr = twirp.InternalErrorWith(err) - } - callClientError(ctx, c.opts.Hooks, twerr) - return nil, err - } - - callClientResponseReceived(ctx, c.opts.Hooks) - - return out, nil -} - -func (c *cloudAgentProtobufClient) GetPrivateLinkStatus(ctx context.Context, in *GetPrivateLinkStatusRequest) (*GetPrivateLinkStatusResponse, error) { - ctx = ctxsetters.WithPackageName(ctx, "livekit") - ctx = ctxsetters.WithServiceName(ctx, "CloudAgent") - ctx = ctxsetters.WithMethodName(ctx, "GetPrivateLinkStatus") - caller := c.callGetPrivateLinkStatus - if c.interceptor != nil { - caller = func(ctx context.Context, req *GetPrivateLinkStatusRequest) (*GetPrivateLinkStatusResponse, error) { - resp, err := c.interceptor( - func(ctx context.Context, req interface{}) (interface{}, error) { - typedReq, ok := req.(*GetPrivateLinkStatusRequest) - if !ok { - return nil, twirp.InternalError("failed type assertion req.(*GetPrivateLinkStatusRequest) when calling interceptor") - } - return c.callGetPrivateLinkStatus(ctx, typedReq) - }, - )(ctx, req) - if resp != nil { - typedResp, ok := resp.(*GetPrivateLinkStatusResponse) - if !ok { - return nil, twirp.InternalError("failed type assertion resp.(*GetPrivateLinkStatusResponse) when calling interceptor") - } - return typedResp, err - } - return nil, err - } - } - return caller(ctx, in) -} - -func (c *cloudAgentProtobufClient) callGetPrivateLinkStatus(ctx context.Context, in *GetPrivateLinkStatusRequest) (*GetPrivateLinkStatusResponse, error) { - out := new(GetPrivateLinkStatusResponse) - ctx, err := doProtobufRequest(ctx, c.client, c.opts.Hooks, c.urls[14], in, out) - if err != nil { - twerr, ok := err.(twirp.Error) - if !ok { - twerr = twirp.InternalErrorWith(err) - } - callClientError(ctx, c.opts.Hooks, twerr) - return nil, err - } - - callClientResponseReceived(ctx, c.opts.Hooks) - - return out, nil -} - -// ====================== -// CloudAgent JSON Client -// ====================== - -type cloudAgentJSONClient struct { - client HTTPClient - urls [15]string - interceptor twirp.Interceptor - opts twirp.ClientOptions -} - -// NewCloudAgentJSONClient creates a JSON client that implements the CloudAgent interface. -// It communicates using JSON and can be configured with a custom HTTPClient. -func NewCloudAgentJSONClient(baseURL string, client HTTPClient, opts ...twirp.ClientOption) CloudAgent { - if c, ok := client.(*http.Client); ok { - client = withoutRedirects(c) - } - - clientOpts := twirp.ClientOptions{} - for _, o := range opts { - o(&clientOpts) - } - - // Using ReadOpt allows backwards and forwards compatibility with new options in the future - literalURLs := false - _ = clientOpts.ReadOpt("literalURLs", &literalURLs) - var pathPrefix string - if ok := clientOpts.ReadOpt("pathPrefix", &pathPrefix); !ok { - pathPrefix = "/twirp" // default prefix - } - - // Build method URLs: []/./ - serviceURL := sanitizeBaseURL(baseURL) - serviceURL += baseServicePath(pathPrefix, "livekit", "CloudAgent") - urls := [15]string{ - serviceURL + "CreateAgent", - serviceURL + "ListAgents", - serviceURL + "ListAgentVersions", - serviceURL + "ListAgentSecrets", - serviceURL + "UpdateAgent", - serviceURL + "RestartAgent", - serviceURL + "DeployAgent", - serviceURL + "UpdateAgentSecrets", - serviceURL + "RollbackAgent", - serviceURL + "DeleteAgent", - serviceURL + "GetClientSettings", - serviceURL + "CreatePrivateLink", - serviceURL + "DestroyPrivateLink", - serviceURL + "ListPrivateLinks", - serviceURL + "GetPrivateLinkStatus", - } - - return &cloudAgentJSONClient{ - client: client, - urls: urls, - interceptor: twirp.ChainInterceptors(clientOpts.Interceptors...), - opts: clientOpts, - } -} - -func (c *cloudAgentJSONClient) CreateAgent(ctx context.Context, in *CreateAgentRequest) (*CreateAgentResponse, error) { - ctx = ctxsetters.WithPackageName(ctx, "livekit") - ctx = ctxsetters.WithServiceName(ctx, "CloudAgent") - ctx = ctxsetters.WithMethodName(ctx, "CreateAgent") - caller := c.callCreateAgent - if c.interceptor != nil { - caller = func(ctx context.Context, req *CreateAgentRequest) (*CreateAgentResponse, error) { - resp, err := c.interceptor( - func(ctx context.Context, req interface{}) (interface{}, error) { - typedReq, ok := req.(*CreateAgentRequest) - if !ok { - return nil, twirp.InternalError("failed type assertion req.(*CreateAgentRequest) when calling interceptor") - } - return c.callCreateAgent(ctx, typedReq) - }, - )(ctx, req) - if resp != nil { - typedResp, ok := resp.(*CreateAgentResponse) - if !ok { - return nil, twirp.InternalError("failed type assertion resp.(*CreateAgentResponse) when calling interceptor") - } - return typedResp, err - } - return nil, err - } - } - return caller(ctx, in) -} - -func (c *cloudAgentJSONClient) callCreateAgent(ctx context.Context, in *CreateAgentRequest) (*CreateAgentResponse, error) { - out := new(CreateAgentResponse) - ctx, err := doJSONRequest(ctx, c.client, c.opts.Hooks, c.urls[0], in, out) - if err != nil { - twerr, ok := err.(twirp.Error) - if !ok { - twerr = twirp.InternalErrorWith(err) - } - callClientError(ctx, c.opts.Hooks, twerr) - return nil, err - } - - callClientResponseReceived(ctx, c.opts.Hooks) - - return out, nil -} - -func (c *cloudAgentJSONClient) ListAgents(ctx context.Context, in *ListAgentsRequest) (*ListAgentsResponse, error) { - ctx = ctxsetters.WithPackageName(ctx, "livekit") - ctx = ctxsetters.WithServiceName(ctx, "CloudAgent") - ctx = ctxsetters.WithMethodName(ctx, "ListAgents") - caller := c.callListAgents - if c.interceptor != nil { - caller = func(ctx context.Context, req *ListAgentsRequest) (*ListAgentsResponse, error) { - resp, err := c.interceptor( - func(ctx context.Context, req interface{}) (interface{}, error) { - typedReq, ok := req.(*ListAgentsRequest) - if !ok { - return nil, twirp.InternalError("failed type assertion req.(*ListAgentsRequest) when calling interceptor") - } - return c.callListAgents(ctx, typedReq) - }, - )(ctx, req) - if resp != nil { - typedResp, ok := resp.(*ListAgentsResponse) - if !ok { - return nil, twirp.InternalError("failed type assertion resp.(*ListAgentsResponse) when calling interceptor") - } - return typedResp, err - } - return nil, err - } - } - return caller(ctx, in) -} - -func (c *cloudAgentJSONClient) callListAgents(ctx context.Context, in *ListAgentsRequest) (*ListAgentsResponse, error) { - out := new(ListAgentsResponse) - ctx, err := doJSONRequest(ctx, c.client, c.opts.Hooks, c.urls[1], in, out) - if err != nil { - twerr, ok := err.(twirp.Error) - if !ok { - twerr = twirp.InternalErrorWith(err) - } - callClientError(ctx, c.opts.Hooks, twerr) - return nil, err - } - - callClientResponseReceived(ctx, c.opts.Hooks) - - return out, nil -} - -func (c *cloudAgentJSONClient) ListAgentVersions(ctx context.Context, in *ListAgentVersionsRequest) (*ListAgentVersionsResponse, error) { - ctx = ctxsetters.WithPackageName(ctx, "livekit") - ctx = ctxsetters.WithServiceName(ctx, "CloudAgent") - ctx = ctxsetters.WithMethodName(ctx, "ListAgentVersions") - caller := c.callListAgentVersions - if c.interceptor != nil { - caller = func(ctx context.Context, req *ListAgentVersionsRequest) (*ListAgentVersionsResponse, error) { - resp, err := c.interceptor( - func(ctx context.Context, req interface{}) (interface{}, error) { - typedReq, ok := req.(*ListAgentVersionsRequest) - if !ok { - return nil, twirp.InternalError("failed type assertion req.(*ListAgentVersionsRequest) when calling interceptor") - } - return c.callListAgentVersions(ctx, typedReq) - }, - )(ctx, req) - if resp != nil { - typedResp, ok := resp.(*ListAgentVersionsResponse) - if !ok { - return nil, twirp.InternalError("failed type assertion resp.(*ListAgentVersionsResponse) when calling interceptor") - } - return typedResp, err - } - return nil, err - } - } - return caller(ctx, in) -} - -func (c *cloudAgentJSONClient) callListAgentVersions(ctx context.Context, in *ListAgentVersionsRequest) (*ListAgentVersionsResponse, error) { - out := new(ListAgentVersionsResponse) - ctx, err := doJSONRequest(ctx, c.client, c.opts.Hooks, c.urls[2], in, out) - if err != nil { - twerr, ok := err.(twirp.Error) - if !ok { - twerr = twirp.InternalErrorWith(err) - } - callClientError(ctx, c.opts.Hooks, twerr) - return nil, err - } - - callClientResponseReceived(ctx, c.opts.Hooks) - - return out, nil -} - -func (c *cloudAgentJSONClient) ListAgentSecrets(ctx context.Context, in *ListAgentSecretsRequest) (*ListAgentSecretsResponse, error) { - ctx = ctxsetters.WithPackageName(ctx, "livekit") - ctx = ctxsetters.WithServiceName(ctx, "CloudAgent") - ctx = ctxsetters.WithMethodName(ctx, "ListAgentSecrets") - caller := c.callListAgentSecrets - if c.interceptor != nil { - caller = func(ctx context.Context, req *ListAgentSecretsRequest) (*ListAgentSecretsResponse, error) { - resp, err := c.interceptor( - func(ctx context.Context, req interface{}) (interface{}, error) { - typedReq, ok := req.(*ListAgentSecretsRequest) - if !ok { - return nil, twirp.InternalError("failed type assertion req.(*ListAgentSecretsRequest) when calling interceptor") - } - return c.callListAgentSecrets(ctx, typedReq) - }, - )(ctx, req) - if resp != nil { - typedResp, ok := resp.(*ListAgentSecretsResponse) - if !ok { - return nil, twirp.InternalError("failed type assertion resp.(*ListAgentSecretsResponse) when calling interceptor") - } - return typedResp, err - } - return nil, err - } - } - return caller(ctx, in) -} - -func (c *cloudAgentJSONClient) callListAgentSecrets(ctx context.Context, in *ListAgentSecretsRequest) (*ListAgentSecretsResponse, error) { - out := new(ListAgentSecretsResponse) - ctx, err := doJSONRequest(ctx, c.client, c.opts.Hooks, c.urls[3], in, out) - if err != nil { - twerr, ok := err.(twirp.Error) - if !ok { - twerr = twirp.InternalErrorWith(err) - } - callClientError(ctx, c.opts.Hooks, twerr) - return nil, err - } - - callClientResponseReceived(ctx, c.opts.Hooks) - - return out, nil -} - -func (c *cloudAgentJSONClient) UpdateAgent(ctx context.Context, in *UpdateAgentRequest) (*UpdateAgentResponse, error) { - ctx = ctxsetters.WithPackageName(ctx, "livekit") - ctx = ctxsetters.WithServiceName(ctx, "CloudAgent") - ctx = ctxsetters.WithMethodName(ctx, "UpdateAgent") - caller := c.callUpdateAgent - if c.interceptor != nil { - caller = func(ctx context.Context, req *UpdateAgentRequest) (*UpdateAgentResponse, error) { - resp, err := c.interceptor( - func(ctx context.Context, req interface{}) (interface{}, error) { - typedReq, ok := req.(*UpdateAgentRequest) - if !ok { - return nil, twirp.InternalError("failed type assertion req.(*UpdateAgentRequest) when calling interceptor") - } - return c.callUpdateAgent(ctx, typedReq) - }, - )(ctx, req) - if resp != nil { - typedResp, ok := resp.(*UpdateAgentResponse) - if !ok { - return nil, twirp.InternalError("failed type assertion resp.(*UpdateAgentResponse) when calling interceptor") - } - return typedResp, err - } - return nil, err - } - } - return caller(ctx, in) -} - -func (c *cloudAgentJSONClient) callUpdateAgent(ctx context.Context, in *UpdateAgentRequest) (*UpdateAgentResponse, error) { - out := new(UpdateAgentResponse) - ctx, err := doJSONRequest(ctx, c.client, c.opts.Hooks, c.urls[4], in, out) - if err != nil { - twerr, ok := err.(twirp.Error) - if !ok { - twerr = twirp.InternalErrorWith(err) - } - callClientError(ctx, c.opts.Hooks, twerr) - return nil, err - } - - callClientResponseReceived(ctx, c.opts.Hooks) - - return out, nil -} - -func (c *cloudAgentJSONClient) RestartAgent(ctx context.Context, in *RestartAgentRequest) (*RestartAgentResponse, error) { - ctx = ctxsetters.WithPackageName(ctx, "livekit") - ctx = ctxsetters.WithServiceName(ctx, "CloudAgent") - ctx = ctxsetters.WithMethodName(ctx, "RestartAgent") - caller := c.callRestartAgent - if c.interceptor != nil { - caller = func(ctx context.Context, req *RestartAgentRequest) (*RestartAgentResponse, error) { - resp, err := c.interceptor( - func(ctx context.Context, req interface{}) (interface{}, error) { - typedReq, ok := req.(*RestartAgentRequest) - if !ok { - return nil, twirp.InternalError("failed type assertion req.(*RestartAgentRequest) when calling interceptor") - } - return c.callRestartAgent(ctx, typedReq) - }, - )(ctx, req) - if resp != nil { - typedResp, ok := resp.(*RestartAgentResponse) - if !ok { - return nil, twirp.InternalError("failed type assertion resp.(*RestartAgentResponse) when calling interceptor") - } - return typedResp, err - } - return nil, err - } - } - return caller(ctx, in) -} - -func (c *cloudAgentJSONClient) callRestartAgent(ctx context.Context, in *RestartAgentRequest) (*RestartAgentResponse, error) { - out := new(RestartAgentResponse) - ctx, err := doJSONRequest(ctx, c.client, c.opts.Hooks, c.urls[5], in, out) - if err != nil { - twerr, ok := err.(twirp.Error) - if !ok { - twerr = twirp.InternalErrorWith(err) - } - callClientError(ctx, c.opts.Hooks, twerr) - return nil, err - } - - callClientResponseReceived(ctx, c.opts.Hooks) - - return out, nil -} - -func (c *cloudAgentJSONClient) DeployAgent(ctx context.Context, in *DeployAgentRequest) (*DeployAgentResponse, error) { - ctx = ctxsetters.WithPackageName(ctx, "livekit") - ctx = ctxsetters.WithServiceName(ctx, "CloudAgent") - ctx = ctxsetters.WithMethodName(ctx, "DeployAgent") - caller := c.callDeployAgent - if c.interceptor != nil { - caller = func(ctx context.Context, req *DeployAgentRequest) (*DeployAgentResponse, error) { - resp, err := c.interceptor( - func(ctx context.Context, req interface{}) (interface{}, error) { - typedReq, ok := req.(*DeployAgentRequest) - if !ok { - return nil, twirp.InternalError("failed type assertion req.(*DeployAgentRequest) when calling interceptor") - } - return c.callDeployAgent(ctx, typedReq) - }, - )(ctx, req) - if resp != nil { - typedResp, ok := resp.(*DeployAgentResponse) - if !ok { - return nil, twirp.InternalError("failed type assertion resp.(*DeployAgentResponse) when calling interceptor") - } - return typedResp, err - } - return nil, err - } - } - return caller(ctx, in) -} - -func (c *cloudAgentJSONClient) callDeployAgent(ctx context.Context, in *DeployAgentRequest) (*DeployAgentResponse, error) { - out := new(DeployAgentResponse) - ctx, err := doJSONRequest(ctx, c.client, c.opts.Hooks, c.urls[6], in, out) - if err != nil { - twerr, ok := err.(twirp.Error) - if !ok { - twerr = twirp.InternalErrorWith(err) - } - callClientError(ctx, c.opts.Hooks, twerr) - return nil, err - } - - callClientResponseReceived(ctx, c.opts.Hooks) - - return out, nil -} - -func (c *cloudAgentJSONClient) UpdateAgentSecrets(ctx context.Context, in *UpdateAgentSecretsRequest) (*UpdateAgentSecretsResponse, error) { - ctx = ctxsetters.WithPackageName(ctx, "livekit") - ctx = ctxsetters.WithServiceName(ctx, "CloudAgent") - ctx = ctxsetters.WithMethodName(ctx, "UpdateAgentSecrets") - caller := c.callUpdateAgentSecrets - if c.interceptor != nil { - caller = func(ctx context.Context, req *UpdateAgentSecretsRequest) (*UpdateAgentSecretsResponse, error) { - resp, err := c.interceptor( - func(ctx context.Context, req interface{}) (interface{}, error) { - typedReq, ok := req.(*UpdateAgentSecretsRequest) - if !ok { - return nil, twirp.InternalError("failed type assertion req.(*UpdateAgentSecretsRequest) when calling interceptor") - } - return c.callUpdateAgentSecrets(ctx, typedReq) - }, - )(ctx, req) - if resp != nil { - typedResp, ok := resp.(*UpdateAgentSecretsResponse) - if !ok { - return nil, twirp.InternalError("failed type assertion resp.(*UpdateAgentSecretsResponse) when calling interceptor") - } - return typedResp, err - } - return nil, err - } - } - return caller(ctx, in) -} - -func (c *cloudAgentJSONClient) callUpdateAgentSecrets(ctx context.Context, in *UpdateAgentSecretsRequest) (*UpdateAgentSecretsResponse, error) { - out := new(UpdateAgentSecretsResponse) - ctx, err := doJSONRequest(ctx, c.client, c.opts.Hooks, c.urls[7], in, out) - if err != nil { - twerr, ok := err.(twirp.Error) - if !ok { - twerr = twirp.InternalErrorWith(err) - } - callClientError(ctx, c.opts.Hooks, twerr) - return nil, err - } - - callClientResponseReceived(ctx, c.opts.Hooks) - - return out, nil -} - -func (c *cloudAgentJSONClient) RollbackAgent(ctx context.Context, in *RollbackAgentRequest) (*RollbackAgentResponse, error) { - ctx = ctxsetters.WithPackageName(ctx, "livekit") - ctx = ctxsetters.WithServiceName(ctx, "CloudAgent") - ctx = ctxsetters.WithMethodName(ctx, "RollbackAgent") - caller := c.callRollbackAgent - if c.interceptor != nil { - caller = func(ctx context.Context, req *RollbackAgentRequest) (*RollbackAgentResponse, error) { - resp, err := c.interceptor( - func(ctx context.Context, req interface{}) (interface{}, error) { - typedReq, ok := req.(*RollbackAgentRequest) - if !ok { - return nil, twirp.InternalError("failed type assertion req.(*RollbackAgentRequest) when calling interceptor") - } - return c.callRollbackAgent(ctx, typedReq) - }, - )(ctx, req) - if resp != nil { - typedResp, ok := resp.(*RollbackAgentResponse) - if !ok { - return nil, twirp.InternalError("failed type assertion resp.(*RollbackAgentResponse) when calling interceptor") - } - return typedResp, err - } - return nil, err - } - } - return caller(ctx, in) -} - -func (c *cloudAgentJSONClient) callRollbackAgent(ctx context.Context, in *RollbackAgentRequest) (*RollbackAgentResponse, error) { - out := new(RollbackAgentResponse) - ctx, err := doJSONRequest(ctx, c.client, c.opts.Hooks, c.urls[8], in, out) - if err != nil { - twerr, ok := err.(twirp.Error) - if !ok { - twerr = twirp.InternalErrorWith(err) - } - callClientError(ctx, c.opts.Hooks, twerr) - return nil, err - } - - callClientResponseReceived(ctx, c.opts.Hooks) - - return out, nil -} - -func (c *cloudAgentJSONClient) DeleteAgent(ctx context.Context, in *DeleteAgentRequest) (*DeleteAgentResponse, error) { - ctx = ctxsetters.WithPackageName(ctx, "livekit") - ctx = ctxsetters.WithServiceName(ctx, "CloudAgent") - ctx = ctxsetters.WithMethodName(ctx, "DeleteAgent") - caller := c.callDeleteAgent - if c.interceptor != nil { - caller = func(ctx context.Context, req *DeleteAgentRequest) (*DeleteAgentResponse, error) { - resp, err := c.interceptor( - func(ctx context.Context, req interface{}) (interface{}, error) { - typedReq, ok := req.(*DeleteAgentRequest) - if !ok { - return nil, twirp.InternalError("failed type assertion req.(*DeleteAgentRequest) when calling interceptor") - } - return c.callDeleteAgent(ctx, typedReq) - }, - )(ctx, req) - if resp != nil { - typedResp, ok := resp.(*DeleteAgentResponse) - if !ok { - return nil, twirp.InternalError("failed type assertion resp.(*DeleteAgentResponse) when calling interceptor") - } - return typedResp, err - } - return nil, err - } - } - return caller(ctx, in) -} - -func (c *cloudAgentJSONClient) callDeleteAgent(ctx context.Context, in *DeleteAgentRequest) (*DeleteAgentResponse, error) { - out := new(DeleteAgentResponse) - ctx, err := doJSONRequest(ctx, c.client, c.opts.Hooks, c.urls[9], in, out) - if err != nil { - twerr, ok := err.(twirp.Error) - if !ok { - twerr = twirp.InternalErrorWith(err) - } - callClientError(ctx, c.opts.Hooks, twerr) - return nil, err - } - - callClientResponseReceived(ctx, c.opts.Hooks) - - return out, nil -} - -func (c *cloudAgentJSONClient) GetClientSettings(ctx context.Context, in *ClientSettingsRequest) (*ClientSettingsResponse, error) { - ctx = ctxsetters.WithPackageName(ctx, "livekit") - ctx = ctxsetters.WithServiceName(ctx, "CloudAgent") - ctx = ctxsetters.WithMethodName(ctx, "GetClientSettings") - caller := c.callGetClientSettings - if c.interceptor != nil { - caller = func(ctx context.Context, req *ClientSettingsRequest) (*ClientSettingsResponse, error) { - resp, err := c.interceptor( - func(ctx context.Context, req interface{}) (interface{}, error) { - typedReq, ok := req.(*ClientSettingsRequest) - if !ok { - return nil, twirp.InternalError("failed type assertion req.(*ClientSettingsRequest) when calling interceptor") - } - return c.callGetClientSettings(ctx, typedReq) - }, - )(ctx, req) - if resp != nil { - typedResp, ok := resp.(*ClientSettingsResponse) - if !ok { - return nil, twirp.InternalError("failed type assertion resp.(*ClientSettingsResponse) when calling interceptor") - } - return typedResp, err - } - return nil, err - } - } - return caller(ctx, in) -} - -func (c *cloudAgentJSONClient) callGetClientSettings(ctx context.Context, in *ClientSettingsRequest) (*ClientSettingsResponse, error) { - out := new(ClientSettingsResponse) - ctx, err := doJSONRequest(ctx, c.client, c.opts.Hooks, c.urls[10], in, out) - if err != nil { - twerr, ok := err.(twirp.Error) - if !ok { - twerr = twirp.InternalErrorWith(err) - } - callClientError(ctx, c.opts.Hooks, twerr) - return nil, err - } - - callClientResponseReceived(ctx, c.opts.Hooks) - - return out, nil -} - -func (c *cloudAgentJSONClient) CreatePrivateLink(ctx context.Context, in *CreatePrivateLinkRequest) (*CreatePrivateLinkResponse, error) { - ctx = ctxsetters.WithPackageName(ctx, "livekit") - ctx = ctxsetters.WithServiceName(ctx, "CloudAgent") - ctx = ctxsetters.WithMethodName(ctx, "CreatePrivateLink") - caller := c.callCreatePrivateLink - if c.interceptor != nil { - caller = func(ctx context.Context, req *CreatePrivateLinkRequest) (*CreatePrivateLinkResponse, error) { - resp, err := c.interceptor( - func(ctx context.Context, req interface{}) (interface{}, error) { - typedReq, ok := req.(*CreatePrivateLinkRequest) - if !ok { - return nil, twirp.InternalError("failed type assertion req.(*CreatePrivateLinkRequest) when calling interceptor") - } - return c.callCreatePrivateLink(ctx, typedReq) - }, - )(ctx, req) - if resp != nil { - typedResp, ok := resp.(*CreatePrivateLinkResponse) - if !ok { - return nil, twirp.InternalError("failed type assertion resp.(*CreatePrivateLinkResponse) when calling interceptor") - } - return typedResp, err - } - return nil, err - } - } - return caller(ctx, in) -} - -func (c *cloudAgentJSONClient) callCreatePrivateLink(ctx context.Context, in *CreatePrivateLinkRequest) (*CreatePrivateLinkResponse, error) { - out := new(CreatePrivateLinkResponse) - ctx, err := doJSONRequest(ctx, c.client, c.opts.Hooks, c.urls[11], in, out) - if err != nil { - twerr, ok := err.(twirp.Error) - if !ok { - twerr = twirp.InternalErrorWith(err) - } - callClientError(ctx, c.opts.Hooks, twerr) - return nil, err - } - - callClientResponseReceived(ctx, c.opts.Hooks) - - return out, nil -} - -func (c *cloudAgentJSONClient) DestroyPrivateLink(ctx context.Context, in *DestroyPrivateLinkRequest) (*DestroyPrivateLinkResponse, error) { - ctx = ctxsetters.WithPackageName(ctx, "livekit") - ctx = ctxsetters.WithServiceName(ctx, "CloudAgent") - ctx = ctxsetters.WithMethodName(ctx, "DestroyPrivateLink") - caller := c.callDestroyPrivateLink - if c.interceptor != nil { - caller = func(ctx context.Context, req *DestroyPrivateLinkRequest) (*DestroyPrivateLinkResponse, error) { - resp, err := c.interceptor( - func(ctx context.Context, req interface{}) (interface{}, error) { - typedReq, ok := req.(*DestroyPrivateLinkRequest) - if !ok { - return nil, twirp.InternalError("failed type assertion req.(*DestroyPrivateLinkRequest) when calling interceptor") - } - return c.callDestroyPrivateLink(ctx, typedReq) - }, - )(ctx, req) - if resp != nil { - typedResp, ok := resp.(*DestroyPrivateLinkResponse) - if !ok { - return nil, twirp.InternalError("failed type assertion resp.(*DestroyPrivateLinkResponse) when calling interceptor") - } - return typedResp, err - } - return nil, err - } - } - return caller(ctx, in) -} - -func (c *cloudAgentJSONClient) callDestroyPrivateLink(ctx context.Context, in *DestroyPrivateLinkRequest) (*DestroyPrivateLinkResponse, error) { - out := new(DestroyPrivateLinkResponse) - ctx, err := doJSONRequest(ctx, c.client, c.opts.Hooks, c.urls[12], in, out) - if err != nil { - twerr, ok := err.(twirp.Error) - if !ok { - twerr = twirp.InternalErrorWith(err) - } - callClientError(ctx, c.opts.Hooks, twerr) - return nil, err - } - - callClientResponseReceived(ctx, c.opts.Hooks) - - return out, nil -} - -func (c *cloudAgentJSONClient) ListPrivateLinks(ctx context.Context, in *ListPrivateLinksRequest) (*ListPrivateLinksResponse, error) { - ctx = ctxsetters.WithPackageName(ctx, "livekit") - ctx = ctxsetters.WithServiceName(ctx, "CloudAgent") - ctx = ctxsetters.WithMethodName(ctx, "ListPrivateLinks") - caller := c.callListPrivateLinks - if c.interceptor != nil { - caller = func(ctx context.Context, req *ListPrivateLinksRequest) (*ListPrivateLinksResponse, error) { - resp, err := c.interceptor( - func(ctx context.Context, req interface{}) (interface{}, error) { - typedReq, ok := req.(*ListPrivateLinksRequest) - if !ok { - return nil, twirp.InternalError("failed type assertion req.(*ListPrivateLinksRequest) when calling interceptor") - } - return c.callListPrivateLinks(ctx, typedReq) - }, - )(ctx, req) - if resp != nil { - typedResp, ok := resp.(*ListPrivateLinksResponse) - if !ok { - return nil, twirp.InternalError("failed type assertion resp.(*ListPrivateLinksResponse) when calling interceptor") - } - return typedResp, err - } - return nil, err - } - } - return caller(ctx, in) -} - -func (c *cloudAgentJSONClient) callListPrivateLinks(ctx context.Context, in *ListPrivateLinksRequest) (*ListPrivateLinksResponse, error) { - out := new(ListPrivateLinksResponse) - ctx, err := doJSONRequest(ctx, c.client, c.opts.Hooks, c.urls[13], in, out) - if err != nil { - twerr, ok := err.(twirp.Error) - if !ok { - twerr = twirp.InternalErrorWith(err) - } - callClientError(ctx, c.opts.Hooks, twerr) - return nil, err - } - - callClientResponseReceived(ctx, c.opts.Hooks) - - return out, nil -} - -func (c *cloudAgentJSONClient) GetPrivateLinkStatus(ctx context.Context, in *GetPrivateLinkStatusRequest) (*GetPrivateLinkStatusResponse, error) { - ctx = ctxsetters.WithPackageName(ctx, "livekit") - ctx = ctxsetters.WithServiceName(ctx, "CloudAgent") - ctx = ctxsetters.WithMethodName(ctx, "GetPrivateLinkStatus") - caller := c.callGetPrivateLinkStatus - if c.interceptor != nil { - caller = func(ctx context.Context, req *GetPrivateLinkStatusRequest) (*GetPrivateLinkStatusResponse, error) { - resp, err := c.interceptor( - func(ctx context.Context, req interface{}) (interface{}, error) { - typedReq, ok := req.(*GetPrivateLinkStatusRequest) - if !ok { - return nil, twirp.InternalError("failed type assertion req.(*GetPrivateLinkStatusRequest) when calling interceptor") - } - return c.callGetPrivateLinkStatus(ctx, typedReq) - }, - )(ctx, req) - if resp != nil { - typedResp, ok := resp.(*GetPrivateLinkStatusResponse) - if !ok { - return nil, twirp.InternalError("failed type assertion resp.(*GetPrivateLinkStatusResponse) when calling interceptor") - } - return typedResp, err - } - return nil, err - } - } - return caller(ctx, in) -} - -func (c *cloudAgentJSONClient) callGetPrivateLinkStatus(ctx context.Context, in *GetPrivateLinkStatusRequest) (*GetPrivateLinkStatusResponse, error) { - out := new(GetPrivateLinkStatusResponse) - ctx, err := doJSONRequest(ctx, c.client, c.opts.Hooks, c.urls[14], in, out) - if err != nil { - twerr, ok := err.(twirp.Error) - if !ok { - twerr = twirp.InternalErrorWith(err) - } - callClientError(ctx, c.opts.Hooks, twerr) - return nil, err - } - - callClientResponseReceived(ctx, c.opts.Hooks) - - return out, nil -} - -// ========================= -// CloudAgent Server Handler -// ========================= - -type cloudAgentServer struct { - CloudAgent - interceptor twirp.Interceptor - hooks *twirp.ServerHooks - pathPrefix string // prefix for routing - jsonSkipDefaults bool // do not include unpopulated fields (default values) in the response - jsonCamelCase bool // JSON fields are serialized as lowerCamelCase rather than keeping the original proto names -} - -// NewCloudAgentServer builds a TwirpServer that can be used as an http.Handler to handle -// HTTP requests that are routed to the right method in the provided svc implementation. -// The opts are twirp.ServerOption modifiers, for example twirp.WithServerHooks(hooks). -func NewCloudAgentServer(svc CloudAgent, opts ...interface{}) TwirpServer { - serverOpts := newServerOpts(opts) - - // Using ReadOpt allows backwards and forwards compatibility with new options in the future - jsonSkipDefaults := false - _ = serverOpts.ReadOpt("jsonSkipDefaults", &jsonSkipDefaults) - jsonCamelCase := false - _ = serverOpts.ReadOpt("jsonCamelCase", &jsonCamelCase) - var pathPrefix string - if ok := serverOpts.ReadOpt("pathPrefix", &pathPrefix); !ok { - pathPrefix = "/twirp" // default prefix - } - - return &cloudAgentServer{ - CloudAgent: svc, - hooks: serverOpts.Hooks, - interceptor: twirp.ChainInterceptors(serverOpts.Interceptors...), - pathPrefix: pathPrefix, - jsonSkipDefaults: jsonSkipDefaults, - jsonCamelCase: jsonCamelCase, - } -} - -// writeError writes an HTTP response with a valid Twirp error format, and triggers hooks. -// If err is not a twirp.Error, it will get wrapped with twirp.InternalErrorWith(err) -func (s *cloudAgentServer) writeError(ctx context.Context, resp http.ResponseWriter, err error) { - writeError(ctx, resp, err, s.hooks) -} - -// handleRequestBodyError is used to handle error when the twirp server cannot read request -func (s *cloudAgentServer) handleRequestBodyError(ctx context.Context, resp http.ResponseWriter, msg string, err error) { - if context.Canceled == ctx.Err() { - s.writeError(ctx, resp, twirp.NewError(twirp.Canceled, "failed to read request: context canceled")) - return - } - if context.DeadlineExceeded == ctx.Err() { - s.writeError(ctx, resp, twirp.NewError(twirp.DeadlineExceeded, "failed to read request: deadline exceeded")) - return - } - s.writeError(ctx, resp, twirp.WrapError(malformedRequestError(msg), err)) -} - -// CloudAgentPathPrefix is a convenience constant that may identify URL paths. -// Should be used with caution, it only matches routes generated by Twirp Go clients, -// with the default "/twirp" prefix and default CamelCase service and method names. -// More info: https://twitchtv.github.io/twirp/docs/routing.html -const CloudAgentPathPrefix = "/twirp/livekit.CloudAgent/" - -func (s *cloudAgentServer) ServeHTTP(resp http.ResponseWriter, req *http.Request) { - ctx := req.Context() - ctx = ctxsetters.WithPackageName(ctx, "livekit") - ctx = ctxsetters.WithServiceName(ctx, "CloudAgent") - ctx = ctxsetters.WithResponseWriter(ctx, resp) - - var err error - ctx, err = callRequestReceived(ctx, s.hooks) - if err != nil { - s.writeError(ctx, resp, err) - return - } - - if req.Method != "POST" { - msg := fmt.Sprintf("unsupported method %q (only POST is allowed)", req.Method) - s.writeError(ctx, resp, badRouteError(msg, req.Method, req.URL.Path)) - return - } - - // Verify path format: []/./ - prefix, pkgService, method := parseTwirpPath(req.URL.Path) - if pkgService != "livekit.CloudAgent" { - msg := fmt.Sprintf("no handler for path %q", req.URL.Path) - s.writeError(ctx, resp, badRouteError(msg, req.Method, req.URL.Path)) - return - } - if prefix != s.pathPrefix { - msg := fmt.Sprintf("invalid path prefix %q, expected %q, on path %q", prefix, s.pathPrefix, req.URL.Path) - s.writeError(ctx, resp, badRouteError(msg, req.Method, req.URL.Path)) - return - } - - switch method { - case "CreateAgent": - s.serveCreateAgent(ctx, resp, req) - return - case "ListAgents": - s.serveListAgents(ctx, resp, req) - return - case "ListAgentVersions": - s.serveListAgentVersions(ctx, resp, req) - return - case "ListAgentSecrets": - s.serveListAgentSecrets(ctx, resp, req) - return - case "UpdateAgent": - s.serveUpdateAgent(ctx, resp, req) - return - case "RestartAgent": - s.serveRestartAgent(ctx, resp, req) - return - case "DeployAgent": - s.serveDeployAgent(ctx, resp, req) - return - case "UpdateAgentSecrets": - s.serveUpdateAgentSecrets(ctx, resp, req) - return - case "RollbackAgent": - s.serveRollbackAgent(ctx, resp, req) - return - case "DeleteAgent": - s.serveDeleteAgent(ctx, resp, req) - return - case "GetClientSettings": - s.serveGetClientSettings(ctx, resp, req) - return - case "CreatePrivateLink": - s.serveCreatePrivateLink(ctx, resp, req) - return - case "DestroyPrivateLink": - s.serveDestroyPrivateLink(ctx, resp, req) - return - case "ListPrivateLinks": - s.serveListPrivateLinks(ctx, resp, req) - return - case "GetPrivateLinkStatus": - s.serveGetPrivateLinkStatus(ctx, resp, req) - return - default: - msg := fmt.Sprintf("no handler for path %q", req.URL.Path) - s.writeError(ctx, resp, badRouteError(msg, req.Method, req.URL.Path)) - return - } -} - -func (s *cloudAgentServer) serveCreateAgent(ctx context.Context, resp http.ResponseWriter, req *http.Request) { - header := req.Header.Get("Content-Type") - i := strings.Index(header, ";") - if i == -1 { - i = len(header) - } - switch strings.TrimSpace(strings.ToLower(header[:i])) { - case "application/json": - s.serveCreateAgentJSON(ctx, resp, req) - case "application/protobuf": - s.serveCreateAgentProtobuf(ctx, resp, req) - default: - msg := fmt.Sprintf("unexpected Content-Type: %q", req.Header.Get("Content-Type")) - twerr := badRouteError(msg, req.Method, req.URL.Path) - s.writeError(ctx, resp, twerr) - } -} - -func (s *cloudAgentServer) serveCreateAgentJSON(ctx context.Context, resp http.ResponseWriter, req *http.Request) { - var err error - ctx = ctxsetters.WithMethodName(ctx, "CreateAgent") - ctx, err = callRequestRouted(ctx, s.hooks) - if err != nil { - s.writeError(ctx, resp, err) - return - } - - d := json.NewDecoder(req.Body) - rawReqBody := json.RawMessage{} - if err := d.Decode(&rawReqBody); err != nil { - s.handleRequestBodyError(ctx, resp, "the json request could not be decoded", err) - return - } - reqContent := new(CreateAgentRequest) - unmarshaler := protojson.UnmarshalOptions{DiscardUnknown: true} - if err = unmarshaler.Unmarshal(rawReqBody, reqContent); err != nil { - s.handleRequestBodyError(ctx, resp, "the json request could not be decoded", err) - return - } - - handler := s.CloudAgent.CreateAgent - if s.interceptor != nil { - handler = func(ctx context.Context, req *CreateAgentRequest) (*CreateAgentResponse, error) { - resp, err := s.interceptor( - func(ctx context.Context, req interface{}) (interface{}, error) { - typedReq, ok := req.(*CreateAgentRequest) - if !ok { - return nil, twirp.InternalError("failed type assertion req.(*CreateAgentRequest) when calling interceptor") - } - return s.CloudAgent.CreateAgent(ctx, typedReq) - }, - )(ctx, req) - if resp != nil { - typedResp, ok := resp.(*CreateAgentResponse) - if !ok { - return nil, twirp.InternalError("failed type assertion resp.(*CreateAgentResponse) when calling interceptor") - } - return typedResp, err - } - return nil, err - } - } - - // Call service method - var respContent *CreateAgentResponse - func() { - defer ensurePanicResponses(ctx, resp, s.hooks) - respContent, err = handler(ctx, reqContent) - }() - - if err != nil { - s.writeError(ctx, resp, err) - return - } - if respContent == nil { - s.writeError(ctx, resp, twirp.InternalError("received a nil *CreateAgentResponse and nil error while calling CreateAgent. nil responses are not supported")) - return - } - - ctx = callResponsePrepared(ctx, s.hooks) - - marshaler := &protojson.MarshalOptions{UseProtoNames: !s.jsonCamelCase, EmitUnpopulated: !s.jsonSkipDefaults} - respBytes, err := marshaler.Marshal(respContent) - if err != nil { - s.writeError(ctx, resp, wrapInternal(err, "failed to marshal json response")) - return - } - - ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK) - resp.Header().Set("Content-Type", "application/json") - resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes))) - resp.WriteHeader(http.StatusOK) - - if n, err := resp.Write(respBytes); err != nil { - msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error()) - twerr := twirp.NewError(twirp.Unknown, msg) - ctx = callError(ctx, s.hooks, twerr) - } - callResponseSent(ctx, s.hooks) -} - -func (s *cloudAgentServer) serveCreateAgentProtobuf(ctx context.Context, resp http.ResponseWriter, req *http.Request) { - var err error - ctx = ctxsetters.WithMethodName(ctx, "CreateAgent") - ctx, err = callRequestRouted(ctx, s.hooks) - if err != nil { - s.writeError(ctx, resp, err) - return - } - - buf, err := io.ReadAll(req.Body) - if err != nil { - s.handleRequestBodyError(ctx, resp, "failed to read request body", err) - return - } - reqContent := new(CreateAgentRequest) - if err = proto.Unmarshal(buf, reqContent); err != nil { - s.writeError(ctx, resp, malformedRequestError("the protobuf request could not be decoded")) - return - } - - handler := s.CloudAgent.CreateAgent - if s.interceptor != nil { - handler = func(ctx context.Context, req *CreateAgentRequest) (*CreateAgentResponse, error) { - resp, err := s.interceptor( - func(ctx context.Context, req interface{}) (interface{}, error) { - typedReq, ok := req.(*CreateAgentRequest) - if !ok { - return nil, twirp.InternalError("failed type assertion req.(*CreateAgentRequest) when calling interceptor") - } - return s.CloudAgent.CreateAgent(ctx, typedReq) - }, - )(ctx, req) - if resp != nil { - typedResp, ok := resp.(*CreateAgentResponse) - if !ok { - return nil, twirp.InternalError("failed type assertion resp.(*CreateAgentResponse) when calling interceptor") - } - return typedResp, err - } - return nil, err - } - } - - // Call service method - var respContent *CreateAgentResponse - func() { - defer ensurePanicResponses(ctx, resp, s.hooks) - respContent, err = handler(ctx, reqContent) - }() - - if err != nil { - s.writeError(ctx, resp, err) - return - } - if respContent == nil { - s.writeError(ctx, resp, twirp.InternalError("received a nil *CreateAgentResponse and nil error while calling CreateAgent. nil responses are not supported")) - return - } - - ctx = callResponsePrepared(ctx, s.hooks) - - respBytes, err := proto.Marshal(respContent) - if err != nil { - s.writeError(ctx, resp, wrapInternal(err, "failed to marshal proto response")) - return - } - - ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK) - resp.Header().Set("Content-Type", "application/protobuf") - resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes))) - resp.WriteHeader(http.StatusOK) - if n, err := resp.Write(respBytes); err != nil { - msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error()) - twerr := twirp.NewError(twirp.Unknown, msg) - ctx = callError(ctx, s.hooks, twerr) - } - callResponseSent(ctx, s.hooks) -} - -func (s *cloudAgentServer) serveListAgents(ctx context.Context, resp http.ResponseWriter, req *http.Request) { - header := req.Header.Get("Content-Type") - i := strings.Index(header, ";") - if i == -1 { - i = len(header) - } - switch strings.TrimSpace(strings.ToLower(header[:i])) { - case "application/json": - s.serveListAgentsJSON(ctx, resp, req) - case "application/protobuf": - s.serveListAgentsProtobuf(ctx, resp, req) - default: - msg := fmt.Sprintf("unexpected Content-Type: %q", req.Header.Get("Content-Type")) - twerr := badRouteError(msg, req.Method, req.URL.Path) - s.writeError(ctx, resp, twerr) - } -} - -func (s *cloudAgentServer) serveListAgentsJSON(ctx context.Context, resp http.ResponseWriter, req *http.Request) { - var err error - ctx = ctxsetters.WithMethodName(ctx, "ListAgents") - ctx, err = callRequestRouted(ctx, s.hooks) - if err != nil { - s.writeError(ctx, resp, err) - return - } - - d := json.NewDecoder(req.Body) - rawReqBody := json.RawMessage{} - if err := d.Decode(&rawReqBody); err != nil { - s.handleRequestBodyError(ctx, resp, "the json request could not be decoded", err) - return - } - reqContent := new(ListAgentsRequest) - unmarshaler := protojson.UnmarshalOptions{DiscardUnknown: true} - if err = unmarshaler.Unmarshal(rawReqBody, reqContent); err != nil { - s.handleRequestBodyError(ctx, resp, "the json request could not be decoded", err) - return - } - - handler := s.CloudAgent.ListAgents - if s.interceptor != nil { - handler = func(ctx context.Context, req *ListAgentsRequest) (*ListAgentsResponse, error) { - resp, err := s.interceptor( - func(ctx context.Context, req interface{}) (interface{}, error) { - typedReq, ok := req.(*ListAgentsRequest) - if !ok { - return nil, twirp.InternalError("failed type assertion req.(*ListAgentsRequest) when calling interceptor") - } - return s.CloudAgent.ListAgents(ctx, typedReq) - }, - )(ctx, req) - if resp != nil { - typedResp, ok := resp.(*ListAgentsResponse) - if !ok { - return nil, twirp.InternalError("failed type assertion resp.(*ListAgentsResponse) when calling interceptor") - } - return typedResp, err - } - return nil, err - } - } - - // Call service method - var respContent *ListAgentsResponse - func() { - defer ensurePanicResponses(ctx, resp, s.hooks) - respContent, err = handler(ctx, reqContent) - }() - - if err != nil { - s.writeError(ctx, resp, err) - return - } - if respContent == nil { - s.writeError(ctx, resp, twirp.InternalError("received a nil *ListAgentsResponse and nil error while calling ListAgents. nil responses are not supported")) - return - } - - ctx = callResponsePrepared(ctx, s.hooks) - - marshaler := &protojson.MarshalOptions{UseProtoNames: !s.jsonCamelCase, EmitUnpopulated: !s.jsonSkipDefaults} - respBytes, err := marshaler.Marshal(respContent) - if err != nil { - s.writeError(ctx, resp, wrapInternal(err, "failed to marshal json response")) - return - } - - ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK) - resp.Header().Set("Content-Type", "application/json") - resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes))) - resp.WriteHeader(http.StatusOK) - - if n, err := resp.Write(respBytes); err != nil { - msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error()) - twerr := twirp.NewError(twirp.Unknown, msg) - ctx = callError(ctx, s.hooks, twerr) - } - callResponseSent(ctx, s.hooks) -} - -func (s *cloudAgentServer) serveListAgentsProtobuf(ctx context.Context, resp http.ResponseWriter, req *http.Request) { - var err error - ctx = ctxsetters.WithMethodName(ctx, "ListAgents") - ctx, err = callRequestRouted(ctx, s.hooks) - if err != nil { - s.writeError(ctx, resp, err) - return - } - - buf, err := io.ReadAll(req.Body) - if err != nil { - s.handleRequestBodyError(ctx, resp, "failed to read request body", err) - return - } - reqContent := new(ListAgentsRequest) - if err = proto.Unmarshal(buf, reqContent); err != nil { - s.writeError(ctx, resp, malformedRequestError("the protobuf request could not be decoded")) - return - } - - handler := s.CloudAgent.ListAgents - if s.interceptor != nil { - handler = func(ctx context.Context, req *ListAgentsRequest) (*ListAgentsResponse, error) { - resp, err := s.interceptor( - func(ctx context.Context, req interface{}) (interface{}, error) { - typedReq, ok := req.(*ListAgentsRequest) - if !ok { - return nil, twirp.InternalError("failed type assertion req.(*ListAgentsRequest) when calling interceptor") - } - return s.CloudAgent.ListAgents(ctx, typedReq) - }, - )(ctx, req) - if resp != nil { - typedResp, ok := resp.(*ListAgentsResponse) - if !ok { - return nil, twirp.InternalError("failed type assertion resp.(*ListAgentsResponse) when calling interceptor") - } - return typedResp, err - } - return nil, err - } - } - - // Call service method - var respContent *ListAgentsResponse - func() { - defer ensurePanicResponses(ctx, resp, s.hooks) - respContent, err = handler(ctx, reqContent) - }() - - if err != nil { - s.writeError(ctx, resp, err) - return - } - if respContent == nil { - s.writeError(ctx, resp, twirp.InternalError("received a nil *ListAgentsResponse and nil error while calling ListAgents. nil responses are not supported")) - return - } - - ctx = callResponsePrepared(ctx, s.hooks) - - respBytes, err := proto.Marshal(respContent) - if err != nil { - s.writeError(ctx, resp, wrapInternal(err, "failed to marshal proto response")) - return - } - - ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK) - resp.Header().Set("Content-Type", "application/protobuf") - resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes))) - resp.WriteHeader(http.StatusOK) - if n, err := resp.Write(respBytes); err != nil { - msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error()) - twerr := twirp.NewError(twirp.Unknown, msg) - ctx = callError(ctx, s.hooks, twerr) - } - callResponseSent(ctx, s.hooks) -} - -func (s *cloudAgentServer) serveListAgentVersions(ctx context.Context, resp http.ResponseWriter, req *http.Request) { - header := req.Header.Get("Content-Type") - i := strings.Index(header, ";") - if i == -1 { - i = len(header) - } - switch strings.TrimSpace(strings.ToLower(header[:i])) { - case "application/json": - s.serveListAgentVersionsJSON(ctx, resp, req) - case "application/protobuf": - s.serveListAgentVersionsProtobuf(ctx, resp, req) - default: - msg := fmt.Sprintf("unexpected Content-Type: %q", req.Header.Get("Content-Type")) - twerr := badRouteError(msg, req.Method, req.URL.Path) - s.writeError(ctx, resp, twerr) - } -} - -func (s *cloudAgentServer) serveListAgentVersionsJSON(ctx context.Context, resp http.ResponseWriter, req *http.Request) { - var err error - ctx = ctxsetters.WithMethodName(ctx, "ListAgentVersions") - ctx, err = callRequestRouted(ctx, s.hooks) - if err != nil { - s.writeError(ctx, resp, err) - return - } - - d := json.NewDecoder(req.Body) - rawReqBody := json.RawMessage{} - if err := d.Decode(&rawReqBody); err != nil { - s.handleRequestBodyError(ctx, resp, "the json request could not be decoded", err) - return - } - reqContent := new(ListAgentVersionsRequest) - unmarshaler := protojson.UnmarshalOptions{DiscardUnknown: true} - if err = unmarshaler.Unmarshal(rawReqBody, reqContent); err != nil { - s.handleRequestBodyError(ctx, resp, "the json request could not be decoded", err) - return - } - - handler := s.CloudAgent.ListAgentVersions - if s.interceptor != nil { - handler = func(ctx context.Context, req *ListAgentVersionsRequest) (*ListAgentVersionsResponse, error) { - resp, err := s.interceptor( - func(ctx context.Context, req interface{}) (interface{}, error) { - typedReq, ok := req.(*ListAgentVersionsRequest) - if !ok { - return nil, twirp.InternalError("failed type assertion req.(*ListAgentVersionsRequest) when calling interceptor") - } - return s.CloudAgent.ListAgentVersions(ctx, typedReq) - }, - )(ctx, req) - if resp != nil { - typedResp, ok := resp.(*ListAgentVersionsResponse) - if !ok { - return nil, twirp.InternalError("failed type assertion resp.(*ListAgentVersionsResponse) when calling interceptor") - } - return typedResp, err - } - return nil, err - } - } - - // Call service method - var respContent *ListAgentVersionsResponse - func() { - defer ensurePanicResponses(ctx, resp, s.hooks) - respContent, err = handler(ctx, reqContent) - }() - - if err != nil { - s.writeError(ctx, resp, err) - return - } - if respContent == nil { - s.writeError(ctx, resp, twirp.InternalError("received a nil *ListAgentVersionsResponse and nil error while calling ListAgentVersions. nil responses are not supported")) - return - } - - ctx = callResponsePrepared(ctx, s.hooks) - - marshaler := &protojson.MarshalOptions{UseProtoNames: !s.jsonCamelCase, EmitUnpopulated: !s.jsonSkipDefaults} - respBytes, err := marshaler.Marshal(respContent) - if err != nil { - s.writeError(ctx, resp, wrapInternal(err, "failed to marshal json response")) - return - } - - ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK) - resp.Header().Set("Content-Type", "application/json") - resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes))) - resp.WriteHeader(http.StatusOK) - - if n, err := resp.Write(respBytes); err != nil { - msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error()) - twerr := twirp.NewError(twirp.Unknown, msg) - ctx = callError(ctx, s.hooks, twerr) - } - callResponseSent(ctx, s.hooks) -} - -func (s *cloudAgentServer) serveListAgentVersionsProtobuf(ctx context.Context, resp http.ResponseWriter, req *http.Request) { - var err error - ctx = ctxsetters.WithMethodName(ctx, "ListAgentVersions") - ctx, err = callRequestRouted(ctx, s.hooks) - if err != nil { - s.writeError(ctx, resp, err) - return - } - - buf, err := io.ReadAll(req.Body) - if err != nil { - s.handleRequestBodyError(ctx, resp, "failed to read request body", err) - return - } - reqContent := new(ListAgentVersionsRequest) - if err = proto.Unmarshal(buf, reqContent); err != nil { - s.writeError(ctx, resp, malformedRequestError("the protobuf request could not be decoded")) - return - } - - handler := s.CloudAgent.ListAgentVersions - if s.interceptor != nil { - handler = func(ctx context.Context, req *ListAgentVersionsRequest) (*ListAgentVersionsResponse, error) { - resp, err := s.interceptor( - func(ctx context.Context, req interface{}) (interface{}, error) { - typedReq, ok := req.(*ListAgentVersionsRequest) - if !ok { - return nil, twirp.InternalError("failed type assertion req.(*ListAgentVersionsRequest) when calling interceptor") - } - return s.CloudAgent.ListAgentVersions(ctx, typedReq) - }, - )(ctx, req) - if resp != nil { - typedResp, ok := resp.(*ListAgentVersionsResponse) - if !ok { - return nil, twirp.InternalError("failed type assertion resp.(*ListAgentVersionsResponse) when calling interceptor") - } - return typedResp, err - } - return nil, err - } - } - - // Call service method - var respContent *ListAgentVersionsResponse - func() { - defer ensurePanicResponses(ctx, resp, s.hooks) - respContent, err = handler(ctx, reqContent) - }() - - if err != nil { - s.writeError(ctx, resp, err) - return - } - if respContent == nil { - s.writeError(ctx, resp, twirp.InternalError("received a nil *ListAgentVersionsResponse and nil error while calling ListAgentVersions. nil responses are not supported")) - return - } - - ctx = callResponsePrepared(ctx, s.hooks) - - respBytes, err := proto.Marshal(respContent) - if err != nil { - s.writeError(ctx, resp, wrapInternal(err, "failed to marshal proto response")) - return - } - - ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK) - resp.Header().Set("Content-Type", "application/protobuf") - resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes))) - resp.WriteHeader(http.StatusOK) - if n, err := resp.Write(respBytes); err != nil { - msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error()) - twerr := twirp.NewError(twirp.Unknown, msg) - ctx = callError(ctx, s.hooks, twerr) - } - callResponseSent(ctx, s.hooks) -} - -func (s *cloudAgentServer) serveListAgentSecrets(ctx context.Context, resp http.ResponseWriter, req *http.Request) { - header := req.Header.Get("Content-Type") - i := strings.Index(header, ";") - if i == -1 { - i = len(header) - } - switch strings.TrimSpace(strings.ToLower(header[:i])) { - case "application/json": - s.serveListAgentSecretsJSON(ctx, resp, req) - case "application/protobuf": - s.serveListAgentSecretsProtobuf(ctx, resp, req) - default: - msg := fmt.Sprintf("unexpected Content-Type: %q", req.Header.Get("Content-Type")) - twerr := badRouteError(msg, req.Method, req.URL.Path) - s.writeError(ctx, resp, twerr) - } -} - -func (s *cloudAgentServer) serveListAgentSecretsJSON(ctx context.Context, resp http.ResponseWriter, req *http.Request) { - var err error - ctx = ctxsetters.WithMethodName(ctx, "ListAgentSecrets") - ctx, err = callRequestRouted(ctx, s.hooks) - if err != nil { - s.writeError(ctx, resp, err) - return - } - - d := json.NewDecoder(req.Body) - rawReqBody := json.RawMessage{} - if err := d.Decode(&rawReqBody); err != nil { - s.handleRequestBodyError(ctx, resp, "the json request could not be decoded", err) - return - } - reqContent := new(ListAgentSecretsRequest) - unmarshaler := protojson.UnmarshalOptions{DiscardUnknown: true} - if err = unmarshaler.Unmarshal(rawReqBody, reqContent); err != nil { - s.handleRequestBodyError(ctx, resp, "the json request could not be decoded", err) - return - } - - handler := s.CloudAgent.ListAgentSecrets - if s.interceptor != nil { - handler = func(ctx context.Context, req *ListAgentSecretsRequest) (*ListAgentSecretsResponse, error) { - resp, err := s.interceptor( - func(ctx context.Context, req interface{}) (interface{}, error) { - typedReq, ok := req.(*ListAgentSecretsRequest) - if !ok { - return nil, twirp.InternalError("failed type assertion req.(*ListAgentSecretsRequest) when calling interceptor") - } - return s.CloudAgent.ListAgentSecrets(ctx, typedReq) - }, - )(ctx, req) - if resp != nil { - typedResp, ok := resp.(*ListAgentSecretsResponse) - if !ok { - return nil, twirp.InternalError("failed type assertion resp.(*ListAgentSecretsResponse) when calling interceptor") - } - return typedResp, err - } - return nil, err - } - } - - // Call service method - var respContent *ListAgentSecretsResponse - func() { - defer ensurePanicResponses(ctx, resp, s.hooks) - respContent, err = handler(ctx, reqContent) - }() - - if err != nil { - s.writeError(ctx, resp, err) - return - } - if respContent == nil { - s.writeError(ctx, resp, twirp.InternalError("received a nil *ListAgentSecretsResponse and nil error while calling ListAgentSecrets. nil responses are not supported")) - return - } - - ctx = callResponsePrepared(ctx, s.hooks) - - marshaler := &protojson.MarshalOptions{UseProtoNames: !s.jsonCamelCase, EmitUnpopulated: !s.jsonSkipDefaults} - respBytes, err := marshaler.Marshal(respContent) - if err != nil { - s.writeError(ctx, resp, wrapInternal(err, "failed to marshal json response")) - return - } - - ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK) - resp.Header().Set("Content-Type", "application/json") - resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes))) - resp.WriteHeader(http.StatusOK) - - if n, err := resp.Write(respBytes); err != nil { - msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error()) - twerr := twirp.NewError(twirp.Unknown, msg) - ctx = callError(ctx, s.hooks, twerr) - } - callResponseSent(ctx, s.hooks) -} - -func (s *cloudAgentServer) serveListAgentSecretsProtobuf(ctx context.Context, resp http.ResponseWriter, req *http.Request) { - var err error - ctx = ctxsetters.WithMethodName(ctx, "ListAgentSecrets") - ctx, err = callRequestRouted(ctx, s.hooks) - if err != nil { - s.writeError(ctx, resp, err) - return - } - - buf, err := io.ReadAll(req.Body) - if err != nil { - s.handleRequestBodyError(ctx, resp, "failed to read request body", err) - return - } - reqContent := new(ListAgentSecretsRequest) - if err = proto.Unmarshal(buf, reqContent); err != nil { - s.writeError(ctx, resp, malformedRequestError("the protobuf request could not be decoded")) - return - } - - handler := s.CloudAgent.ListAgentSecrets - if s.interceptor != nil { - handler = func(ctx context.Context, req *ListAgentSecretsRequest) (*ListAgentSecretsResponse, error) { - resp, err := s.interceptor( - func(ctx context.Context, req interface{}) (interface{}, error) { - typedReq, ok := req.(*ListAgentSecretsRequest) - if !ok { - return nil, twirp.InternalError("failed type assertion req.(*ListAgentSecretsRequest) when calling interceptor") - } - return s.CloudAgent.ListAgentSecrets(ctx, typedReq) - }, - )(ctx, req) - if resp != nil { - typedResp, ok := resp.(*ListAgentSecretsResponse) - if !ok { - return nil, twirp.InternalError("failed type assertion resp.(*ListAgentSecretsResponse) when calling interceptor") - } - return typedResp, err - } - return nil, err - } - } - - // Call service method - var respContent *ListAgentSecretsResponse - func() { - defer ensurePanicResponses(ctx, resp, s.hooks) - respContent, err = handler(ctx, reqContent) - }() - - if err != nil { - s.writeError(ctx, resp, err) - return - } - if respContent == nil { - s.writeError(ctx, resp, twirp.InternalError("received a nil *ListAgentSecretsResponse and nil error while calling ListAgentSecrets. nil responses are not supported")) - return - } - - ctx = callResponsePrepared(ctx, s.hooks) - - respBytes, err := proto.Marshal(respContent) - if err != nil { - s.writeError(ctx, resp, wrapInternal(err, "failed to marshal proto response")) - return - } - - ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK) - resp.Header().Set("Content-Type", "application/protobuf") - resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes))) - resp.WriteHeader(http.StatusOK) - if n, err := resp.Write(respBytes); err != nil { - msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error()) - twerr := twirp.NewError(twirp.Unknown, msg) - ctx = callError(ctx, s.hooks, twerr) - } - callResponseSent(ctx, s.hooks) -} - -func (s *cloudAgentServer) serveUpdateAgent(ctx context.Context, resp http.ResponseWriter, req *http.Request) { - header := req.Header.Get("Content-Type") - i := strings.Index(header, ";") - if i == -1 { - i = len(header) - } - switch strings.TrimSpace(strings.ToLower(header[:i])) { - case "application/json": - s.serveUpdateAgentJSON(ctx, resp, req) - case "application/protobuf": - s.serveUpdateAgentProtobuf(ctx, resp, req) - default: - msg := fmt.Sprintf("unexpected Content-Type: %q", req.Header.Get("Content-Type")) - twerr := badRouteError(msg, req.Method, req.URL.Path) - s.writeError(ctx, resp, twerr) - } -} - -func (s *cloudAgentServer) serveUpdateAgentJSON(ctx context.Context, resp http.ResponseWriter, req *http.Request) { - var err error - ctx = ctxsetters.WithMethodName(ctx, "UpdateAgent") - ctx, err = callRequestRouted(ctx, s.hooks) - if err != nil { - s.writeError(ctx, resp, err) - return - } - - d := json.NewDecoder(req.Body) - rawReqBody := json.RawMessage{} - if err := d.Decode(&rawReqBody); err != nil { - s.handleRequestBodyError(ctx, resp, "the json request could not be decoded", err) - return - } - reqContent := new(UpdateAgentRequest) - unmarshaler := protojson.UnmarshalOptions{DiscardUnknown: true} - if err = unmarshaler.Unmarshal(rawReqBody, reqContent); err != nil { - s.handleRequestBodyError(ctx, resp, "the json request could not be decoded", err) - return - } - - handler := s.CloudAgent.UpdateAgent - if s.interceptor != nil { - handler = func(ctx context.Context, req *UpdateAgentRequest) (*UpdateAgentResponse, error) { - resp, err := s.interceptor( - func(ctx context.Context, req interface{}) (interface{}, error) { - typedReq, ok := req.(*UpdateAgentRequest) - if !ok { - return nil, twirp.InternalError("failed type assertion req.(*UpdateAgentRequest) when calling interceptor") - } - return s.CloudAgent.UpdateAgent(ctx, typedReq) - }, - )(ctx, req) - if resp != nil { - typedResp, ok := resp.(*UpdateAgentResponse) - if !ok { - return nil, twirp.InternalError("failed type assertion resp.(*UpdateAgentResponse) when calling interceptor") - } - return typedResp, err - } - return nil, err - } - } - - // Call service method - var respContent *UpdateAgentResponse - func() { - defer ensurePanicResponses(ctx, resp, s.hooks) - respContent, err = handler(ctx, reqContent) - }() - - if err != nil { - s.writeError(ctx, resp, err) - return - } - if respContent == nil { - s.writeError(ctx, resp, twirp.InternalError("received a nil *UpdateAgentResponse and nil error while calling UpdateAgent. nil responses are not supported")) - return - } - - ctx = callResponsePrepared(ctx, s.hooks) - - marshaler := &protojson.MarshalOptions{UseProtoNames: !s.jsonCamelCase, EmitUnpopulated: !s.jsonSkipDefaults} - respBytes, err := marshaler.Marshal(respContent) - if err != nil { - s.writeError(ctx, resp, wrapInternal(err, "failed to marshal json response")) - return - } - - ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK) - resp.Header().Set("Content-Type", "application/json") - resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes))) - resp.WriteHeader(http.StatusOK) - - if n, err := resp.Write(respBytes); err != nil { - msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error()) - twerr := twirp.NewError(twirp.Unknown, msg) - ctx = callError(ctx, s.hooks, twerr) - } - callResponseSent(ctx, s.hooks) -} - -func (s *cloudAgentServer) serveUpdateAgentProtobuf(ctx context.Context, resp http.ResponseWriter, req *http.Request) { - var err error - ctx = ctxsetters.WithMethodName(ctx, "UpdateAgent") - ctx, err = callRequestRouted(ctx, s.hooks) - if err != nil { - s.writeError(ctx, resp, err) - return - } - - buf, err := io.ReadAll(req.Body) - if err != nil { - s.handleRequestBodyError(ctx, resp, "failed to read request body", err) - return - } - reqContent := new(UpdateAgentRequest) - if err = proto.Unmarshal(buf, reqContent); err != nil { - s.writeError(ctx, resp, malformedRequestError("the protobuf request could not be decoded")) - return - } - - handler := s.CloudAgent.UpdateAgent - if s.interceptor != nil { - handler = func(ctx context.Context, req *UpdateAgentRequest) (*UpdateAgentResponse, error) { - resp, err := s.interceptor( - func(ctx context.Context, req interface{}) (interface{}, error) { - typedReq, ok := req.(*UpdateAgentRequest) - if !ok { - return nil, twirp.InternalError("failed type assertion req.(*UpdateAgentRequest) when calling interceptor") - } - return s.CloudAgent.UpdateAgent(ctx, typedReq) - }, - )(ctx, req) - if resp != nil { - typedResp, ok := resp.(*UpdateAgentResponse) - if !ok { - return nil, twirp.InternalError("failed type assertion resp.(*UpdateAgentResponse) when calling interceptor") - } - return typedResp, err - } - return nil, err - } - } - - // Call service method - var respContent *UpdateAgentResponse - func() { - defer ensurePanicResponses(ctx, resp, s.hooks) - respContent, err = handler(ctx, reqContent) - }() - - if err != nil { - s.writeError(ctx, resp, err) - return - } - if respContent == nil { - s.writeError(ctx, resp, twirp.InternalError("received a nil *UpdateAgentResponse and nil error while calling UpdateAgent. nil responses are not supported")) - return - } - - ctx = callResponsePrepared(ctx, s.hooks) - - respBytes, err := proto.Marshal(respContent) - if err != nil { - s.writeError(ctx, resp, wrapInternal(err, "failed to marshal proto response")) - return - } - - ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK) - resp.Header().Set("Content-Type", "application/protobuf") - resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes))) - resp.WriteHeader(http.StatusOK) - if n, err := resp.Write(respBytes); err != nil { - msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error()) - twerr := twirp.NewError(twirp.Unknown, msg) - ctx = callError(ctx, s.hooks, twerr) - } - callResponseSent(ctx, s.hooks) -} - -func (s *cloudAgentServer) serveRestartAgent(ctx context.Context, resp http.ResponseWriter, req *http.Request) { - header := req.Header.Get("Content-Type") - i := strings.Index(header, ";") - if i == -1 { - i = len(header) - } - switch strings.TrimSpace(strings.ToLower(header[:i])) { - case "application/json": - s.serveRestartAgentJSON(ctx, resp, req) - case "application/protobuf": - s.serveRestartAgentProtobuf(ctx, resp, req) - default: - msg := fmt.Sprintf("unexpected Content-Type: %q", req.Header.Get("Content-Type")) - twerr := badRouteError(msg, req.Method, req.URL.Path) - s.writeError(ctx, resp, twerr) - } -} - -func (s *cloudAgentServer) serveRestartAgentJSON(ctx context.Context, resp http.ResponseWriter, req *http.Request) { - var err error - ctx = ctxsetters.WithMethodName(ctx, "RestartAgent") - ctx, err = callRequestRouted(ctx, s.hooks) - if err != nil { - s.writeError(ctx, resp, err) - return - } - - d := json.NewDecoder(req.Body) - rawReqBody := json.RawMessage{} - if err := d.Decode(&rawReqBody); err != nil { - s.handleRequestBodyError(ctx, resp, "the json request could not be decoded", err) - return - } - reqContent := new(RestartAgentRequest) - unmarshaler := protojson.UnmarshalOptions{DiscardUnknown: true} - if err = unmarshaler.Unmarshal(rawReqBody, reqContent); err != nil { - s.handleRequestBodyError(ctx, resp, "the json request could not be decoded", err) - return - } - - handler := s.CloudAgent.RestartAgent - if s.interceptor != nil { - handler = func(ctx context.Context, req *RestartAgentRequest) (*RestartAgentResponse, error) { - resp, err := s.interceptor( - func(ctx context.Context, req interface{}) (interface{}, error) { - typedReq, ok := req.(*RestartAgentRequest) - if !ok { - return nil, twirp.InternalError("failed type assertion req.(*RestartAgentRequest) when calling interceptor") - } - return s.CloudAgent.RestartAgent(ctx, typedReq) - }, - )(ctx, req) - if resp != nil { - typedResp, ok := resp.(*RestartAgentResponse) - if !ok { - return nil, twirp.InternalError("failed type assertion resp.(*RestartAgentResponse) when calling interceptor") - } - return typedResp, err - } - return nil, err - } - } - - // Call service method - var respContent *RestartAgentResponse - func() { - defer ensurePanicResponses(ctx, resp, s.hooks) - respContent, err = handler(ctx, reqContent) - }() - - if err != nil { - s.writeError(ctx, resp, err) - return - } - if respContent == nil { - s.writeError(ctx, resp, twirp.InternalError("received a nil *RestartAgentResponse and nil error while calling RestartAgent. nil responses are not supported")) - return - } - - ctx = callResponsePrepared(ctx, s.hooks) - - marshaler := &protojson.MarshalOptions{UseProtoNames: !s.jsonCamelCase, EmitUnpopulated: !s.jsonSkipDefaults} - respBytes, err := marshaler.Marshal(respContent) - if err != nil { - s.writeError(ctx, resp, wrapInternal(err, "failed to marshal json response")) - return - } - - ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK) - resp.Header().Set("Content-Type", "application/json") - resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes))) - resp.WriteHeader(http.StatusOK) - - if n, err := resp.Write(respBytes); err != nil { - msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error()) - twerr := twirp.NewError(twirp.Unknown, msg) - ctx = callError(ctx, s.hooks, twerr) - } - callResponseSent(ctx, s.hooks) -} - -func (s *cloudAgentServer) serveRestartAgentProtobuf(ctx context.Context, resp http.ResponseWriter, req *http.Request) { - var err error - ctx = ctxsetters.WithMethodName(ctx, "RestartAgent") - ctx, err = callRequestRouted(ctx, s.hooks) - if err != nil { - s.writeError(ctx, resp, err) - return - } - - buf, err := io.ReadAll(req.Body) - if err != nil { - s.handleRequestBodyError(ctx, resp, "failed to read request body", err) - return - } - reqContent := new(RestartAgentRequest) - if err = proto.Unmarshal(buf, reqContent); err != nil { - s.writeError(ctx, resp, malformedRequestError("the protobuf request could not be decoded")) - return - } - - handler := s.CloudAgent.RestartAgent - if s.interceptor != nil { - handler = func(ctx context.Context, req *RestartAgentRequest) (*RestartAgentResponse, error) { - resp, err := s.interceptor( - func(ctx context.Context, req interface{}) (interface{}, error) { - typedReq, ok := req.(*RestartAgentRequest) - if !ok { - return nil, twirp.InternalError("failed type assertion req.(*RestartAgentRequest) when calling interceptor") - } - return s.CloudAgent.RestartAgent(ctx, typedReq) - }, - )(ctx, req) - if resp != nil { - typedResp, ok := resp.(*RestartAgentResponse) - if !ok { - return nil, twirp.InternalError("failed type assertion resp.(*RestartAgentResponse) when calling interceptor") - } - return typedResp, err - } - return nil, err - } - } - - // Call service method - var respContent *RestartAgentResponse - func() { - defer ensurePanicResponses(ctx, resp, s.hooks) - respContent, err = handler(ctx, reqContent) - }() - - if err != nil { - s.writeError(ctx, resp, err) - return - } - if respContent == nil { - s.writeError(ctx, resp, twirp.InternalError("received a nil *RestartAgentResponse and nil error while calling RestartAgent. nil responses are not supported")) - return - } - - ctx = callResponsePrepared(ctx, s.hooks) - - respBytes, err := proto.Marshal(respContent) - if err != nil { - s.writeError(ctx, resp, wrapInternal(err, "failed to marshal proto response")) - return - } - - ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK) - resp.Header().Set("Content-Type", "application/protobuf") - resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes))) - resp.WriteHeader(http.StatusOK) - if n, err := resp.Write(respBytes); err != nil { - msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error()) - twerr := twirp.NewError(twirp.Unknown, msg) - ctx = callError(ctx, s.hooks, twerr) - } - callResponseSent(ctx, s.hooks) -} - -func (s *cloudAgentServer) serveDeployAgent(ctx context.Context, resp http.ResponseWriter, req *http.Request) { - header := req.Header.Get("Content-Type") - i := strings.Index(header, ";") - if i == -1 { - i = len(header) - } - switch strings.TrimSpace(strings.ToLower(header[:i])) { - case "application/json": - s.serveDeployAgentJSON(ctx, resp, req) - case "application/protobuf": - s.serveDeployAgentProtobuf(ctx, resp, req) - default: - msg := fmt.Sprintf("unexpected Content-Type: %q", req.Header.Get("Content-Type")) - twerr := badRouteError(msg, req.Method, req.URL.Path) - s.writeError(ctx, resp, twerr) - } -} - -func (s *cloudAgentServer) serveDeployAgentJSON(ctx context.Context, resp http.ResponseWriter, req *http.Request) { - var err error - ctx = ctxsetters.WithMethodName(ctx, "DeployAgent") - ctx, err = callRequestRouted(ctx, s.hooks) - if err != nil { - s.writeError(ctx, resp, err) - return - } - - d := json.NewDecoder(req.Body) - rawReqBody := json.RawMessage{} - if err := d.Decode(&rawReqBody); err != nil { - s.handleRequestBodyError(ctx, resp, "the json request could not be decoded", err) - return - } - reqContent := new(DeployAgentRequest) - unmarshaler := protojson.UnmarshalOptions{DiscardUnknown: true} - if err = unmarshaler.Unmarshal(rawReqBody, reqContent); err != nil { - s.handleRequestBodyError(ctx, resp, "the json request could not be decoded", err) - return - } - - handler := s.CloudAgent.DeployAgent - if s.interceptor != nil { - handler = func(ctx context.Context, req *DeployAgentRequest) (*DeployAgentResponse, error) { - resp, err := s.interceptor( - func(ctx context.Context, req interface{}) (interface{}, error) { - typedReq, ok := req.(*DeployAgentRequest) - if !ok { - return nil, twirp.InternalError("failed type assertion req.(*DeployAgentRequest) when calling interceptor") - } - return s.CloudAgent.DeployAgent(ctx, typedReq) - }, - )(ctx, req) - if resp != nil { - typedResp, ok := resp.(*DeployAgentResponse) - if !ok { - return nil, twirp.InternalError("failed type assertion resp.(*DeployAgentResponse) when calling interceptor") - } - return typedResp, err - } - return nil, err - } - } - - // Call service method - var respContent *DeployAgentResponse - func() { - defer ensurePanicResponses(ctx, resp, s.hooks) - respContent, err = handler(ctx, reqContent) - }() - - if err != nil { - s.writeError(ctx, resp, err) - return - } - if respContent == nil { - s.writeError(ctx, resp, twirp.InternalError("received a nil *DeployAgentResponse and nil error while calling DeployAgent. nil responses are not supported")) - return - } - - ctx = callResponsePrepared(ctx, s.hooks) - - marshaler := &protojson.MarshalOptions{UseProtoNames: !s.jsonCamelCase, EmitUnpopulated: !s.jsonSkipDefaults} - respBytes, err := marshaler.Marshal(respContent) - if err != nil { - s.writeError(ctx, resp, wrapInternal(err, "failed to marshal json response")) - return - } - - ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK) - resp.Header().Set("Content-Type", "application/json") - resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes))) - resp.WriteHeader(http.StatusOK) - - if n, err := resp.Write(respBytes); err != nil { - msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error()) - twerr := twirp.NewError(twirp.Unknown, msg) - ctx = callError(ctx, s.hooks, twerr) - } - callResponseSent(ctx, s.hooks) -} - -func (s *cloudAgentServer) serveDeployAgentProtobuf(ctx context.Context, resp http.ResponseWriter, req *http.Request) { - var err error - ctx = ctxsetters.WithMethodName(ctx, "DeployAgent") - ctx, err = callRequestRouted(ctx, s.hooks) - if err != nil { - s.writeError(ctx, resp, err) - return - } - - buf, err := io.ReadAll(req.Body) - if err != nil { - s.handleRequestBodyError(ctx, resp, "failed to read request body", err) - return - } - reqContent := new(DeployAgentRequest) - if err = proto.Unmarshal(buf, reqContent); err != nil { - s.writeError(ctx, resp, malformedRequestError("the protobuf request could not be decoded")) - return - } - - handler := s.CloudAgent.DeployAgent - if s.interceptor != nil { - handler = func(ctx context.Context, req *DeployAgentRequest) (*DeployAgentResponse, error) { - resp, err := s.interceptor( - func(ctx context.Context, req interface{}) (interface{}, error) { - typedReq, ok := req.(*DeployAgentRequest) - if !ok { - return nil, twirp.InternalError("failed type assertion req.(*DeployAgentRequest) when calling interceptor") - } - return s.CloudAgent.DeployAgent(ctx, typedReq) - }, - )(ctx, req) - if resp != nil { - typedResp, ok := resp.(*DeployAgentResponse) - if !ok { - return nil, twirp.InternalError("failed type assertion resp.(*DeployAgentResponse) when calling interceptor") - } - return typedResp, err - } - return nil, err - } - } - - // Call service method - var respContent *DeployAgentResponse - func() { - defer ensurePanicResponses(ctx, resp, s.hooks) - respContent, err = handler(ctx, reqContent) - }() - - if err != nil { - s.writeError(ctx, resp, err) - return - } - if respContent == nil { - s.writeError(ctx, resp, twirp.InternalError("received a nil *DeployAgentResponse and nil error while calling DeployAgent. nil responses are not supported")) - return - } - - ctx = callResponsePrepared(ctx, s.hooks) - - respBytes, err := proto.Marshal(respContent) - if err != nil { - s.writeError(ctx, resp, wrapInternal(err, "failed to marshal proto response")) - return - } - - ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK) - resp.Header().Set("Content-Type", "application/protobuf") - resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes))) - resp.WriteHeader(http.StatusOK) - if n, err := resp.Write(respBytes); err != nil { - msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error()) - twerr := twirp.NewError(twirp.Unknown, msg) - ctx = callError(ctx, s.hooks, twerr) - } - callResponseSent(ctx, s.hooks) -} - -func (s *cloudAgentServer) serveUpdateAgentSecrets(ctx context.Context, resp http.ResponseWriter, req *http.Request) { - header := req.Header.Get("Content-Type") - i := strings.Index(header, ";") - if i == -1 { - i = len(header) - } - switch strings.TrimSpace(strings.ToLower(header[:i])) { - case "application/json": - s.serveUpdateAgentSecretsJSON(ctx, resp, req) - case "application/protobuf": - s.serveUpdateAgentSecretsProtobuf(ctx, resp, req) - default: - msg := fmt.Sprintf("unexpected Content-Type: %q", req.Header.Get("Content-Type")) - twerr := badRouteError(msg, req.Method, req.URL.Path) - s.writeError(ctx, resp, twerr) - } -} - -func (s *cloudAgentServer) serveUpdateAgentSecretsJSON(ctx context.Context, resp http.ResponseWriter, req *http.Request) { - var err error - ctx = ctxsetters.WithMethodName(ctx, "UpdateAgentSecrets") - ctx, err = callRequestRouted(ctx, s.hooks) - if err != nil { - s.writeError(ctx, resp, err) - return - } - - d := json.NewDecoder(req.Body) - rawReqBody := json.RawMessage{} - if err := d.Decode(&rawReqBody); err != nil { - s.handleRequestBodyError(ctx, resp, "the json request could not be decoded", err) - return - } - reqContent := new(UpdateAgentSecretsRequest) - unmarshaler := protojson.UnmarshalOptions{DiscardUnknown: true} - if err = unmarshaler.Unmarshal(rawReqBody, reqContent); err != nil { - s.handleRequestBodyError(ctx, resp, "the json request could not be decoded", err) - return - } - - handler := s.CloudAgent.UpdateAgentSecrets - if s.interceptor != nil { - handler = func(ctx context.Context, req *UpdateAgentSecretsRequest) (*UpdateAgentSecretsResponse, error) { - resp, err := s.interceptor( - func(ctx context.Context, req interface{}) (interface{}, error) { - typedReq, ok := req.(*UpdateAgentSecretsRequest) - if !ok { - return nil, twirp.InternalError("failed type assertion req.(*UpdateAgentSecretsRequest) when calling interceptor") - } - return s.CloudAgent.UpdateAgentSecrets(ctx, typedReq) - }, - )(ctx, req) - if resp != nil { - typedResp, ok := resp.(*UpdateAgentSecretsResponse) - if !ok { - return nil, twirp.InternalError("failed type assertion resp.(*UpdateAgentSecretsResponse) when calling interceptor") - } - return typedResp, err - } - return nil, err - } - } - - // Call service method - var respContent *UpdateAgentSecretsResponse - func() { - defer ensurePanicResponses(ctx, resp, s.hooks) - respContent, err = handler(ctx, reqContent) - }() - - if err != nil { - s.writeError(ctx, resp, err) - return - } - if respContent == nil { - s.writeError(ctx, resp, twirp.InternalError("received a nil *UpdateAgentSecretsResponse and nil error while calling UpdateAgentSecrets. nil responses are not supported")) - return - } - - ctx = callResponsePrepared(ctx, s.hooks) - - marshaler := &protojson.MarshalOptions{UseProtoNames: !s.jsonCamelCase, EmitUnpopulated: !s.jsonSkipDefaults} - respBytes, err := marshaler.Marshal(respContent) - if err != nil { - s.writeError(ctx, resp, wrapInternal(err, "failed to marshal json response")) - return - } - - ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK) - resp.Header().Set("Content-Type", "application/json") - resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes))) - resp.WriteHeader(http.StatusOK) - - if n, err := resp.Write(respBytes); err != nil { - msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error()) - twerr := twirp.NewError(twirp.Unknown, msg) - ctx = callError(ctx, s.hooks, twerr) - } - callResponseSent(ctx, s.hooks) -} - -func (s *cloudAgentServer) serveUpdateAgentSecretsProtobuf(ctx context.Context, resp http.ResponseWriter, req *http.Request) { - var err error - ctx = ctxsetters.WithMethodName(ctx, "UpdateAgentSecrets") - ctx, err = callRequestRouted(ctx, s.hooks) - if err != nil { - s.writeError(ctx, resp, err) - return - } - - buf, err := io.ReadAll(req.Body) - if err != nil { - s.handleRequestBodyError(ctx, resp, "failed to read request body", err) - return - } - reqContent := new(UpdateAgentSecretsRequest) - if err = proto.Unmarshal(buf, reqContent); err != nil { - s.writeError(ctx, resp, malformedRequestError("the protobuf request could not be decoded")) - return - } - - handler := s.CloudAgent.UpdateAgentSecrets - if s.interceptor != nil { - handler = func(ctx context.Context, req *UpdateAgentSecretsRequest) (*UpdateAgentSecretsResponse, error) { - resp, err := s.interceptor( - func(ctx context.Context, req interface{}) (interface{}, error) { - typedReq, ok := req.(*UpdateAgentSecretsRequest) - if !ok { - return nil, twirp.InternalError("failed type assertion req.(*UpdateAgentSecretsRequest) when calling interceptor") - } - return s.CloudAgent.UpdateAgentSecrets(ctx, typedReq) - }, - )(ctx, req) - if resp != nil { - typedResp, ok := resp.(*UpdateAgentSecretsResponse) - if !ok { - return nil, twirp.InternalError("failed type assertion resp.(*UpdateAgentSecretsResponse) when calling interceptor") - } - return typedResp, err - } - return nil, err - } - } - - // Call service method - var respContent *UpdateAgentSecretsResponse - func() { - defer ensurePanicResponses(ctx, resp, s.hooks) - respContent, err = handler(ctx, reqContent) - }() - - if err != nil { - s.writeError(ctx, resp, err) - return - } - if respContent == nil { - s.writeError(ctx, resp, twirp.InternalError("received a nil *UpdateAgentSecretsResponse and nil error while calling UpdateAgentSecrets. nil responses are not supported")) - return - } - - ctx = callResponsePrepared(ctx, s.hooks) - - respBytes, err := proto.Marshal(respContent) - if err != nil { - s.writeError(ctx, resp, wrapInternal(err, "failed to marshal proto response")) - return - } - - ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK) - resp.Header().Set("Content-Type", "application/protobuf") - resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes))) - resp.WriteHeader(http.StatusOK) - if n, err := resp.Write(respBytes); err != nil { - msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error()) - twerr := twirp.NewError(twirp.Unknown, msg) - ctx = callError(ctx, s.hooks, twerr) - } - callResponseSent(ctx, s.hooks) -} - -func (s *cloudAgentServer) serveRollbackAgent(ctx context.Context, resp http.ResponseWriter, req *http.Request) { - header := req.Header.Get("Content-Type") - i := strings.Index(header, ";") - if i == -1 { - i = len(header) - } - switch strings.TrimSpace(strings.ToLower(header[:i])) { - case "application/json": - s.serveRollbackAgentJSON(ctx, resp, req) - case "application/protobuf": - s.serveRollbackAgentProtobuf(ctx, resp, req) - default: - msg := fmt.Sprintf("unexpected Content-Type: %q", req.Header.Get("Content-Type")) - twerr := badRouteError(msg, req.Method, req.URL.Path) - s.writeError(ctx, resp, twerr) - } -} - -func (s *cloudAgentServer) serveRollbackAgentJSON(ctx context.Context, resp http.ResponseWriter, req *http.Request) { - var err error - ctx = ctxsetters.WithMethodName(ctx, "RollbackAgent") - ctx, err = callRequestRouted(ctx, s.hooks) - if err != nil { - s.writeError(ctx, resp, err) - return - } - - d := json.NewDecoder(req.Body) - rawReqBody := json.RawMessage{} - if err := d.Decode(&rawReqBody); err != nil { - s.handleRequestBodyError(ctx, resp, "the json request could not be decoded", err) - return - } - reqContent := new(RollbackAgentRequest) - unmarshaler := protojson.UnmarshalOptions{DiscardUnknown: true} - if err = unmarshaler.Unmarshal(rawReqBody, reqContent); err != nil { - s.handleRequestBodyError(ctx, resp, "the json request could not be decoded", err) - return - } - - handler := s.CloudAgent.RollbackAgent - if s.interceptor != nil { - handler = func(ctx context.Context, req *RollbackAgentRequest) (*RollbackAgentResponse, error) { - resp, err := s.interceptor( - func(ctx context.Context, req interface{}) (interface{}, error) { - typedReq, ok := req.(*RollbackAgentRequest) - if !ok { - return nil, twirp.InternalError("failed type assertion req.(*RollbackAgentRequest) when calling interceptor") - } - return s.CloudAgent.RollbackAgent(ctx, typedReq) - }, - )(ctx, req) - if resp != nil { - typedResp, ok := resp.(*RollbackAgentResponse) - if !ok { - return nil, twirp.InternalError("failed type assertion resp.(*RollbackAgentResponse) when calling interceptor") - } - return typedResp, err - } - return nil, err - } - } - - // Call service method - var respContent *RollbackAgentResponse - func() { - defer ensurePanicResponses(ctx, resp, s.hooks) - respContent, err = handler(ctx, reqContent) - }() - - if err != nil { - s.writeError(ctx, resp, err) - return - } - if respContent == nil { - s.writeError(ctx, resp, twirp.InternalError("received a nil *RollbackAgentResponse and nil error while calling RollbackAgent. nil responses are not supported")) - return - } - - ctx = callResponsePrepared(ctx, s.hooks) - - marshaler := &protojson.MarshalOptions{UseProtoNames: !s.jsonCamelCase, EmitUnpopulated: !s.jsonSkipDefaults} - respBytes, err := marshaler.Marshal(respContent) - if err != nil { - s.writeError(ctx, resp, wrapInternal(err, "failed to marshal json response")) - return - } - - ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK) - resp.Header().Set("Content-Type", "application/json") - resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes))) - resp.WriteHeader(http.StatusOK) - - if n, err := resp.Write(respBytes); err != nil { - msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error()) - twerr := twirp.NewError(twirp.Unknown, msg) - ctx = callError(ctx, s.hooks, twerr) - } - callResponseSent(ctx, s.hooks) -} - -func (s *cloudAgentServer) serveRollbackAgentProtobuf(ctx context.Context, resp http.ResponseWriter, req *http.Request) { - var err error - ctx = ctxsetters.WithMethodName(ctx, "RollbackAgent") - ctx, err = callRequestRouted(ctx, s.hooks) - if err != nil { - s.writeError(ctx, resp, err) - return - } - - buf, err := io.ReadAll(req.Body) - if err != nil { - s.handleRequestBodyError(ctx, resp, "failed to read request body", err) - return - } - reqContent := new(RollbackAgentRequest) - if err = proto.Unmarshal(buf, reqContent); err != nil { - s.writeError(ctx, resp, malformedRequestError("the protobuf request could not be decoded")) - return - } - - handler := s.CloudAgent.RollbackAgent - if s.interceptor != nil { - handler = func(ctx context.Context, req *RollbackAgentRequest) (*RollbackAgentResponse, error) { - resp, err := s.interceptor( - func(ctx context.Context, req interface{}) (interface{}, error) { - typedReq, ok := req.(*RollbackAgentRequest) - if !ok { - return nil, twirp.InternalError("failed type assertion req.(*RollbackAgentRequest) when calling interceptor") - } - return s.CloudAgent.RollbackAgent(ctx, typedReq) - }, - )(ctx, req) - if resp != nil { - typedResp, ok := resp.(*RollbackAgentResponse) - if !ok { - return nil, twirp.InternalError("failed type assertion resp.(*RollbackAgentResponse) when calling interceptor") - } - return typedResp, err - } - return nil, err - } - } - - // Call service method - var respContent *RollbackAgentResponse - func() { - defer ensurePanicResponses(ctx, resp, s.hooks) - respContent, err = handler(ctx, reqContent) - }() - - if err != nil { - s.writeError(ctx, resp, err) - return - } - if respContent == nil { - s.writeError(ctx, resp, twirp.InternalError("received a nil *RollbackAgentResponse and nil error while calling RollbackAgent. nil responses are not supported")) - return - } - - ctx = callResponsePrepared(ctx, s.hooks) - - respBytes, err := proto.Marshal(respContent) - if err != nil { - s.writeError(ctx, resp, wrapInternal(err, "failed to marshal proto response")) - return - } - - ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK) - resp.Header().Set("Content-Type", "application/protobuf") - resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes))) - resp.WriteHeader(http.StatusOK) - if n, err := resp.Write(respBytes); err != nil { - msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error()) - twerr := twirp.NewError(twirp.Unknown, msg) - ctx = callError(ctx, s.hooks, twerr) - } - callResponseSent(ctx, s.hooks) -} - -func (s *cloudAgentServer) serveDeleteAgent(ctx context.Context, resp http.ResponseWriter, req *http.Request) { - header := req.Header.Get("Content-Type") - i := strings.Index(header, ";") - if i == -1 { - i = len(header) - } - switch strings.TrimSpace(strings.ToLower(header[:i])) { - case "application/json": - s.serveDeleteAgentJSON(ctx, resp, req) - case "application/protobuf": - s.serveDeleteAgentProtobuf(ctx, resp, req) - default: - msg := fmt.Sprintf("unexpected Content-Type: %q", req.Header.Get("Content-Type")) - twerr := badRouteError(msg, req.Method, req.URL.Path) - s.writeError(ctx, resp, twerr) - } -} - -func (s *cloudAgentServer) serveDeleteAgentJSON(ctx context.Context, resp http.ResponseWriter, req *http.Request) { - var err error - ctx = ctxsetters.WithMethodName(ctx, "DeleteAgent") - ctx, err = callRequestRouted(ctx, s.hooks) - if err != nil { - s.writeError(ctx, resp, err) - return - } - - d := json.NewDecoder(req.Body) - rawReqBody := json.RawMessage{} - if err := d.Decode(&rawReqBody); err != nil { - s.handleRequestBodyError(ctx, resp, "the json request could not be decoded", err) - return - } - reqContent := new(DeleteAgentRequest) - unmarshaler := protojson.UnmarshalOptions{DiscardUnknown: true} - if err = unmarshaler.Unmarshal(rawReqBody, reqContent); err != nil { - s.handleRequestBodyError(ctx, resp, "the json request could not be decoded", err) - return - } - - handler := s.CloudAgent.DeleteAgent - if s.interceptor != nil { - handler = func(ctx context.Context, req *DeleteAgentRequest) (*DeleteAgentResponse, error) { - resp, err := s.interceptor( - func(ctx context.Context, req interface{}) (interface{}, error) { - typedReq, ok := req.(*DeleteAgentRequest) - if !ok { - return nil, twirp.InternalError("failed type assertion req.(*DeleteAgentRequest) when calling interceptor") - } - return s.CloudAgent.DeleteAgent(ctx, typedReq) - }, - )(ctx, req) - if resp != nil { - typedResp, ok := resp.(*DeleteAgentResponse) - if !ok { - return nil, twirp.InternalError("failed type assertion resp.(*DeleteAgentResponse) when calling interceptor") - } - return typedResp, err - } - return nil, err - } - } - - // Call service method - var respContent *DeleteAgentResponse - func() { - defer ensurePanicResponses(ctx, resp, s.hooks) - respContent, err = handler(ctx, reqContent) - }() - - if err != nil { - s.writeError(ctx, resp, err) - return - } - if respContent == nil { - s.writeError(ctx, resp, twirp.InternalError("received a nil *DeleteAgentResponse and nil error while calling DeleteAgent. nil responses are not supported")) - return - } - - ctx = callResponsePrepared(ctx, s.hooks) - - marshaler := &protojson.MarshalOptions{UseProtoNames: !s.jsonCamelCase, EmitUnpopulated: !s.jsonSkipDefaults} - respBytes, err := marshaler.Marshal(respContent) - if err != nil { - s.writeError(ctx, resp, wrapInternal(err, "failed to marshal json response")) - return - } - - ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK) - resp.Header().Set("Content-Type", "application/json") - resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes))) - resp.WriteHeader(http.StatusOK) - - if n, err := resp.Write(respBytes); err != nil { - msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error()) - twerr := twirp.NewError(twirp.Unknown, msg) - ctx = callError(ctx, s.hooks, twerr) - } - callResponseSent(ctx, s.hooks) -} - -func (s *cloudAgentServer) serveDeleteAgentProtobuf(ctx context.Context, resp http.ResponseWriter, req *http.Request) { - var err error - ctx = ctxsetters.WithMethodName(ctx, "DeleteAgent") - ctx, err = callRequestRouted(ctx, s.hooks) - if err != nil { - s.writeError(ctx, resp, err) - return - } - - buf, err := io.ReadAll(req.Body) - if err != nil { - s.handleRequestBodyError(ctx, resp, "failed to read request body", err) - return - } - reqContent := new(DeleteAgentRequest) - if err = proto.Unmarshal(buf, reqContent); err != nil { - s.writeError(ctx, resp, malformedRequestError("the protobuf request could not be decoded")) - return - } - - handler := s.CloudAgent.DeleteAgent - if s.interceptor != nil { - handler = func(ctx context.Context, req *DeleteAgentRequest) (*DeleteAgentResponse, error) { - resp, err := s.interceptor( - func(ctx context.Context, req interface{}) (interface{}, error) { - typedReq, ok := req.(*DeleteAgentRequest) - if !ok { - return nil, twirp.InternalError("failed type assertion req.(*DeleteAgentRequest) when calling interceptor") - } - return s.CloudAgent.DeleteAgent(ctx, typedReq) - }, - )(ctx, req) - if resp != nil { - typedResp, ok := resp.(*DeleteAgentResponse) - if !ok { - return nil, twirp.InternalError("failed type assertion resp.(*DeleteAgentResponse) when calling interceptor") - } - return typedResp, err - } - return nil, err - } - } - - // Call service method - var respContent *DeleteAgentResponse - func() { - defer ensurePanicResponses(ctx, resp, s.hooks) - respContent, err = handler(ctx, reqContent) - }() - - if err != nil { - s.writeError(ctx, resp, err) - return - } - if respContent == nil { - s.writeError(ctx, resp, twirp.InternalError("received a nil *DeleteAgentResponse and nil error while calling DeleteAgent. nil responses are not supported")) - return - } - - ctx = callResponsePrepared(ctx, s.hooks) - - respBytes, err := proto.Marshal(respContent) - if err != nil { - s.writeError(ctx, resp, wrapInternal(err, "failed to marshal proto response")) - return - } - - ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK) - resp.Header().Set("Content-Type", "application/protobuf") - resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes))) - resp.WriteHeader(http.StatusOK) - if n, err := resp.Write(respBytes); err != nil { - msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error()) - twerr := twirp.NewError(twirp.Unknown, msg) - ctx = callError(ctx, s.hooks, twerr) - } - callResponseSent(ctx, s.hooks) -} - -func (s *cloudAgentServer) serveGetClientSettings(ctx context.Context, resp http.ResponseWriter, req *http.Request) { - header := req.Header.Get("Content-Type") - i := strings.Index(header, ";") - if i == -1 { - i = len(header) - } - switch strings.TrimSpace(strings.ToLower(header[:i])) { - case "application/json": - s.serveGetClientSettingsJSON(ctx, resp, req) - case "application/protobuf": - s.serveGetClientSettingsProtobuf(ctx, resp, req) - default: - msg := fmt.Sprintf("unexpected Content-Type: %q", req.Header.Get("Content-Type")) - twerr := badRouteError(msg, req.Method, req.URL.Path) - s.writeError(ctx, resp, twerr) - } -} - -func (s *cloudAgentServer) serveGetClientSettingsJSON(ctx context.Context, resp http.ResponseWriter, req *http.Request) { - var err error - ctx = ctxsetters.WithMethodName(ctx, "GetClientSettings") - ctx, err = callRequestRouted(ctx, s.hooks) - if err != nil { - s.writeError(ctx, resp, err) - return - } - - d := json.NewDecoder(req.Body) - rawReqBody := json.RawMessage{} - if err := d.Decode(&rawReqBody); err != nil { - s.handleRequestBodyError(ctx, resp, "the json request could not be decoded", err) - return - } - reqContent := new(ClientSettingsRequest) - unmarshaler := protojson.UnmarshalOptions{DiscardUnknown: true} - if err = unmarshaler.Unmarshal(rawReqBody, reqContent); err != nil { - s.handleRequestBodyError(ctx, resp, "the json request could not be decoded", err) - return - } - - handler := s.CloudAgent.GetClientSettings - if s.interceptor != nil { - handler = func(ctx context.Context, req *ClientSettingsRequest) (*ClientSettingsResponse, error) { - resp, err := s.interceptor( - func(ctx context.Context, req interface{}) (interface{}, error) { - typedReq, ok := req.(*ClientSettingsRequest) - if !ok { - return nil, twirp.InternalError("failed type assertion req.(*ClientSettingsRequest) when calling interceptor") - } - return s.CloudAgent.GetClientSettings(ctx, typedReq) - }, - )(ctx, req) - if resp != nil { - typedResp, ok := resp.(*ClientSettingsResponse) - if !ok { - return nil, twirp.InternalError("failed type assertion resp.(*ClientSettingsResponse) when calling interceptor") - } - return typedResp, err - } - return nil, err - } - } - - // Call service method - var respContent *ClientSettingsResponse - func() { - defer ensurePanicResponses(ctx, resp, s.hooks) - respContent, err = handler(ctx, reqContent) - }() - - if err != nil { - s.writeError(ctx, resp, err) - return - } - if respContent == nil { - s.writeError(ctx, resp, twirp.InternalError("received a nil *ClientSettingsResponse and nil error while calling GetClientSettings. nil responses are not supported")) - return - } - - ctx = callResponsePrepared(ctx, s.hooks) - - marshaler := &protojson.MarshalOptions{UseProtoNames: !s.jsonCamelCase, EmitUnpopulated: !s.jsonSkipDefaults} - respBytes, err := marshaler.Marshal(respContent) - if err != nil { - s.writeError(ctx, resp, wrapInternal(err, "failed to marshal json response")) - return - } - - ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK) - resp.Header().Set("Content-Type", "application/json") - resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes))) - resp.WriteHeader(http.StatusOK) - - if n, err := resp.Write(respBytes); err != nil { - msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error()) - twerr := twirp.NewError(twirp.Unknown, msg) - ctx = callError(ctx, s.hooks, twerr) - } - callResponseSent(ctx, s.hooks) -} - -func (s *cloudAgentServer) serveGetClientSettingsProtobuf(ctx context.Context, resp http.ResponseWriter, req *http.Request) { - var err error - ctx = ctxsetters.WithMethodName(ctx, "GetClientSettings") - ctx, err = callRequestRouted(ctx, s.hooks) - if err != nil { - s.writeError(ctx, resp, err) - return - } - - buf, err := io.ReadAll(req.Body) - if err != nil { - s.handleRequestBodyError(ctx, resp, "failed to read request body", err) - return - } - reqContent := new(ClientSettingsRequest) - if err = proto.Unmarshal(buf, reqContent); err != nil { - s.writeError(ctx, resp, malformedRequestError("the protobuf request could not be decoded")) - return - } - - handler := s.CloudAgent.GetClientSettings - if s.interceptor != nil { - handler = func(ctx context.Context, req *ClientSettingsRequest) (*ClientSettingsResponse, error) { - resp, err := s.interceptor( - func(ctx context.Context, req interface{}) (interface{}, error) { - typedReq, ok := req.(*ClientSettingsRequest) - if !ok { - return nil, twirp.InternalError("failed type assertion req.(*ClientSettingsRequest) when calling interceptor") - } - return s.CloudAgent.GetClientSettings(ctx, typedReq) - }, - )(ctx, req) - if resp != nil { - typedResp, ok := resp.(*ClientSettingsResponse) - if !ok { - return nil, twirp.InternalError("failed type assertion resp.(*ClientSettingsResponse) when calling interceptor") - } - return typedResp, err - } - return nil, err - } - } - - // Call service method - var respContent *ClientSettingsResponse - func() { - defer ensurePanicResponses(ctx, resp, s.hooks) - respContent, err = handler(ctx, reqContent) - }() - - if err != nil { - s.writeError(ctx, resp, err) - return - } - if respContent == nil { - s.writeError(ctx, resp, twirp.InternalError("received a nil *ClientSettingsResponse and nil error while calling GetClientSettings. nil responses are not supported")) - return - } - - ctx = callResponsePrepared(ctx, s.hooks) - - respBytes, err := proto.Marshal(respContent) - if err != nil { - s.writeError(ctx, resp, wrapInternal(err, "failed to marshal proto response")) - return - } - - ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK) - resp.Header().Set("Content-Type", "application/protobuf") - resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes))) - resp.WriteHeader(http.StatusOK) - if n, err := resp.Write(respBytes); err != nil { - msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error()) - twerr := twirp.NewError(twirp.Unknown, msg) - ctx = callError(ctx, s.hooks, twerr) - } - callResponseSent(ctx, s.hooks) -} - -func (s *cloudAgentServer) serveCreatePrivateLink(ctx context.Context, resp http.ResponseWriter, req *http.Request) { - header := req.Header.Get("Content-Type") - i := strings.Index(header, ";") - if i == -1 { - i = len(header) - } - switch strings.TrimSpace(strings.ToLower(header[:i])) { - case "application/json": - s.serveCreatePrivateLinkJSON(ctx, resp, req) - case "application/protobuf": - s.serveCreatePrivateLinkProtobuf(ctx, resp, req) - default: - msg := fmt.Sprintf("unexpected Content-Type: %q", req.Header.Get("Content-Type")) - twerr := badRouteError(msg, req.Method, req.URL.Path) - s.writeError(ctx, resp, twerr) - } -} - -func (s *cloudAgentServer) serveCreatePrivateLinkJSON(ctx context.Context, resp http.ResponseWriter, req *http.Request) { - var err error - ctx = ctxsetters.WithMethodName(ctx, "CreatePrivateLink") - ctx, err = callRequestRouted(ctx, s.hooks) - if err != nil { - s.writeError(ctx, resp, err) - return - } - - d := json.NewDecoder(req.Body) - rawReqBody := json.RawMessage{} - if err := d.Decode(&rawReqBody); err != nil { - s.handleRequestBodyError(ctx, resp, "the json request could not be decoded", err) - return - } - reqContent := new(CreatePrivateLinkRequest) - unmarshaler := protojson.UnmarshalOptions{DiscardUnknown: true} - if err = unmarshaler.Unmarshal(rawReqBody, reqContent); err != nil { - s.handleRequestBodyError(ctx, resp, "the json request could not be decoded", err) - return - } - - handler := s.CloudAgent.CreatePrivateLink - if s.interceptor != nil { - handler = func(ctx context.Context, req *CreatePrivateLinkRequest) (*CreatePrivateLinkResponse, error) { - resp, err := s.interceptor( - func(ctx context.Context, req interface{}) (interface{}, error) { - typedReq, ok := req.(*CreatePrivateLinkRequest) - if !ok { - return nil, twirp.InternalError("failed type assertion req.(*CreatePrivateLinkRequest) when calling interceptor") - } - return s.CloudAgent.CreatePrivateLink(ctx, typedReq) - }, - )(ctx, req) - if resp != nil { - typedResp, ok := resp.(*CreatePrivateLinkResponse) - if !ok { - return nil, twirp.InternalError("failed type assertion resp.(*CreatePrivateLinkResponse) when calling interceptor") - } - return typedResp, err - } - return nil, err - } - } - - // Call service method - var respContent *CreatePrivateLinkResponse - func() { - defer ensurePanicResponses(ctx, resp, s.hooks) - respContent, err = handler(ctx, reqContent) - }() - - if err != nil { - s.writeError(ctx, resp, err) - return - } - if respContent == nil { - s.writeError(ctx, resp, twirp.InternalError("received a nil *CreatePrivateLinkResponse and nil error while calling CreatePrivateLink. nil responses are not supported")) - return - } - - ctx = callResponsePrepared(ctx, s.hooks) - - marshaler := &protojson.MarshalOptions{UseProtoNames: !s.jsonCamelCase, EmitUnpopulated: !s.jsonSkipDefaults} - respBytes, err := marshaler.Marshal(respContent) - if err != nil { - s.writeError(ctx, resp, wrapInternal(err, "failed to marshal json response")) - return - } - - ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK) - resp.Header().Set("Content-Type", "application/json") - resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes))) - resp.WriteHeader(http.StatusOK) - - if n, err := resp.Write(respBytes); err != nil { - msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error()) - twerr := twirp.NewError(twirp.Unknown, msg) - ctx = callError(ctx, s.hooks, twerr) - } - callResponseSent(ctx, s.hooks) -} - -func (s *cloudAgentServer) serveCreatePrivateLinkProtobuf(ctx context.Context, resp http.ResponseWriter, req *http.Request) { - var err error - ctx = ctxsetters.WithMethodName(ctx, "CreatePrivateLink") - ctx, err = callRequestRouted(ctx, s.hooks) - if err != nil { - s.writeError(ctx, resp, err) - return - } - - buf, err := io.ReadAll(req.Body) - if err != nil { - s.handleRequestBodyError(ctx, resp, "failed to read request body", err) - return - } - reqContent := new(CreatePrivateLinkRequest) - if err = proto.Unmarshal(buf, reqContent); err != nil { - s.writeError(ctx, resp, malformedRequestError("the protobuf request could not be decoded")) - return - } - - handler := s.CloudAgent.CreatePrivateLink - if s.interceptor != nil { - handler = func(ctx context.Context, req *CreatePrivateLinkRequest) (*CreatePrivateLinkResponse, error) { - resp, err := s.interceptor( - func(ctx context.Context, req interface{}) (interface{}, error) { - typedReq, ok := req.(*CreatePrivateLinkRequest) - if !ok { - return nil, twirp.InternalError("failed type assertion req.(*CreatePrivateLinkRequest) when calling interceptor") - } - return s.CloudAgent.CreatePrivateLink(ctx, typedReq) - }, - )(ctx, req) - if resp != nil { - typedResp, ok := resp.(*CreatePrivateLinkResponse) - if !ok { - return nil, twirp.InternalError("failed type assertion resp.(*CreatePrivateLinkResponse) when calling interceptor") - } - return typedResp, err - } - return nil, err - } - } - - // Call service method - var respContent *CreatePrivateLinkResponse - func() { - defer ensurePanicResponses(ctx, resp, s.hooks) - respContent, err = handler(ctx, reqContent) - }() - - if err != nil { - s.writeError(ctx, resp, err) - return - } - if respContent == nil { - s.writeError(ctx, resp, twirp.InternalError("received a nil *CreatePrivateLinkResponse and nil error while calling CreatePrivateLink. nil responses are not supported")) - return - } - - ctx = callResponsePrepared(ctx, s.hooks) - - respBytes, err := proto.Marshal(respContent) - if err != nil { - s.writeError(ctx, resp, wrapInternal(err, "failed to marshal proto response")) - return - } - - ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK) - resp.Header().Set("Content-Type", "application/protobuf") - resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes))) - resp.WriteHeader(http.StatusOK) - if n, err := resp.Write(respBytes); err != nil { - msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error()) - twerr := twirp.NewError(twirp.Unknown, msg) - ctx = callError(ctx, s.hooks, twerr) - } - callResponseSent(ctx, s.hooks) -} - -func (s *cloudAgentServer) serveDestroyPrivateLink(ctx context.Context, resp http.ResponseWriter, req *http.Request) { - header := req.Header.Get("Content-Type") - i := strings.Index(header, ";") - if i == -1 { - i = len(header) - } - switch strings.TrimSpace(strings.ToLower(header[:i])) { - case "application/json": - s.serveDestroyPrivateLinkJSON(ctx, resp, req) - case "application/protobuf": - s.serveDestroyPrivateLinkProtobuf(ctx, resp, req) - default: - msg := fmt.Sprintf("unexpected Content-Type: %q", req.Header.Get("Content-Type")) - twerr := badRouteError(msg, req.Method, req.URL.Path) - s.writeError(ctx, resp, twerr) - } -} - -func (s *cloudAgentServer) serveDestroyPrivateLinkJSON(ctx context.Context, resp http.ResponseWriter, req *http.Request) { - var err error - ctx = ctxsetters.WithMethodName(ctx, "DestroyPrivateLink") - ctx, err = callRequestRouted(ctx, s.hooks) - if err != nil { - s.writeError(ctx, resp, err) - return - } - - d := json.NewDecoder(req.Body) - rawReqBody := json.RawMessage{} - if err := d.Decode(&rawReqBody); err != nil { - s.handleRequestBodyError(ctx, resp, "the json request could not be decoded", err) - return - } - reqContent := new(DestroyPrivateLinkRequest) - unmarshaler := protojson.UnmarshalOptions{DiscardUnknown: true} - if err = unmarshaler.Unmarshal(rawReqBody, reqContent); err != nil { - s.handleRequestBodyError(ctx, resp, "the json request could not be decoded", err) - return - } - - handler := s.CloudAgent.DestroyPrivateLink - if s.interceptor != nil { - handler = func(ctx context.Context, req *DestroyPrivateLinkRequest) (*DestroyPrivateLinkResponse, error) { - resp, err := s.interceptor( - func(ctx context.Context, req interface{}) (interface{}, error) { - typedReq, ok := req.(*DestroyPrivateLinkRequest) - if !ok { - return nil, twirp.InternalError("failed type assertion req.(*DestroyPrivateLinkRequest) when calling interceptor") - } - return s.CloudAgent.DestroyPrivateLink(ctx, typedReq) - }, - )(ctx, req) - if resp != nil { - typedResp, ok := resp.(*DestroyPrivateLinkResponse) - if !ok { - return nil, twirp.InternalError("failed type assertion resp.(*DestroyPrivateLinkResponse) when calling interceptor") - } - return typedResp, err - } - return nil, err - } - } - - // Call service method - var respContent *DestroyPrivateLinkResponse - func() { - defer ensurePanicResponses(ctx, resp, s.hooks) - respContent, err = handler(ctx, reqContent) - }() - - if err != nil { - s.writeError(ctx, resp, err) - return - } - if respContent == nil { - s.writeError(ctx, resp, twirp.InternalError("received a nil *DestroyPrivateLinkResponse and nil error while calling DestroyPrivateLink. nil responses are not supported")) - return - } - - ctx = callResponsePrepared(ctx, s.hooks) - - marshaler := &protojson.MarshalOptions{UseProtoNames: !s.jsonCamelCase, EmitUnpopulated: !s.jsonSkipDefaults} - respBytes, err := marshaler.Marshal(respContent) - if err != nil { - s.writeError(ctx, resp, wrapInternal(err, "failed to marshal json response")) - return - } - - ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK) - resp.Header().Set("Content-Type", "application/json") - resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes))) - resp.WriteHeader(http.StatusOK) - - if n, err := resp.Write(respBytes); err != nil { - msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error()) - twerr := twirp.NewError(twirp.Unknown, msg) - ctx = callError(ctx, s.hooks, twerr) - } - callResponseSent(ctx, s.hooks) -} - -func (s *cloudAgentServer) serveDestroyPrivateLinkProtobuf(ctx context.Context, resp http.ResponseWriter, req *http.Request) { - var err error - ctx = ctxsetters.WithMethodName(ctx, "DestroyPrivateLink") - ctx, err = callRequestRouted(ctx, s.hooks) - if err != nil { - s.writeError(ctx, resp, err) - return - } - - buf, err := io.ReadAll(req.Body) - if err != nil { - s.handleRequestBodyError(ctx, resp, "failed to read request body", err) - return - } - reqContent := new(DestroyPrivateLinkRequest) - if err = proto.Unmarshal(buf, reqContent); err != nil { - s.writeError(ctx, resp, malformedRequestError("the protobuf request could not be decoded")) - return - } - - handler := s.CloudAgent.DestroyPrivateLink - if s.interceptor != nil { - handler = func(ctx context.Context, req *DestroyPrivateLinkRequest) (*DestroyPrivateLinkResponse, error) { - resp, err := s.interceptor( - func(ctx context.Context, req interface{}) (interface{}, error) { - typedReq, ok := req.(*DestroyPrivateLinkRequest) - if !ok { - return nil, twirp.InternalError("failed type assertion req.(*DestroyPrivateLinkRequest) when calling interceptor") - } - return s.CloudAgent.DestroyPrivateLink(ctx, typedReq) - }, - )(ctx, req) - if resp != nil { - typedResp, ok := resp.(*DestroyPrivateLinkResponse) - if !ok { - return nil, twirp.InternalError("failed type assertion resp.(*DestroyPrivateLinkResponse) when calling interceptor") - } - return typedResp, err - } - return nil, err - } - } - - // Call service method - var respContent *DestroyPrivateLinkResponse - func() { - defer ensurePanicResponses(ctx, resp, s.hooks) - respContent, err = handler(ctx, reqContent) - }() - - if err != nil { - s.writeError(ctx, resp, err) - return - } - if respContent == nil { - s.writeError(ctx, resp, twirp.InternalError("received a nil *DestroyPrivateLinkResponse and nil error while calling DestroyPrivateLink. nil responses are not supported")) - return - } - - ctx = callResponsePrepared(ctx, s.hooks) - - respBytes, err := proto.Marshal(respContent) - if err != nil { - s.writeError(ctx, resp, wrapInternal(err, "failed to marshal proto response")) - return - } - - ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK) - resp.Header().Set("Content-Type", "application/protobuf") - resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes))) - resp.WriteHeader(http.StatusOK) - if n, err := resp.Write(respBytes); err != nil { - msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error()) - twerr := twirp.NewError(twirp.Unknown, msg) - ctx = callError(ctx, s.hooks, twerr) - } - callResponseSent(ctx, s.hooks) -} - -func (s *cloudAgentServer) serveListPrivateLinks(ctx context.Context, resp http.ResponseWriter, req *http.Request) { - header := req.Header.Get("Content-Type") - i := strings.Index(header, ";") - if i == -1 { - i = len(header) - } - switch strings.TrimSpace(strings.ToLower(header[:i])) { - case "application/json": - s.serveListPrivateLinksJSON(ctx, resp, req) - case "application/protobuf": - s.serveListPrivateLinksProtobuf(ctx, resp, req) - default: - msg := fmt.Sprintf("unexpected Content-Type: %q", req.Header.Get("Content-Type")) - twerr := badRouteError(msg, req.Method, req.URL.Path) - s.writeError(ctx, resp, twerr) - } -} - -func (s *cloudAgentServer) serveListPrivateLinksJSON(ctx context.Context, resp http.ResponseWriter, req *http.Request) { - var err error - ctx = ctxsetters.WithMethodName(ctx, "ListPrivateLinks") - ctx, err = callRequestRouted(ctx, s.hooks) - if err != nil { - s.writeError(ctx, resp, err) - return - } - - d := json.NewDecoder(req.Body) - rawReqBody := json.RawMessage{} - if err := d.Decode(&rawReqBody); err != nil { - s.handleRequestBodyError(ctx, resp, "the json request could not be decoded", err) - return - } - reqContent := new(ListPrivateLinksRequest) - unmarshaler := protojson.UnmarshalOptions{DiscardUnknown: true} - if err = unmarshaler.Unmarshal(rawReqBody, reqContent); err != nil { - s.handleRequestBodyError(ctx, resp, "the json request could not be decoded", err) - return - } - - handler := s.CloudAgent.ListPrivateLinks - if s.interceptor != nil { - handler = func(ctx context.Context, req *ListPrivateLinksRequest) (*ListPrivateLinksResponse, error) { - resp, err := s.interceptor( - func(ctx context.Context, req interface{}) (interface{}, error) { - typedReq, ok := req.(*ListPrivateLinksRequest) - if !ok { - return nil, twirp.InternalError("failed type assertion req.(*ListPrivateLinksRequest) when calling interceptor") - } - return s.CloudAgent.ListPrivateLinks(ctx, typedReq) - }, - )(ctx, req) - if resp != nil { - typedResp, ok := resp.(*ListPrivateLinksResponse) - if !ok { - return nil, twirp.InternalError("failed type assertion resp.(*ListPrivateLinksResponse) when calling interceptor") - } - return typedResp, err - } - return nil, err - } - } - - // Call service method - var respContent *ListPrivateLinksResponse - func() { - defer ensurePanicResponses(ctx, resp, s.hooks) - respContent, err = handler(ctx, reqContent) - }() - - if err != nil { - s.writeError(ctx, resp, err) - return - } - if respContent == nil { - s.writeError(ctx, resp, twirp.InternalError("received a nil *ListPrivateLinksResponse and nil error while calling ListPrivateLinks. nil responses are not supported")) - return - } - - ctx = callResponsePrepared(ctx, s.hooks) - - marshaler := &protojson.MarshalOptions{UseProtoNames: !s.jsonCamelCase, EmitUnpopulated: !s.jsonSkipDefaults} - respBytes, err := marshaler.Marshal(respContent) - if err != nil { - s.writeError(ctx, resp, wrapInternal(err, "failed to marshal json response")) - return - } - - ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK) - resp.Header().Set("Content-Type", "application/json") - resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes))) - resp.WriteHeader(http.StatusOK) - - if n, err := resp.Write(respBytes); err != nil { - msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error()) - twerr := twirp.NewError(twirp.Unknown, msg) - ctx = callError(ctx, s.hooks, twerr) - } - callResponseSent(ctx, s.hooks) -} - -func (s *cloudAgentServer) serveListPrivateLinksProtobuf(ctx context.Context, resp http.ResponseWriter, req *http.Request) { - var err error - ctx = ctxsetters.WithMethodName(ctx, "ListPrivateLinks") - ctx, err = callRequestRouted(ctx, s.hooks) - if err != nil { - s.writeError(ctx, resp, err) - return - } - - buf, err := io.ReadAll(req.Body) - if err != nil { - s.handleRequestBodyError(ctx, resp, "failed to read request body", err) - return - } - reqContent := new(ListPrivateLinksRequest) - if err = proto.Unmarshal(buf, reqContent); err != nil { - s.writeError(ctx, resp, malformedRequestError("the protobuf request could not be decoded")) - return - } - - handler := s.CloudAgent.ListPrivateLinks - if s.interceptor != nil { - handler = func(ctx context.Context, req *ListPrivateLinksRequest) (*ListPrivateLinksResponse, error) { - resp, err := s.interceptor( - func(ctx context.Context, req interface{}) (interface{}, error) { - typedReq, ok := req.(*ListPrivateLinksRequest) - if !ok { - return nil, twirp.InternalError("failed type assertion req.(*ListPrivateLinksRequest) when calling interceptor") - } - return s.CloudAgent.ListPrivateLinks(ctx, typedReq) - }, - )(ctx, req) - if resp != nil { - typedResp, ok := resp.(*ListPrivateLinksResponse) - if !ok { - return nil, twirp.InternalError("failed type assertion resp.(*ListPrivateLinksResponse) when calling interceptor") - } - return typedResp, err - } - return nil, err - } - } - - // Call service method - var respContent *ListPrivateLinksResponse - func() { - defer ensurePanicResponses(ctx, resp, s.hooks) - respContent, err = handler(ctx, reqContent) - }() - - if err != nil { - s.writeError(ctx, resp, err) - return - } - if respContent == nil { - s.writeError(ctx, resp, twirp.InternalError("received a nil *ListPrivateLinksResponse and nil error while calling ListPrivateLinks. nil responses are not supported")) - return - } - - ctx = callResponsePrepared(ctx, s.hooks) - - respBytes, err := proto.Marshal(respContent) - if err != nil { - s.writeError(ctx, resp, wrapInternal(err, "failed to marshal proto response")) - return - } - - ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK) - resp.Header().Set("Content-Type", "application/protobuf") - resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes))) - resp.WriteHeader(http.StatusOK) - if n, err := resp.Write(respBytes); err != nil { - msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error()) - twerr := twirp.NewError(twirp.Unknown, msg) - ctx = callError(ctx, s.hooks, twerr) - } - callResponseSent(ctx, s.hooks) -} - -func (s *cloudAgentServer) serveGetPrivateLinkStatus(ctx context.Context, resp http.ResponseWriter, req *http.Request) { - header := req.Header.Get("Content-Type") - i := strings.Index(header, ";") - if i == -1 { - i = len(header) - } - switch strings.TrimSpace(strings.ToLower(header[:i])) { - case "application/json": - s.serveGetPrivateLinkStatusJSON(ctx, resp, req) - case "application/protobuf": - s.serveGetPrivateLinkStatusProtobuf(ctx, resp, req) - default: - msg := fmt.Sprintf("unexpected Content-Type: %q", req.Header.Get("Content-Type")) - twerr := badRouteError(msg, req.Method, req.URL.Path) - s.writeError(ctx, resp, twerr) - } -} - -func (s *cloudAgentServer) serveGetPrivateLinkStatusJSON(ctx context.Context, resp http.ResponseWriter, req *http.Request) { - var err error - ctx = ctxsetters.WithMethodName(ctx, "GetPrivateLinkStatus") - ctx, err = callRequestRouted(ctx, s.hooks) - if err != nil { - s.writeError(ctx, resp, err) - return - } - - d := json.NewDecoder(req.Body) - rawReqBody := json.RawMessage{} - if err := d.Decode(&rawReqBody); err != nil { - s.handleRequestBodyError(ctx, resp, "the json request could not be decoded", err) - return - } - reqContent := new(GetPrivateLinkStatusRequest) - unmarshaler := protojson.UnmarshalOptions{DiscardUnknown: true} - if err = unmarshaler.Unmarshal(rawReqBody, reqContent); err != nil { - s.handleRequestBodyError(ctx, resp, "the json request could not be decoded", err) - return - } - - handler := s.CloudAgent.GetPrivateLinkStatus - if s.interceptor != nil { - handler = func(ctx context.Context, req *GetPrivateLinkStatusRequest) (*GetPrivateLinkStatusResponse, error) { - resp, err := s.interceptor( - func(ctx context.Context, req interface{}) (interface{}, error) { - typedReq, ok := req.(*GetPrivateLinkStatusRequest) - if !ok { - return nil, twirp.InternalError("failed type assertion req.(*GetPrivateLinkStatusRequest) when calling interceptor") - } - return s.CloudAgent.GetPrivateLinkStatus(ctx, typedReq) - }, - )(ctx, req) - if resp != nil { - typedResp, ok := resp.(*GetPrivateLinkStatusResponse) - if !ok { - return nil, twirp.InternalError("failed type assertion resp.(*GetPrivateLinkStatusResponse) when calling interceptor") - } - return typedResp, err - } - return nil, err - } - } - - // Call service method - var respContent *GetPrivateLinkStatusResponse - func() { - defer ensurePanicResponses(ctx, resp, s.hooks) - respContent, err = handler(ctx, reqContent) - }() - - if err != nil { - s.writeError(ctx, resp, err) - return - } - if respContent == nil { - s.writeError(ctx, resp, twirp.InternalError("received a nil *GetPrivateLinkStatusResponse and nil error while calling GetPrivateLinkStatus. nil responses are not supported")) - return - } - - ctx = callResponsePrepared(ctx, s.hooks) - - marshaler := &protojson.MarshalOptions{UseProtoNames: !s.jsonCamelCase, EmitUnpopulated: !s.jsonSkipDefaults} - respBytes, err := marshaler.Marshal(respContent) - if err != nil { - s.writeError(ctx, resp, wrapInternal(err, "failed to marshal json response")) - return - } - - ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK) - resp.Header().Set("Content-Type", "application/json") - resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes))) - resp.WriteHeader(http.StatusOK) - - if n, err := resp.Write(respBytes); err != nil { - msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error()) - twerr := twirp.NewError(twirp.Unknown, msg) - ctx = callError(ctx, s.hooks, twerr) - } - callResponseSent(ctx, s.hooks) -} - -func (s *cloudAgentServer) serveGetPrivateLinkStatusProtobuf(ctx context.Context, resp http.ResponseWriter, req *http.Request) { - var err error - ctx = ctxsetters.WithMethodName(ctx, "GetPrivateLinkStatus") - ctx, err = callRequestRouted(ctx, s.hooks) - if err != nil { - s.writeError(ctx, resp, err) - return - } - - buf, err := io.ReadAll(req.Body) - if err != nil { - s.handleRequestBodyError(ctx, resp, "failed to read request body", err) - return - } - reqContent := new(GetPrivateLinkStatusRequest) - if err = proto.Unmarshal(buf, reqContent); err != nil { - s.writeError(ctx, resp, malformedRequestError("the protobuf request could not be decoded")) - return - } - - handler := s.CloudAgent.GetPrivateLinkStatus - if s.interceptor != nil { - handler = func(ctx context.Context, req *GetPrivateLinkStatusRequest) (*GetPrivateLinkStatusResponse, error) { - resp, err := s.interceptor( - func(ctx context.Context, req interface{}) (interface{}, error) { - typedReq, ok := req.(*GetPrivateLinkStatusRequest) - if !ok { - return nil, twirp.InternalError("failed type assertion req.(*GetPrivateLinkStatusRequest) when calling interceptor") - } - return s.CloudAgent.GetPrivateLinkStatus(ctx, typedReq) - }, - )(ctx, req) - if resp != nil { - typedResp, ok := resp.(*GetPrivateLinkStatusResponse) - if !ok { - return nil, twirp.InternalError("failed type assertion resp.(*GetPrivateLinkStatusResponse) when calling interceptor") - } - return typedResp, err - } - return nil, err - } - } - - // Call service method - var respContent *GetPrivateLinkStatusResponse - func() { - defer ensurePanicResponses(ctx, resp, s.hooks) - respContent, err = handler(ctx, reqContent) - }() - - if err != nil { - s.writeError(ctx, resp, err) - return - } - if respContent == nil { - s.writeError(ctx, resp, twirp.InternalError("received a nil *GetPrivateLinkStatusResponse and nil error while calling GetPrivateLinkStatus. nil responses are not supported")) - return - } - - ctx = callResponsePrepared(ctx, s.hooks) - - respBytes, err := proto.Marshal(respContent) - if err != nil { - s.writeError(ctx, resp, wrapInternal(err, "failed to marshal proto response")) - return - } - - ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK) - resp.Header().Set("Content-Type", "application/protobuf") - resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes))) - resp.WriteHeader(http.StatusOK) - if n, err := resp.Write(respBytes); err != nil { - msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error()) - twerr := twirp.NewError(twirp.Unknown, msg) - ctx = callError(ctx, s.hooks, twerr) - } - callResponseSent(ctx, s.hooks) -} - -func (s *cloudAgentServer) ServiceDescriptor() ([]byte, int) { - return twirpFileDescriptor6, 0 -} - -func (s *cloudAgentServer) ProtocGenTwirpVersion() string { - return "v8.1.3" -} - -// PathPrefix returns the base service path, in the form: "//./" -// that is everything in a Twirp route except for the . This can be used for routing, -// for example to identify the requests that are targeted to this service in a mux. -func (s *cloudAgentServer) PathPrefix() string { - return baseServicePath(s.pathPrefix, "livekit", "CloudAgent") -} - -var twirpFileDescriptor6 = []byte{ - // 2253 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x59, 0x4b, 0x73, 0x13, 0xcb, - 0x15, 0xf6, 0xe8, 0x65, 0xeb, 0xc8, 0x06, 0xd1, 0x36, 0x66, 0x2c, 0xdb, 0x60, 0x0f, 0x90, 0x72, - 0xe0, 0x96, 0xb8, 0x90, 0xaa, 0x04, 0x48, 0x52, 0x15, 0x61, 0x0f, 0xb6, 0xb0, 0x91, 0x55, 0x2d, - 0xd9, 0x14, 0xb7, 0x52, 0x35, 0x19, 0xa4, 0x46, 0x99, 0xb2, 0xe6, 0xc1, 0xcc, 0x48, 0x5c, 0xaf, - 0xb3, 0x49, 0x52, 0xf9, 0x03, 0x59, 0x65, 0x97, 0x45, 0xfe, 0x40, 0xaa, 0x58, 0x65, 0x97, 0x1f, - 0x91, 0x45, 0x56, 0xc9, 0x22, 0xcb, 0xac, 0xb3, 0x48, 0xf5, 0x63, 0x46, 0x3d, 0xd2, 0xc8, 0x36, - 0x36, 0xb7, 0xee, 0x06, 0xd4, 0x7d, 0x4e, 0xf7, 0x79, 0x7d, 0xe7, 0x31, 0x6d, 0x58, 0xe9, 0x5b, - 0x43, 0x72, 0x62, 0x85, 0x46, 0xa7, 0xef, 0x0e, 0xba, 0x86, 0xd9, 0x23, 0x4e, 0x58, 0xf5, 0x7c, - 0x37, 0x74, 0xd1, 0xac, 0x20, 0x55, 0xee, 0xf4, 0x5c, 0xb7, 0xd7, 0x27, 0x8f, 0xd8, 0xf6, 0xbb, - 0xc1, 0xfb, 0x47, 0xa1, 0x65, 0x93, 0x20, 0x34, 0x6d, 0x8f, 0x73, 0x56, 0x96, 0xfa, 0x6e, 0xaf, - 0x47, 0xfc, 0x47, 0xae, 0x17, 0x5a, 0xae, 0x13, 0xf0, 0x5d, 0xed, 0x77, 0x0a, 0x40, 0x8d, 0xde, - 0xa7, 0x0f, 0x89, 0x13, 0xa2, 0x87, 0x90, 0x0b, 0x4f, 0x3d, 0xa2, 0x2a, 0x1b, 0xca, 0xd6, 0xb5, - 0x27, 0xb7, 0xaa, 0xe2, 0xf6, 0xea, 0x88, 0xa5, 0x7d, 0xea, 0x11, 0xcc, 0x98, 0xd0, 0x12, 0xe4, - 0x3b, 0xee, 0xc0, 0x09, 0xd5, 0xcc, 0x86, 0xb2, 0x95, 0xc7, 0x7c, 0x81, 0x9e, 0x42, 0x31, 0x16, - 0xad, 0x66, 0x37, 0x94, 0xad, 0xd2, 0x93, 0x4a, 0x95, 0x2b, 0x57, 0x8d, 0x94, 0xab, 0xb6, 0x23, - 0x0e, 0x3c, 0x62, 0xd6, 0xfe, 0xa1, 0x40, 0x89, 0x09, 0x6a, 0x91, 0x8e, 0x4f, 0x42, 0x84, 0x20, - 0xe7, 0x98, 0x36, 0x57, 0xa6, 0x88, 0xd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xdb, 0xd3, 0xc8, 0x49, 0xf3, 0xe3, 0xe1, 0x3d, - 0x61, 0xfe, 0xf8, 0xe7, 0x42, 0xc2, 0xfc, 0x89, 0x79, 0x5f, 0x9b, 0x41, 0xc7, 0x70, 0x63, 0x97, - 0x84, 0xc9, 0x71, 0x14, 0x8d, 0x54, 0x48, 0x9d, 0x53, 0x2b, 0x77, 0xa6, 0xd2, 0x65, 0xd8, 0x4f, - 0x74, 0x28, 0x09, 0xf6, 0xd3, 0x5a, 0xa8, 0x04, 0xfb, 0xa9, 0x0d, 0x8e, 0x07, 0x6d, 0xb2, 0xa5, - 0x48, 0x41, 0x9b, 0xda, 0xc6, 0xa4, 0xa0, 0x9d, 0xd1, 0x93, 0xe2, 0xbc, 0x92, 0x5b, 0xcf, 0x58, - 0x5e, 0xa5, 0x34, 0xac, 0xb1, 0xbc, 0x4a, 0xeb, 0x5b, 0xda, 0x0c, 0x22, 0xb0, 0x94, 0xd6, 0x34, - 0xd0, 0xbd, 0xf8, 0xf0, 0x19, 0xcd, 0xaa, 0x72, 0xff, 0x1c, 0xae, 0x48, 0xcc, 0x8b, 0x97, 0xdf, - 0xdc, 0xed, 0x59, 0xe1, 0xaf, 0x07, 0xef, 0xaa, 0x1d, 0xd7, 0x7e, 0x24, 0x0e, 0xf1, 0x3f, 0x1a, - 0x77, 0xdc, 0x7e, 0xb4, 0xf1, 0x97, 0xcc, 0xc2, 0x81, 0x35, 0x24, 0xfb, 0xac, 0x27, 0xb9, 0xa1, - 0xfb, 0x9f, 0xcc, 0x35, 0xb1, 0x7e, 0xfe, 0x9c, 0x6d, 0xbc, 0x2b, 0xb0, 0x23, 0x3f, 0xfa, 0x7f, - 0x00, 0x00, 0x00, 0xff, 0xff, 0x46, 0x65, 0xa1, 0x21, 0x9b, 0x1e, 0x00, 0x00, -} From c96cb2d8bbbb3ff6492492e8026d307eda96cae6 Mon Sep 17 00:00:00 2001 From: Steve Yoon Date: Fri, 10 Apr 2026 12:38:16 -0400 Subject: [PATCH 4/8] fix the proto to support cloud agents v2 api --- protobufs/livekit_cloud_agent.proto | 31 ++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/protobufs/livekit_cloud_agent.proto b/protobufs/livekit_cloud_agent.proto index 892fd836c..71946cc66 100644 --- a/protobufs/livekit_cloud_agent.proto +++ b/protobufs/livekit_cloud_agent.proto @@ -70,6 +70,17 @@ message CreateAgentResponse { PresignedPostRequest presigned_post_request = 8; } +message CreateAgentV2Request { + repeated AgentSecret secrets = 1; + repeated string regions = 2; +} + +message CreateAgentV2Response { + string agent_id = 1 [(logger.name) = "agentID"]; + string status = 2; + repeated string server_regions = 3; +} + message PresignedPostRequest { string url = 1; map values = 2; @@ -169,12 +180,28 @@ message DeployAgentResponse { bool success = 1; string message = 2; string agent_id = 3 [(logger.name) = "agentID"]; - string presigned_url = 4; + string presigned_url = 4 [deprecated=true]; string tag = 5; PresignedPostRequest presigned_post_request = 6; string environment = 7; } +message DeployAgentV2Request { + string agent_id = 1 [(logger.name) = "agentID"]; + repeated AgentSecret secrets = 2; + string environment = 3; + string region = 4; +} + +message DeployAgentV2Response { + bool success = 1; + string message = 2; + string agent_id = 3 [(logger.name) = "agentID"]; + string tag = 4; + PresignedPostRequest presigned_req = 5; + string environment = 6; +} + message UpdateAgentSecretsRequest { string agent_id = 1 [(logger.name) = "agentID"]; string agent_name = 2; @@ -306,12 +333,14 @@ message GetPrivateLinkStatusResponse { service CloudAgent { rpc CreateAgent(CreateAgentRequest) returns (CreateAgentResponse) {} + rpc CreateAgentV2(CreateAgentV2Request) returns (CreateAgentV2Response) {} rpc ListAgents(ListAgentsRequest) returns (ListAgentsResponse) {} rpc ListAgentVersions(ListAgentVersionsRequest) returns (ListAgentVersionsResponse) {} rpc ListAgentSecrets(ListAgentSecretsRequest) returns (ListAgentSecretsResponse) {} rpc UpdateAgent(UpdateAgentRequest) returns (UpdateAgentResponse) {} rpc RestartAgent(RestartAgentRequest) returns (RestartAgentResponse) {} rpc DeployAgent(DeployAgentRequest) returns (DeployAgentResponse) {} + rpc DeployAgentV2(DeployAgentV2Request) returns (DeployAgentV2Response) {} rpc UpdateAgentSecrets(UpdateAgentSecretsRequest) returns (UpdateAgentSecretsResponse) {} rpc RollbackAgent(RollbackAgentRequest) returns (RollbackAgentResponse) {} rpc DeleteAgent(DeleteAgentRequest) returns (DeleteAgentResponse) {} From 8a0610a04e83d3c949928dc0391731644fa5ef1c Mon Sep 17 00:00:00 2001 From: Steve Yoon Date: Wed, 15 Apr 2026 12:20:58 -0400 Subject: [PATCH 5/8] cloud agents env protocol --- protobufs/livekit_cloud_agent.proto | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/protobufs/livekit_cloud_agent.proto b/protobufs/livekit_cloud_agent.proto index 71946cc66..34b95b5ad 100644 --- a/protobufs/livekit_cloud_agent.proto +++ b/protobufs/livekit_cloud_agent.proto @@ -71,8 +71,8 @@ message CreateAgentResponse { } message CreateAgentV2Request { - repeated AgentSecret secrets = 1; - repeated string regions = 2; + repeated AgentSecret secrets = 1; + repeated string regions = 2; } message CreateAgentV2Response { @@ -102,6 +102,7 @@ message AgentDeployment { string server_region = 13; repeated AgentEvent events = 14; string environment = 15; + string version = 16; } message AgentInfo { @@ -190,7 +191,6 @@ message DeployAgentV2Request { string agent_id = 1 [(logger.name) = "agentID"]; repeated AgentSecret secrets = 2; string environment = 3; - string region = 4; } message DeployAgentV2Response { @@ -229,6 +229,7 @@ message RollbackAgentResponse { message DeleteAgentRequest { string agent_id = 1 [(logger.name) = "agentID"]; string agent_name = 2; + string environment = 3; // optional } message DeleteAgentResponse { From 9ec8b480f7a0aef4d121d0381edeb1b939458657 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 15 Apr 2026 16:24:29 +0000 Subject: [PATCH 6/8] generated protobuf --- livekit/livekit_cloud_agent.pb.go | 3524 ++++++++++++++++++ livekit/livekit_cloud_agent.twirp.go | 5136 ++++++++++++++++++++++++++ 2 files changed, 8660 insertions(+) create mode 100644 livekit/livekit_cloud_agent.pb.go create mode 100644 livekit/livekit_cloud_agent.twirp.go diff --git a/livekit/livekit_cloud_agent.pb.go b/livekit/livekit_cloud_agent.pb.go new file mode 100644 index 000000000..71cdc6227 --- /dev/null +++ b/livekit/livekit_cloud_agent.pb.go @@ -0,0 +1,3524 @@ +// Copyright 2023 LiveKit, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.11 +// protoc v4.23.4 +// source: livekit_cloud_agent.proto + +package livekit + +import ( + _ "github.com/livekit/protocol/livekit/logger" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" + unsafe "unsafe" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type AgentSecretKind int32 + +const ( + AgentSecretKind_AGENT_SECRET_KIND_UNKNOWN AgentSecretKind = 0 + AgentSecretKind_AGENT_SECRET_KIND_ENVIRONMENT AgentSecretKind = 1 + AgentSecretKind_AGENT_SECRET_KIND_FILE AgentSecretKind = 2 +) + +// Enum value maps for AgentSecretKind. +var ( + AgentSecretKind_name = map[int32]string{ + 0: "AGENT_SECRET_KIND_UNKNOWN", + 1: "AGENT_SECRET_KIND_ENVIRONMENT", + 2: "AGENT_SECRET_KIND_FILE", + } + AgentSecretKind_value = map[string]int32{ + "AGENT_SECRET_KIND_UNKNOWN": 0, + "AGENT_SECRET_KIND_ENVIRONMENT": 1, + "AGENT_SECRET_KIND_FILE": 2, + } +) + +func (x AgentSecretKind) Enum() *AgentSecretKind { + p := new(AgentSecretKind) + *p = x + return p +} + +func (x AgentSecretKind) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (AgentSecretKind) Descriptor() protoreflect.EnumDescriptor { + return file_livekit_cloud_agent_proto_enumTypes[0].Descriptor() +} + +func (AgentSecretKind) Type() protoreflect.EnumType { + return &file_livekit_cloud_agent_proto_enumTypes[0] +} + +func (x AgentSecretKind) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use AgentSecretKind.Descriptor instead. +func (AgentSecretKind) EnumDescriptor() ([]byte, []int) { + return file_livekit_cloud_agent_proto_rawDescGZIP(), []int{0} +} + +type AgentEventType int32 + +const ( + AgentEventType_AGENT_EVENT_TYPE_UNKNOWN AgentEventType = 0 + AgentEventType_AGENT_EVENT_TYPE_APPLICATION_CRASHED AgentEventType = 1 + AgentEventType_AGENT_EVENT_TYPE_RESTARTED_HIGH_DISK_USAGE AgentEventType = 2 + AgentEventType_AGENT_EVENT_TYPE_RESTARTED_HIGH_MEMORY_USAGE AgentEventType = 3 +) + +// Enum value maps for AgentEventType. +var ( + AgentEventType_name = map[int32]string{ + 0: "AGENT_EVENT_TYPE_UNKNOWN", + 1: "AGENT_EVENT_TYPE_APPLICATION_CRASHED", + 2: "AGENT_EVENT_TYPE_RESTARTED_HIGH_DISK_USAGE", + 3: "AGENT_EVENT_TYPE_RESTARTED_HIGH_MEMORY_USAGE", + } + AgentEventType_value = map[string]int32{ + "AGENT_EVENT_TYPE_UNKNOWN": 0, + "AGENT_EVENT_TYPE_APPLICATION_CRASHED": 1, + "AGENT_EVENT_TYPE_RESTARTED_HIGH_DISK_USAGE": 2, + "AGENT_EVENT_TYPE_RESTARTED_HIGH_MEMORY_USAGE": 3, + } +) + +func (x AgentEventType) Enum() *AgentEventType { + p := new(AgentEventType) + *p = x + return p +} + +func (x AgentEventType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (AgentEventType) Descriptor() protoreflect.EnumDescriptor { + return file_livekit_cloud_agent_proto_enumTypes[1].Descriptor() +} + +func (AgentEventType) Type() protoreflect.EnumType { + return &file_livekit_cloud_agent_proto_enumTypes[1] +} + +func (x AgentEventType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use AgentEventType.Descriptor instead. +func (AgentEventType) EnumDescriptor() ([]byte, []int) { + return file_livekit_cloud_agent_proto_rawDescGZIP(), []int{1} +} + +type PrivateLinkStatus_Status int32 + +const ( + PrivateLinkStatus_PRIVATE_LINK_STATUS_UNKNOWN PrivateLinkStatus_Status = 0 + PrivateLinkStatus_PRIVATE_LINK_STATUS_PROVISIONING PrivateLinkStatus_Status = 1 + PrivateLinkStatus_PRIVATE_LINK_STATUS_PENDING_APPROVAL PrivateLinkStatus_Status = 2 + PrivateLinkStatus_PRIVATE_LINK_STATUS_HEALTHY PrivateLinkStatus_Status = 3 + PrivateLinkStatus_PRIVATE_LINK_STATUS_UNHEALTHY PrivateLinkStatus_Status = 4 + PrivateLinkStatus_PRIVATE_LINK_STATUS_APPROVED PrivateLinkStatus_Status = 5 +) + +// Enum value maps for PrivateLinkStatus_Status. +var ( + PrivateLinkStatus_Status_name = map[int32]string{ + 0: "PRIVATE_LINK_STATUS_UNKNOWN", + 1: "PRIVATE_LINK_STATUS_PROVISIONING", + 2: "PRIVATE_LINK_STATUS_PENDING_APPROVAL", + 3: "PRIVATE_LINK_STATUS_HEALTHY", + 4: "PRIVATE_LINK_STATUS_UNHEALTHY", + 5: "PRIVATE_LINK_STATUS_APPROVED", + } + PrivateLinkStatus_Status_value = map[string]int32{ + "PRIVATE_LINK_STATUS_UNKNOWN": 0, + "PRIVATE_LINK_STATUS_PROVISIONING": 1, + "PRIVATE_LINK_STATUS_PENDING_APPROVAL": 2, + "PRIVATE_LINK_STATUS_HEALTHY": 3, + "PRIVATE_LINK_STATUS_UNHEALTHY": 4, + "PRIVATE_LINK_STATUS_APPROVED": 5, + } +) + +func (x PrivateLinkStatus_Status) Enum() *PrivateLinkStatus_Status { + p := new(PrivateLinkStatus_Status) + *p = x + return p +} + +func (x PrivateLinkStatus_Status) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (PrivateLinkStatus_Status) Descriptor() protoreflect.EnumDescriptor { + return file_livekit_cloud_agent_proto_enumTypes[2].Descriptor() +} + +func (PrivateLinkStatus_Status) Type() protoreflect.EnumType { + return &file_livekit_cloud_agent_proto_enumTypes[2] +} + +func (x PrivateLinkStatus_Status) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use PrivateLinkStatus_Status.Descriptor instead. +func (PrivateLinkStatus_Status) EnumDescriptor() ([]byte, []int) { + return file_livekit_cloud_agent_proto_rawDescGZIP(), []int{34, 0} +} + +type AgentEvent struct { + state protoimpl.MessageState `protogen:"open.v1"` + Type AgentEventType `protobuf:"varint,1,opt,name=type,proto3,enum=livekit.AgentEventType" json:"type,omitempty"` + Count int32 `protobuf:"varint,2,opt,name=count,proto3" json:"count,omitempty"` + Timestamp *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AgentEvent) Reset() { + *x = AgentEvent{} + mi := &file_livekit_cloud_agent_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AgentEvent) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AgentEvent) ProtoMessage() {} + +func (x *AgentEvent) ProtoReflect() protoreflect.Message { + mi := &file_livekit_cloud_agent_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AgentEvent.ProtoReflect.Descriptor instead. +func (*AgentEvent) Descriptor() ([]byte, []int) { + return file_livekit_cloud_agent_proto_rawDescGZIP(), []int{0} +} + +func (x *AgentEvent) GetType() AgentEventType { + if x != nil { + return x.Type + } + return AgentEventType_AGENT_EVENT_TYPE_UNKNOWN +} + +func (x *AgentEvent) GetCount() int32 { + if x != nil { + return x.Count + } + return 0 +} + +func (x *AgentEvent) GetTimestamp() *timestamppb.Timestamp { + if x != nil { + return x.Timestamp + } + return nil +} + +type AgentSecret struct { + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` + CreatedAt *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` + UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` + Kind AgentSecretKind `protobuf:"varint,5,opt,name=kind,proto3,enum=livekit.AgentSecretKind" json:"kind,omitempty"` + Environments []string `protobuf:"bytes,6,rep,name=environments,proto3" json:"environments,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AgentSecret) Reset() { + *x = AgentSecret{} + mi := &file_livekit_cloud_agent_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AgentSecret) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AgentSecret) ProtoMessage() {} + +func (x *AgentSecret) ProtoReflect() protoreflect.Message { + mi := &file_livekit_cloud_agent_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AgentSecret.ProtoReflect.Descriptor instead. +func (*AgentSecret) Descriptor() ([]byte, []int) { + return file_livekit_cloud_agent_proto_rawDescGZIP(), []int{1} +} + +func (x *AgentSecret) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *AgentSecret) GetValue() []byte { + if x != nil { + return x.Value + } + return nil +} + +func (x *AgentSecret) GetCreatedAt() *timestamppb.Timestamp { + if x != nil { + return x.CreatedAt + } + return nil +} + +func (x *AgentSecret) GetUpdatedAt() *timestamppb.Timestamp { + if x != nil { + return x.UpdatedAt + } + return nil +} + +func (x *AgentSecret) GetKind() AgentSecretKind { + if x != nil { + return x.Kind + } + return AgentSecretKind_AGENT_SECRET_KIND_UNKNOWN +} + +func (x *AgentSecret) GetEnvironments() []string { + if x != nil { + return x.Environments + } + return nil +} + +type CreateAgentRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Deprecated: Marked as deprecated in livekit_cloud_agent.proto. + AgentName string `protobuf:"bytes,1,opt,name=agent_name,json=agentName,proto3" json:"agent_name,omitempty"` + Secrets []*AgentSecret `protobuf:"bytes,2,rep,name=secrets,proto3" json:"secrets,omitempty"` + // Deprecated: Marked as deprecated in livekit_cloud_agent.proto. + Replicas int32 `protobuf:"varint,3,opt,name=replicas,proto3" json:"replicas,omitempty"` + // Deprecated: Marked as deprecated in livekit_cloud_agent.proto. + MaxReplicas int32 `protobuf:"varint,4,opt,name=max_replicas,json=maxReplicas,proto3" json:"max_replicas,omitempty"` + // Deprecated: Marked as deprecated in livekit_cloud_agent.proto. + CpuReq string `protobuf:"bytes,5,opt,name=cpu_req,json=cpuReq,proto3" json:"cpu_req,omitempty"` + Regions []string `protobuf:"bytes,6,rep,name=regions,proto3" json:"regions,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CreateAgentRequest) Reset() { + *x = CreateAgentRequest{} + mi := &file_livekit_cloud_agent_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CreateAgentRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateAgentRequest) ProtoMessage() {} + +func (x *CreateAgentRequest) ProtoReflect() protoreflect.Message { + mi := &file_livekit_cloud_agent_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateAgentRequest.ProtoReflect.Descriptor instead. +func (*CreateAgentRequest) Descriptor() ([]byte, []int) { + return file_livekit_cloud_agent_proto_rawDescGZIP(), []int{2} +} + +// Deprecated: Marked as deprecated in livekit_cloud_agent.proto. +func (x *CreateAgentRequest) GetAgentName() string { + if x != nil { + return x.AgentName + } + return "" +} + +func (x *CreateAgentRequest) GetSecrets() []*AgentSecret { + if x != nil { + return x.Secrets + } + return nil +} + +// Deprecated: Marked as deprecated in livekit_cloud_agent.proto. +func (x *CreateAgentRequest) GetReplicas() int32 { + if x != nil { + return x.Replicas + } + return 0 +} + +// Deprecated: Marked as deprecated in livekit_cloud_agent.proto. +func (x *CreateAgentRequest) GetMaxReplicas() int32 { + if x != nil { + return x.MaxReplicas + } + return 0 +} + +// Deprecated: Marked as deprecated in livekit_cloud_agent.proto. +func (x *CreateAgentRequest) GetCpuReq() string { + if x != nil { + return x.CpuReq + } + return "" +} + +func (x *CreateAgentRequest) GetRegions() []string { + if x != nil { + return x.Regions + } + return nil +} + +type CreateAgentResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + AgentId string `protobuf:"bytes,1,opt,name=agent_id,json=agentId,proto3" json:"agent_id,omitempty"` + AgentName string `protobuf:"bytes,2,opt,name=agent_name,json=agentName,proto3" json:"agent_name,omitempty"` + Status string `protobuf:"bytes,3,opt,name=status,proto3" json:"status,omitempty"` + Version string `protobuf:"bytes,4,opt,name=version,proto3" json:"version,omitempty"` + PresignedUrl string `protobuf:"bytes,5,opt,name=presigned_url,json=presignedUrl,proto3" json:"presigned_url,omitempty"` + Tag string `protobuf:"bytes,6,opt,name=tag,proto3" json:"tag,omitempty"` + ServerRegions []string `protobuf:"bytes,7,rep,name=server_regions,json=serverRegions,proto3" json:"server_regions,omitempty"` + PresignedPostRequest *PresignedPostRequest `protobuf:"bytes,8,opt,name=presigned_post_request,json=presignedPostRequest,proto3" json:"presigned_post_request,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CreateAgentResponse) Reset() { + *x = CreateAgentResponse{} + mi := &file_livekit_cloud_agent_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CreateAgentResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateAgentResponse) ProtoMessage() {} + +func (x *CreateAgentResponse) ProtoReflect() protoreflect.Message { + mi := &file_livekit_cloud_agent_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateAgentResponse.ProtoReflect.Descriptor instead. +func (*CreateAgentResponse) Descriptor() ([]byte, []int) { + return file_livekit_cloud_agent_proto_rawDescGZIP(), []int{3} +} + +func (x *CreateAgentResponse) GetAgentId() string { + if x != nil { + return x.AgentId + } + return "" +} + +func (x *CreateAgentResponse) GetAgentName() string { + if x != nil { + return x.AgentName + } + return "" +} + +func (x *CreateAgentResponse) GetStatus() string { + if x != nil { + return x.Status + } + return "" +} + +func (x *CreateAgentResponse) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + +func (x *CreateAgentResponse) GetPresignedUrl() string { + if x != nil { + return x.PresignedUrl + } + return "" +} + +func (x *CreateAgentResponse) GetTag() string { + if x != nil { + return x.Tag + } + return "" +} + +func (x *CreateAgentResponse) GetServerRegions() []string { + if x != nil { + return x.ServerRegions + } + return nil +} + +func (x *CreateAgentResponse) GetPresignedPostRequest() *PresignedPostRequest { + if x != nil { + return x.PresignedPostRequest + } + return nil +} + +type CreateAgentV2Request struct { + state protoimpl.MessageState `protogen:"open.v1"` + Secrets []*AgentSecret `protobuf:"bytes,1,rep,name=secrets,proto3" json:"secrets,omitempty"` + Regions []string `protobuf:"bytes,2,rep,name=regions,proto3" json:"regions,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CreateAgentV2Request) Reset() { + *x = CreateAgentV2Request{} + mi := &file_livekit_cloud_agent_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CreateAgentV2Request) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateAgentV2Request) ProtoMessage() {} + +func (x *CreateAgentV2Request) ProtoReflect() protoreflect.Message { + mi := &file_livekit_cloud_agent_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateAgentV2Request.ProtoReflect.Descriptor instead. +func (*CreateAgentV2Request) Descriptor() ([]byte, []int) { + return file_livekit_cloud_agent_proto_rawDescGZIP(), []int{4} +} + +func (x *CreateAgentV2Request) GetSecrets() []*AgentSecret { + if x != nil { + return x.Secrets + } + return nil +} + +func (x *CreateAgentV2Request) GetRegions() []string { + if x != nil { + return x.Regions + } + return nil +} + +type CreateAgentV2Response struct { + state protoimpl.MessageState `protogen:"open.v1"` + AgentId string `protobuf:"bytes,1,opt,name=agent_id,json=agentId,proto3" json:"agent_id,omitempty"` + Status string `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"` + ServerRegions []string `protobuf:"bytes,3,rep,name=server_regions,json=serverRegions,proto3" json:"server_regions,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CreateAgentV2Response) Reset() { + *x = CreateAgentV2Response{} + mi := &file_livekit_cloud_agent_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CreateAgentV2Response) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateAgentV2Response) ProtoMessage() {} + +func (x *CreateAgentV2Response) ProtoReflect() protoreflect.Message { + mi := &file_livekit_cloud_agent_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateAgentV2Response.ProtoReflect.Descriptor instead. +func (*CreateAgentV2Response) Descriptor() ([]byte, []int) { + return file_livekit_cloud_agent_proto_rawDescGZIP(), []int{5} +} + +func (x *CreateAgentV2Response) GetAgentId() string { + if x != nil { + return x.AgentId + } + return "" +} + +func (x *CreateAgentV2Response) GetStatus() string { + if x != nil { + return x.Status + } + return "" +} + +func (x *CreateAgentV2Response) GetServerRegions() []string { + if x != nil { + return x.ServerRegions + } + return nil +} + +type PresignedPostRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Url string `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"` + Values map[string]string `protobuf:"bytes,2,rep,name=values,proto3" json:"values,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *PresignedPostRequest) Reset() { + *x = PresignedPostRequest{} + mi := &file_livekit_cloud_agent_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *PresignedPostRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PresignedPostRequest) ProtoMessage() {} + +func (x *PresignedPostRequest) ProtoReflect() protoreflect.Message { + mi := &file_livekit_cloud_agent_proto_msgTypes[6] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PresignedPostRequest.ProtoReflect.Descriptor instead. +func (*PresignedPostRequest) Descriptor() ([]byte, []int) { + return file_livekit_cloud_agent_proto_rawDescGZIP(), []int{6} +} + +func (x *PresignedPostRequest) GetUrl() string { + if x != nil { + return x.Url + } + return "" +} + +func (x *PresignedPostRequest) GetValues() map[string]string { + if x != nil { + return x.Values + } + return nil +} + +type AgentDeployment struct { + state protoimpl.MessageState `protogen:"open.v1"` + Region string `protobuf:"bytes,1,opt,name=region,proto3" json:"region,omitempty"` + AgentId string `protobuf:"bytes,2,opt,name=agent_id,json=agentId,proto3" json:"agent_id,omitempty"` + Status string `protobuf:"bytes,3,opt,name=status,proto3" json:"status,omitempty"` + Replicas int32 `protobuf:"varint,4,opt,name=replicas,proto3" json:"replicas,omitempty"` + MinReplicas int32 `protobuf:"varint,5,opt,name=min_replicas,json=minReplicas,proto3" json:"min_replicas,omitempty"` + MaxReplicas int32 `protobuf:"varint,6,opt,name=max_replicas,json=maxReplicas,proto3" json:"max_replicas,omitempty"` + CpuReq string `protobuf:"bytes,7,opt,name=cpu_req,json=cpuReq,proto3" json:"cpu_req,omitempty"` + CurCpu string `protobuf:"bytes,8,opt,name=cur_cpu,json=curCpu,proto3" json:"cur_cpu,omitempty"` + CurMem string `protobuf:"bytes,9,opt,name=cur_mem,json=curMem,proto3" json:"cur_mem,omitempty"` + MemReq string `protobuf:"bytes,10,opt,name=mem_req,json=memReq,proto3" json:"mem_req,omitempty"` + MemLimit string `protobuf:"bytes,11,opt,name=mem_limit,json=memLimit,proto3" json:"mem_limit,omitempty"` + CpuLimit string `protobuf:"bytes,12,opt,name=cpu_limit,json=cpuLimit,proto3" json:"cpu_limit,omitempty"` + ServerRegion string `protobuf:"bytes,13,opt,name=server_region,json=serverRegion,proto3" json:"server_region,omitempty"` + Events []*AgentEvent `protobuf:"bytes,14,rep,name=events,proto3" json:"events,omitempty"` + Environment string `protobuf:"bytes,15,opt,name=environment,proto3" json:"environment,omitempty"` + Version string `protobuf:"bytes,16,opt,name=version,proto3" json:"version,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AgentDeployment) Reset() { + *x = AgentDeployment{} + mi := &file_livekit_cloud_agent_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AgentDeployment) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AgentDeployment) ProtoMessage() {} + +func (x *AgentDeployment) ProtoReflect() protoreflect.Message { + mi := &file_livekit_cloud_agent_proto_msgTypes[7] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AgentDeployment.ProtoReflect.Descriptor instead. +func (*AgentDeployment) Descriptor() ([]byte, []int) { + return file_livekit_cloud_agent_proto_rawDescGZIP(), []int{7} +} + +func (x *AgentDeployment) GetRegion() string { + if x != nil { + return x.Region + } + return "" +} + +func (x *AgentDeployment) GetAgentId() string { + if x != nil { + return x.AgentId + } + return "" +} + +func (x *AgentDeployment) GetStatus() string { + if x != nil { + return x.Status + } + return "" +} + +func (x *AgentDeployment) GetReplicas() int32 { + if x != nil { + return x.Replicas + } + return 0 +} + +func (x *AgentDeployment) GetMinReplicas() int32 { + if x != nil { + return x.MinReplicas + } + return 0 +} + +func (x *AgentDeployment) GetMaxReplicas() int32 { + if x != nil { + return x.MaxReplicas + } + return 0 +} + +func (x *AgentDeployment) GetCpuReq() string { + if x != nil { + return x.CpuReq + } + return "" +} + +func (x *AgentDeployment) GetCurCpu() string { + if x != nil { + return x.CurCpu + } + return "" +} + +func (x *AgentDeployment) GetCurMem() string { + if x != nil { + return x.CurMem + } + return "" +} + +func (x *AgentDeployment) GetMemReq() string { + if x != nil { + return x.MemReq + } + return "" +} + +func (x *AgentDeployment) GetMemLimit() string { + if x != nil { + return x.MemLimit + } + return "" +} + +func (x *AgentDeployment) GetCpuLimit() string { + if x != nil { + return x.CpuLimit + } + return "" +} + +func (x *AgentDeployment) GetServerRegion() string { + if x != nil { + return x.ServerRegion + } + return "" +} + +func (x *AgentDeployment) GetEvents() []*AgentEvent { + if x != nil { + return x.Events + } + return nil +} + +func (x *AgentDeployment) GetEnvironment() string { + if x != nil { + return x.Environment + } + return "" +} + +func (x *AgentDeployment) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + +type AgentInfo struct { + state protoimpl.MessageState `protogen:"open.v1"` + AgentId string `protobuf:"bytes,1,opt,name=agent_id,json=agentId,proto3" json:"agent_id,omitempty"` + AgentName string `protobuf:"bytes,2,opt,name=agent_name,json=agentName,proto3" json:"agent_name,omitempty"` + Version string `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"` + AgentDeployments []*AgentDeployment `protobuf:"bytes,4,rep,name=agent_deployments,json=agentDeployments,proto3" json:"agent_deployments,omitempty"` + Secrets []*AgentSecret `protobuf:"bytes,5,rep,name=secrets,proto3" json:"secrets,omitempty"` + DeployedAt *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=deployed_at,json=deployedAt,proto3" json:"deployed_at,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AgentInfo) Reset() { + *x = AgentInfo{} + mi := &file_livekit_cloud_agent_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AgentInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AgentInfo) ProtoMessage() {} + +func (x *AgentInfo) ProtoReflect() protoreflect.Message { + mi := &file_livekit_cloud_agent_proto_msgTypes[8] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AgentInfo.ProtoReflect.Descriptor instead. +func (*AgentInfo) Descriptor() ([]byte, []int) { + return file_livekit_cloud_agent_proto_rawDescGZIP(), []int{8} +} + +func (x *AgentInfo) GetAgentId() string { + if x != nil { + return x.AgentId + } + return "" +} + +func (x *AgentInfo) GetAgentName() string { + if x != nil { + return x.AgentName + } + return "" +} + +func (x *AgentInfo) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + +func (x *AgentInfo) GetAgentDeployments() []*AgentDeployment { + if x != nil { + return x.AgentDeployments + } + return nil +} + +func (x *AgentInfo) GetSecrets() []*AgentSecret { + if x != nil { + return x.Secrets + } + return nil +} + +func (x *AgentInfo) GetDeployedAt() *timestamppb.Timestamp { + if x != nil { + return x.DeployedAt + } + return nil +} + +type ListAgentsRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + AgentName string `protobuf:"bytes,1,opt,name=agent_name,json=agentName,proto3" json:"agent_name,omitempty"` + AgentId string `protobuf:"bytes,2,opt,name=agent_id,json=agentId,proto3" json:"agent_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListAgentsRequest) Reset() { + *x = ListAgentsRequest{} + mi := &file_livekit_cloud_agent_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListAgentsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListAgentsRequest) ProtoMessage() {} + +func (x *ListAgentsRequest) ProtoReflect() protoreflect.Message { + mi := &file_livekit_cloud_agent_proto_msgTypes[9] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListAgentsRequest.ProtoReflect.Descriptor instead. +func (*ListAgentsRequest) Descriptor() ([]byte, []int) { + return file_livekit_cloud_agent_proto_rawDescGZIP(), []int{9} +} + +func (x *ListAgentsRequest) GetAgentName() string { + if x != nil { + return x.AgentName + } + return "" +} + +func (x *ListAgentsRequest) GetAgentId() string { + if x != nil { + return x.AgentId + } + return "" +} + +type ListAgentsResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Agents []*AgentInfo `protobuf:"bytes,1,rep,name=agents,proto3" json:"agents,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListAgentsResponse) Reset() { + *x = ListAgentsResponse{} + mi := &file_livekit_cloud_agent_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListAgentsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListAgentsResponse) ProtoMessage() {} + +func (x *ListAgentsResponse) ProtoReflect() protoreflect.Message { + mi := &file_livekit_cloud_agent_proto_msgTypes[10] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListAgentsResponse.ProtoReflect.Descriptor instead. +func (*ListAgentsResponse) Descriptor() ([]byte, []int) { + return file_livekit_cloud_agent_proto_rawDescGZIP(), []int{10} +} + +func (x *ListAgentsResponse) GetAgents() []*AgentInfo { + if x != nil { + return x.Agents + } + return nil +} + +type AgentVersion struct { + state protoimpl.MessageState `protogen:"open.v1"` + Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` + Current bool `protobuf:"varint,2,opt,name=current,proto3" json:"current,omitempty"` + CreatedAt *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` + DeployedAt *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=deployed_at,json=deployedAt,proto3" json:"deployed_at,omitempty"` + Attributes map[string]string `protobuf:"bytes,5,rep,name=attributes,proto3" json:"attributes,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + Status string `protobuf:"bytes,6,opt,name=status,proto3" json:"status,omitempty"` + Owner string `protobuf:"bytes,7,opt,name=owner,proto3" json:"owner,omitempty"` + Draining bool `protobuf:"varint,8,opt,name=draining,proto3" json:"draining,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AgentVersion) Reset() { + *x = AgentVersion{} + mi := &file_livekit_cloud_agent_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AgentVersion) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AgentVersion) ProtoMessage() {} + +func (x *AgentVersion) ProtoReflect() protoreflect.Message { + mi := &file_livekit_cloud_agent_proto_msgTypes[11] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AgentVersion.ProtoReflect.Descriptor instead. +func (*AgentVersion) Descriptor() ([]byte, []int) { + return file_livekit_cloud_agent_proto_rawDescGZIP(), []int{11} +} + +func (x *AgentVersion) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + +func (x *AgentVersion) GetCurrent() bool { + if x != nil { + return x.Current + } + return false +} + +func (x *AgentVersion) GetCreatedAt() *timestamppb.Timestamp { + if x != nil { + return x.CreatedAt + } + return nil +} + +func (x *AgentVersion) GetDeployedAt() *timestamppb.Timestamp { + if x != nil { + return x.DeployedAt + } + return nil +} + +func (x *AgentVersion) GetAttributes() map[string]string { + if x != nil { + return x.Attributes + } + return nil +} + +func (x *AgentVersion) GetStatus() string { + if x != nil { + return x.Status + } + return "" +} + +func (x *AgentVersion) GetOwner() string { + if x != nil { + return x.Owner + } + return "" +} + +func (x *AgentVersion) GetDraining() bool { + if x != nil { + return x.Draining + } + return false +} + +type ListAgentVersionsRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + AgentId string `protobuf:"bytes,1,opt,name=agent_id,json=agentId,proto3" json:"agent_id,omitempty"` + AgentName string `protobuf:"bytes,2,opt,name=agent_name,json=agentName,proto3" json:"agent_name,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListAgentVersionsRequest) Reset() { + *x = ListAgentVersionsRequest{} + mi := &file_livekit_cloud_agent_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListAgentVersionsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListAgentVersionsRequest) ProtoMessage() {} + +func (x *ListAgentVersionsRequest) ProtoReflect() protoreflect.Message { + mi := &file_livekit_cloud_agent_proto_msgTypes[12] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListAgentVersionsRequest.ProtoReflect.Descriptor instead. +func (*ListAgentVersionsRequest) Descriptor() ([]byte, []int) { + return file_livekit_cloud_agent_proto_rawDescGZIP(), []int{12} +} + +func (x *ListAgentVersionsRequest) GetAgentId() string { + if x != nil { + return x.AgentId + } + return "" +} + +func (x *ListAgentVersionsRequest) GetAgentName() string { + if x != nil { + return x.AgentName + } + return "" +} + +type ListAgentVersionsResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Versions []*AgentVersion `protobuf:"bytes,1,rep,name=versions,proto3" json:"versions,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListAgentVersionsResponse) Reset() { + *x = ListAgentVersionsResponse{} + mi := &file_livekit_cloud_agent_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListAgentVersionsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListAgentVersionsResponse) ProtoMessage() {} + +func (x *ListAgentVersionsResponse) ProtoReflect() protoreflect.Message { + mi := &file_livekit_cloud_agent_proto_msgTypes[13] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListAgentVersionsResponse.ProtoReflect.Descriptor instead. +func (*ListAgentVersionsResponse) Descriptor() ([]byte, []int) { + return file_livekit_cloud_agent_proto_rawDescGZIP(), []int{13} +} + +func (x *ListAgentVersionsResponse) GetVersions() []*AgentVersion { + if x != nil { + return x.Versions + } + return nil +} + +type UpdateAgentRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + AgentId string `protobuf:"bytes,1,opt,name=agent_id,json=agentId,proto3" json:"agent_id,omitempty"` + // Deprecated: Marked as deprecated in livekit_cloud_agent.proto. + AgentName string `protobuf:"bytes,2,opt,name=agent_name,json=agentName,proto3" json:"agent_name,omitempty"` + // Deprecated: Marked as deprecated in livekit_cloud_agent.proto. + Replicas int32 `protobuf:"varint,3,opt,name=replicas,proto3" json:"replicas,omitempty"` + // Deprecated: Marked as deprecated in livekit_cloud_agent.proto. + MaxReplicas int32 `protobuf:"varint,4,opt,name=max_replicas,json=maxReplicas,proto3" json:"max_replicas,omitempty"` + // Deprecated: Marked as deprecated in livekit_cloud_agent.proto. + CpuReq string `protobuf:"bytes,5,opt,name=cpu_req,json=cpuReq,proto3" json:"cpu_req,omitempty"` + Regions []string `protobuf:"bytes,6,rep,name=regions,proto3" json:"regions,omitempty"` + Secrets []*AgentSecret `protobuf:"bytes,7,rep,name=secrets,proto3" json:"secrets,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UpdateAgentRequest) Reset() { + *x = UpdateAgentRequest{} + mi := &file_livekit_cloud_agent_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UpdateAgentRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateAgentRequest) ProtoMessage() {} + +func (x *UpdateAgentRequest) ProtoReflect() protoreflect.Message { + mi := &file_livekit_cloud_agent_proto_msgTypes[14] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateAgentRequest.ProtoReflect.Descriptor instead. +func (*UpdateAgentRequest) Descriptor() ([]byte, []int) { + return file_livekit_cloud_agent_proto_rawDescGZIP(), []int{14} +} + +func (x *UpdateAgentRequest) GetAgentId() string { + if x != nil { + return x.AgentId + } + return "" +} + +// Deprecated: Marked as deprecated in livekit_cloud_agent.proto. +func (x *UpdateAgentRequest) GetAgentName() string { + if x != nil { + return x.AgentName + } + return "" +} + +// Deprecated: Marked as deprecated in livekit_cloud_agent.proto. +func (x *UpdateAgentRequest) GetReplicas() int32 { + if x != nil { + return x.Replicas + } + return 0 +} + +// Deprecated: Marked as deprecated in livekit_cloud_agent.proto. +func (x *UpdateAgentRequest) GetMaxReplicas() int32 { + if x != nil { + return x.MaxReplicas + } + return 0 +} + +// Deprecated: Marked as deprecated in livekit_cloud_agent.proto. +func (x *UpdateAgentRequest) GetCpuReq() string { + if x != nil { + return x.CpuReq + } + return "" +} + +func (x *UpdateAgentRequest) GetRegions() []string { + if x != nil { + return x.Regions + } + return nil +} + +func (x *UpdateAgentRequest) GetSecrets() []*AgentSecret { + if x != nil { + return x.Secrets + } + return nil +} + +type UpdateAgentResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` + Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UpdateAgentResponse) Reset() { + *x = UpdateAgentResponse{} + mi := &file_livekit_cloud_agent_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UpdateAgentResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateAgentResponse) ProtoMessage() {} + +func (x *UpdateAgentResponse) ProtoReflect() protoreflect.Message { + mi := &file_livekit_cloud_agent_proto_msgTypes[15] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateAgentResponse.ProtoReflect.Descriptor instead. +func (*UpdateAgentResponse) Descriptor() ([]byte, []int) { + return file_livekit_cloud_agent_proto_rawDescGZIP(), []int{15} +} + +func (x *UpdateAgentResponse) GetSuccess() bool { + if x != nil { + return x.Success + } + return false +} + +func (x *UpdateAgentResponse) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +type RestartAgentRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + AgentId string `protobuf:"bytes,1,opt,name=agent_id,json=agentId,proto3" json:"agent_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RestartAgentRequest) Reset() { + *x = RestartAgentRequest{} + mi := &file_livekit_cloud_agent_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RestartAgentRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RestartAgentRequest) ProtoMessage() {} + +func (x *RestartAgentRequest) ProtoReflect() protoreflect.Message { + mi := &file_livekit_cloud_agent_proto_msgTypes[16] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RestartAgentRequest.ProtoReflect.Descriptor instead. +func (*RestartAgentRequest) Descriptor() ([]byte, []int) { + return file_livekit_cloud_agent_proto_rawDescGZIP(), []int{16} +} + +func (x *RestartAgentRequest) GetAgentId() string { + if x != nil { + return x.AgentId + } + return "" +} + +type RestartAgentResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` + Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RestartAgentResponse) Reset() { + *x = RestartAgentResponse{} + mi := &file_livekit_cloud_agent_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RestartAgentResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RestartAgentResponse) ProtoMessage() {} + +func (x *RestartAgentResponse) ProtoReflect() protoreflect.Message { + mi := &file_livekit_cloud_agent_proto_msgTypes[17] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RestartAgentResponse.ProtoReflect.Descriptor instead. +func (*RestartAgentResponse) Descriptor() ([]byte, []int) { + return file_livekit_cloud_agent_proto_rawDescGZIP(), []int{17} +} + +func (x *RestartAgentResponse) GetSuccess() bool { + if x != nil { + return x.Success + } + return false +} + +func (x *RestartAgentResponse) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +type DeployAgentRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + AgentId string `protobuf:"bytes,1,opt,name=agent_id,json=agentId,proto3" json:"agent_id,omitempty"` + // Deprecated: Marked as deprecated in livekit_cloud_agent.proto. + AgentName string `protobuf:"bytes,2,opt,name=agent_name,json=agentName,proto3" json:"agent_name,omitempty"` + Secrets []*AgentSecret `protobuf:"bytes,3,rep,name=secrets,proto3" json:"secrets,omitempty"` + // Deprecated: Marked as deprecated in livekit_cloud_agent.proto. + Replicas int32 `protobuf:"varint,4,opt,name=replicas,proto3" json:"replicas,omitempty"` + // Deprecated: Marked as deprecated in livekit_cloud_agent.proto. + MaxReplicas int32 `protobuf:"varint,5,opt,name=max_replicas,json=maxReplicas,proto3" json:"max_replicas,omitempty"` + // Deprecated: Marked as deprecated in livekit_cloud_agent.proto. + CpuReq string `protobuf:"bytes,6,opt,name=cpu_req,json=cpuReq,proto3" json:"cpu_req,omitempty"` + Environment string `protobuf:"bytes,7,opt,name=environment,proto3" json:"environment,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DeployAgentRequest) Reset() { + *x = DeployAgentRequest{} + mi := &file_livekit_cloud_agent_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DeployAgentRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeployAgentRequest) ProtoMessage() {} + +func (x *DeployAgentRequest) ProtoReflect() protoreflect.Message { + mi := &file_livekit_cloud_agent_proto_msgTypes[18] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeployAgentRequest.ProtoReflect.Descriptor instead. +func (*DeployAgentRequest) Descriptor() ([]byte, []int) { + return file_livekit_cloud_agent_proto_rawDescGZIP(), []int{18} +} + +func (x *DeployAgentRequest) GetAgentId() string { + if x != nil { + return x.AgentId + } + return "" +} + +// Deprecated: Marked as deprecated in livekit_cloud_agent.proto. +func (x *DeployAgentRequest) GetAgentName() string { + if x != nil { + return x.AgentName + } + return "" +} + +func (x *DeployAgentRequest) GetSecrets() []*AgentSecret { + if x != nil { + return x.Secrets + } + return nil +} + +// Deprecated: Marked as deprecated in livekit_cloud_agent.proto. +func (x *DeployAgentRequest) GetReplicas() int32 { + if x != nil { + return x.Replicas + } + return 0 +} + +// Deprecated: Marked as deprecated in livekit_cloud_agent.proto. +func (x *DeployAgentRequest) GetMaxReplicas() int32 { + if x != nil { + return x.MaxReplicas + } + return 0 +} + +// Deprecated: Marked as deprecated in livekit_cloud_agent.proto. +func (x *DeployAgentRequest) GetCpuReq() string { + if x != nil { + return x.CpuReq + } + return "" +} + +func (x *DeployAgentRequest) GetEnvironment() string { + if x != nil { + return x.Environment + } + return "" +} + +type DeployAgentResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` + Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` + AgentId string `protobuf:"bytes,3,opt,name=agent_id,json=agentId,proto3" json:"agent_id,omitempty"` + // Deprecated: Marked as deprecated in livekit_cloud_agent.proto. + PresignedUrl string `protobuf:"bytes,4,opt,name=presigned_url,json=presignedUrl,proto3" json:"presigned_url,omitempty"` + Tag string `protobuf:"bytes,5,opt,name=tag,proto3" json:"tag,omitempty"` + PresignedPostRequest *PresignedPostRequest `protobuf:"bytes,6,opt,name=presigned_post_request,json=presignedPostRequest,proto3" json:"presigned_post_request,omitempty"` + Environment string `protobuf:"bytes,7,opt,name=environment,proto3" json:"environment,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DeployAgentResponse) Reset() { + *x = DeployAgentResponse{} + mi := &file_livekit_cloud_agent_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DeployAgentResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeployAgentResponse) ProtoMessage() {} + +func (x *DeployAgentResponse) ProtoReflect() protoreflect.Message { + mi := &file_livekit_cloud_agent_proto_msgTypes[19] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeployAgentResponse.ProtoReflect.Descriptor instead. +func (*DeployAgentResponse) Descriptor() ([]byte, []int) { + return file_livekit_cloud_agent_proto_rawDescGZIP(), []int{19} +} + +func (x *DeployAgentResponse) GetSuccess() bool { + if x != nil { + return x.Success + } + return false +} + +func (x *DeployAgentResponse) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +func (x *DeployAgentResponse) GetAgentId() string { + if x != nil { + return x.AgentId + } + return "" +} + +// Deprecated: Marked as deprecated in livekit_cloud_agent.proto. +func (x *DeployAgentResponse) GetPresignedUrl() string { + if x != nil { + return x.PresignedUrl + } + return "" +} + +func (x *DeployAgentResponse) GetTag() string { + if x != nil { + return x.Tag + } + return "" +} + +func (x *DeployAgentResponse) GetPresignedPostRequest() *PresignedPostRequest { + if x != nil { + return x.PresignedPostRequest + } + return nil +} + +func (x *DeployAgentResponse) GetEnvironment() string { + if x != nil { + return x.Environment + } + return "" +} + +type DeployAgentV2Request struct { + state protoimpl.MessageState `protogen:"open.v1"` + AgentId string `protobuf:"bytes,1,opt,name=agent_id,json=agentId,proto3" json:"agent_id,omitempty"` + Secrets []*AgentSecret `protobuf:"bytes,2,rep,name=secrets,proto3" json:"secrets,omitempty"` + Environment string `protobuf:"bytes,3,opt,name=environment,proto3" json:"environment,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DeployAgentV2Request) Reset() { + *x = DeployAgentV2Request{} + mi := &file_livekit_cloud_agent_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DeployAgentV2Request) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeployAgentV2Request) ProtoMessage() {} + +func (x *DeployAgentV2Request) ProtoReflect() protoreflect.Message { + mi := &file_livekit_cloud_agent_proto_msgTypes[20] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeployAgentV2Request.ProtoReflect.Descriptor instead. +func (*DeployAgentV2Request) Descriptor() ([]byte, []int) { + return file_livekit_cloud_agent_proto_rawDescGZIP(), []int{20} +} + +func (x *DeployAgentV2Request) GetAgentId() string { + if x != nil { + return x.AgentId + } + return "" +} + +func (x *DeployAgentV2Request) GetSecrets() []*AgentSecret { + if x != nil { + return x.Secrets + } + return nil +} + +func (x *DeployAgentV2Request) GetEnvironment() string { + if x != nil { + return x.Environment + } + return "" +} + +type DeployAgentV2Response struct { + state protoimpl.MessageState `protogen:"open.v1"` + Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` + Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` + AgentId string `protobuf:"bytes,3,opt,name=agent_id,json=agentId,proto3" json:"agent_id,omitempty"` + Tag string `protobuf:"bytes,4,opt,name=tag,proto3" json:"tag,omitempty"` + PresignedReq *PresignedPostRequest `protobuf:"bytes,5,opt,name=presigned_req,json=presignedReq,proto3" json:"presigned_req,omitempty"` + Environment string `protobuf:"bytes,6,opt,name=environment,proto3" json:"environment,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DeployAgentV2Response) Reset() { + *x = DeployAgentV2Response{} + mi := &file_livekit_cloud_agent_proto_msgTypes[21] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DeployAgentV2Response) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeployAgentV2Response) ProtoMessage() {} + +func (x *DeployAgentV2Response) ProtoReflect() protoreflect.Message { + mi := &file_livekit_cloud_agent_proto_msgTypes[21] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeployAgentV2Response.ProtoReflect.Descriptor instead. +func (*DeployAgentV2Response) Descriptor() ([]byte, []int) { + return file_livekit_cloud_agent_proto_rawDescGZIP(), []int{21} +} + +func (x *DeployAgentV2Response) GetSuccess() bool { + if x != nil { + return x.Success + } + return false +} + +func (x *DeployAgentV2Response) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +func (x *DeployAgentV2Response) GetAgentId() string { + if x != nil { + return x.AgentId + } + return "" +} + +func (x *DeployAgentV2Response) GetTag() string { + if x != nil { + return x.Tag + } + return "" +} + +func (x *DeployAgentV2Response) GetPresignedReq() *PresignedPostRequest { + if x != nil { + return x.PresignedReq + } + return nil +} + +func (x *DeployAgentV2Response) GetEnvironment() string { + if x != nil { + return x.Environment + } + return "" +} + +type UpdateAgentSecretsRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + AgentId string `protobuf:"bytes,1,opt,name=agent_id,json=agentId,proto3" json:"agent_id,omitempty"` + AgentName string `protobuf:"bytes,2,opt,name=agent_name,json=agentName,proto3" json:"agent_name,omitempty"` + Overwrite bool `protobuf:"varint,3,opt,name=overwrite,proto3" json:"overwrite,omitempty"` + Secrets []*AgentSecret `protobuf:"bytes,4,rep,name=secrets,proto3" json:"secrets,omitempty"` + Remove []string `protobuf:"bytes,5,rep,name=remove,proto3" json:"remove,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UpdateAgentSecretsRequest) Reset() { + *x = UpdateAgentSecretsRequest{} + mi := &file_livekit_cloud_agent_proto_msgTypes[22] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UpdateAgentSecretsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateAgentSecretsRequest) ProtoMessage() {} + +func (x *UpdateAgentSecretsRequest) ProtoReflect() protoreflect.Message { + mi := &file_livekit_cloud_agent_proto_msgTypes[22] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateAgentSecretsRequest.ProtoReflect.Descriptor instead. +func (*UpdateAgentSecretsRequest) Descriptor() ([]byte, []int) { + return file_livekit_cloud_agent_proto_rawDescGZIP(), []int{22} +} + +func (x *UpdateAgentSecretsRequest) GetAgentId() string { + if x != nil { + return x.AgentId + } + return "" +} + +func (x *UpdateAgentSecretsRequest) GetAgentName() string { + if x != nil { + return x.AgentName + } + return "" +} + +func (x *UpdateAgentSecretsRequest) GetOverwrite() bool { + if x != nil { + return x.Overwrite + } + return false +} + +func (x *UpdateAgentSecretsRequest) GetSecrets() []*AgentSecret { + if x != nil { + return x.Secrets + } + return nil +} + +func (x *UpdateAgentSecretsRequest) GetRemove() []string { + if x != nil { + return x.Remove + } + return nil +} + +type UpdateAgentSecretsResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` + Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UpdateAgentSecretsResponse) Reset() { + *x = UpdateAgentSecretsResponse{} + mi := &file_livekit_cloud_agent_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UpdateAgentSecretsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateAgentSecretsResponse) ProtoMessage() {} + +func (x *UpdateAgentSecretsResponse) ProtoReflect() protoreflect.Message { + mi := &file_livekit_cloud_agent_proto_msgTypes[23] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateAgentSecretsResponse.ProtoReflect.Descriptor instead. +func (*UpdateAgentSecretsResponse) Descriptor() ([]byte, []int) { + return file_livekit_cloud_agent_proto_rawDescGZIP(), []int{23} +} + +func (x *UpdateAgentSecretsResponse) GetSuccess() bool { + if x != nil { + return x.Success + } + return false +} + +func (x *UpdateAgentSecretsResponse) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +type RollbackAgentRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + AgentId string `protobuf:"bytes,1,opt,name=agent_id,json=agentId,proto3" json:"agent_id,omitempty"` + AgentName string `protobuf:"bytes,2,opt,name=agent_name,json=agentName,proto3" json:"agent_name,omitempty"` + Version string `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RollbackAgentRequest) Reset() { + *x = RollbackAgentRequest{} + mi := &file_livekit_cloud_agent_proto_msgTypes[24] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RollbackAgentRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RollbackAgentRequest) ProtoMessage() {} + +func (x *RollbackAgentRequest) ProtoReflect() protoreflect.Message { + mi := &file_livekit_cloud_agent_proto_msgTypes[24] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RollbackAgentRequest.ProtoReflect.Descriptor instead. +func (*RollbackAgentRequest) Descriptor() ([]byte, []int) { + return file_livekit_cloud_agent_proto_rawDescGZIP(), []int{24} +} + +func (x *RollbackAgentRequest) GetAgentId() string { + if x != nil { + return x.AgentId + } + return "" +} + +func (x *RollbackAgentRequest) GetAgentName() string { + if x != nil { + return x.AgentName + } + return "" +} + +func (x *RollbackAgentRequest) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + +type RollbackAgentResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` + Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RollbackAgentResponse) Reset() { + *x = RollbackAgentResponse{} + mi := &file_livekit_cloud_agent_proto_msgTypes[25] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RollbackAgentResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RollbackAgentResponse) ProtoMessage() {} + +func (x *RollbackAgentResponse) ProtoReflect() protoreflect.Message { + mi := &file_livekit_cloud_agent_proto_msgTypes[25] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RollbackAgentResponse.ProtoReflect.Descriptor instead. +func (*RollbackAgentResponse) Descriptor() ([]byte, []int) { + return file_livekit_cloud_agent_proto_rawDescGZIP(), []int{25} +} + +func (x *RollbackAgentResponse) GetSuccess() bool { + if x != nil { + return x.Success + } + return false +} + +func (x *RollbackAgentResponse) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +type DeleteAgentRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + AgentId string `protobuf:"bytes,1,opt,name=agent_id,json=agentId,proto3" json:"agent_id,omitempty"` + AgentName string `protobuf:"bytes,2,opt,name=agent_name,json=agentName,proto3" json:"agent_name,omitempty"` + Environment string `protobuf:"bytes,3,opt,name=environment,proto3" json:"environment,omitempty"` // optional + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DeleteAgentRequest) Reset() { + *x = DeleteAgentRequest{} + mi := &file_livekit_cloud_agent_proto_msgTypes[26] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DeleteAgentRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteAgentRequest) ProtoMessage() {} + +func (x *DeleteAgentRequest) ProtoReflect() protoreflect.Message { + mi := &file_livekit_cloud_agent_proto_msgTypes[26] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteAgentRequest.ProtoReflect.Descriptor instead. +func (*DeleteAgentRequest) Descriptor() ([]byte, []int) { + return file_livekit_cloud_agent_proto_rawDescGZIP(), []int{26} +} + +func (x *DeleteAgentRequest) GetAgentId() string { + if x != nil { + return x.AgentId + } + return "" +} + +func (x *DeleteAgentRequest) GetAgentName() string { + if x != nil { + return x.AgentName + } + return "" +} + +func (x *DeleteAgentRequest) GetEnvironment() string { + if x != nil { + return x.Environment + } + return "" +} + +type DeleteAgentResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` + Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DeleteAgentResponse) Reset() { + *x = DeleteAgentResponse{} + mi := &file_livekit_cloud_agent_proto_msgTypes[27] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DeleteAgentResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteAgentResponse) ProtoMessage() {} + +func (x *DeleteAgentResponse) ProtoReflect() protoreflect.Message { + mi := &file_livekit_cloud_agent_proto_msgTypes[27] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteAgentResponse.ProtoReflect.Descriptor instead. +func (*DeleteAgentResponse) Descriptor() ([]byte, []int) { + return file_livekit_cloud_agent_proto_rawDescGZIP(), []int{27} +} + +func (x *DeleteAgentResponse) GetSuccess() bool { + if x != nil { + return x.Success + } + return false +} + +func (x *DeleteAgentResponse) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +type ListAgentSecretsRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + AgentId string `protobuf:"bytes,1,opt,name=agent_id,json=agentId,proto3" json:"agent_id,omitempty"` + AgentName string `protobuf:"bytes,2,opt,name=agent_name,json=agentName,proto3" json:"agent_name,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListAgentSecretsRequest) Reset() { + *x = ListAgentSecretsRequest{} + mi := &file_livekit_cloud_agent_proto_msgTypes[28] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListAgentSecretsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListAgentSecretsRequest) ProtoMessage() {} + +func (x *ListAgentSecretsRequest) ProtoReflect() protoreflect.Message { + mi := &file_livekit_cloud_agent_proto_msgTypes[28] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListAgentSecretsRequest.ProtoReflect.Descriptor instead. +func (*ListAgentSecretsRequest) Descriptor() ([]byte, []int) { + return file_livekit_cloud_agent_proto_rawDescGZIP(), []int{28} +} + +func (x *ListAgentSecretsRequest) GetAgentId() string { + if x != nil { + return x.AgentId + } + return "" +} + +func (x *ListAgentSecretsRequest) GetAgentName() string { + if x != nil { + return x.AgentName + } + return "" +} + +type ListAgentSecretsResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Secrets []*AgentSecret `protobuf:"bytes,1,rep,name=secrets,proto3" json:"secrets,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListAgentSecretsResponse) Reset() { + *x = ListAgentSecretsResponse{} + mi := &file_livekit_cloud_agent_proto_msgTypes[29] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListAgentSecretsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListAgentSecretsResponse) ProtoMessage() {} + +func (x *ListAgentSecretsResponse) ProtoReflect() protoreflect.Message { + mi := &file_livekit_cloud_agent_proto_msgTypes[29] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListAgentSecretsResponse.ProtoReflect.Descriptor instead. +func (*ListAgentSecretsResponse) Descriptor() ([]byte, []int) { + return file_livekit_cloud_agent_proto_rawDescGZIP(), []int{29} +} + +func (x *ListAgentSecretsResponse) GetSecrets() []*AgentSecret { + if x != nil { + return x.Secrets + } + return nil +} + +type SettingsParam struct { + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SettingsParam) Reset() { + *x = SettingsParam{} + mi := &file_livekit_cloud_agent_proto_msgTypes[30] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SettingsParam) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SettingsParam) ProtoMessage() {} + +func (x *SettingsParam) ProtoReflect() protoreflect.Message { + mi := &file_livekit_cloud_agent_proto_msgTypes[30] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SettingsParam.ProtoReflect.Descriptor instead. +func (*SettingsParam) Descriptor() ([]byte, []int) { + return file_livekit_cloud_agent_proto_rawDescGZIP(), []int{30} +} + +func (x *SettingsParam) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *SettingsParam) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +type ClientSettingsResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Params []*SettingsParam `protobuf:"bytes,1,rep,name=params,proto3" json:"params,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ClientSettingsResponse) Reset() { + *x = ClientSettingsResponse{} + mi := &file_livekit_cloud_agent_proto_msgTypes[31] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ClientSettingsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ClientSettingsResponse) ProtoMessage() {} + +func (x *ClientSettingsResponse) ProtoReflect() protoreflect.Message { + mi := &file_livekit_cloud_agent_proto_msgTypes[31] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ClientSettingsResponse.ProtoReflect.Descriptor instead. +func (*ClientSettingsResponse) Descriptor() ([]byte, []int) { + return file_livekit_cloud_agent_proto_rawDescGZIP(), []int{31} +} + +func (x *ClientSettingsResponse) GetParams() []*SettingsParam { + if x != nil { + return x.Params + } + return nil +} + +type ClientSettingsRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ClientSettingsRequest) Reset() { + *x = ClientSettingsRequest{} + mi := &file_livekit_cloud_agent_proto_msgTypes[32] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ClientSettingsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ClientSettingsRequest) ProtoMessage() {} + +func (x *ClientSettingsRequest) ProtoReflect() protoreflect.Message { + mi := &file_livekit_cloud_agent_proto_msgTypes[32] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ClientSettingsRequest.ProtoReflect.Descriptor instead. +func (*ClientSettingsRequest) Descriptor() ([]byte, []int) { + return file_livekit_cloud_agent_proto_rawDescGZIP(), []int{32} +} + +type PrivateLink struct { + state protoimpl.MessageState `protogen:"open.v1"` + PrivateLinkId string `protobuf:"bytes,1,opt,name=private_link_id,json=privateLinkId,proto3" json:"private_link_id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Region string `protobuf:"bytes,4,opt,name=region,proto3" json:"region,omitempty"` + Port uint32 `protobuf:"varint,5,opt,name=port,proto3" json:"port,omitempty"` + Endpoint string `protobuf:"bytes,6,opt,name=endpoint,proto3" json:"endpoint,omitempty"` + ConnectionEndpoint string `protobuf:"bytes,7,opt,name=connection_endpoint,json=connectionEndpoint,proto3" json:"connection_endpoint,omitempty"` + // Types that are valid to be assigned to Config: + // + // *PrivateLink_Aws + Config isPrivateLink_Config `protobuf_oneof:"config"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *PrivateLink) Reset() { + *x = PrivateLink{} + mi := &file_livekit_cloud_agent_proto_msgTypes[33] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *PrivateLink) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PrivateLink) ProtoMessage() {} + +func (x *PrivateLink) ProtoReflect() protoreflect.Message { + mi := &file_livekit_cloud_agent_proto_msgTypes[33] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PrivateLink.ProtoReflect.Descriptor instead. +func (*PrivateLink) Descriptor() ([]byte, []int) { + return file_livekit_cloud_agent_proto_rawDescGZIP(), []int{33} +} + +func (x *PrivateLink) GetPrivateLinkId() string { + if x != nil { + return x.PrivateLinkId + } + return "" +} + +func (x *PrivateLink) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *PrivateLink) GetRegion() string { + if x != nil { + return x.Region + } + return "" +} + +func (x *PrivateLink) GetPort() uint32 { + if x != nil { + return x.Port + } + return 0 +} + +func (x *PrivateLink) GetEndpoint() string { + if x != nil { + return x.Endpoint + } + return "" +} + +func (x *PrivateLink) GetConnectionEndpoint() string { + if x != nil { + return x.ConnectionEndpoint + } + return "" +} + +func (x *PrivateLink) GetConfig() isPrivateLink_Config { + if x != nil { + return x.Config + } + return nil +} + +// Deprecated: Marked as deprecated in livekit_cloud_agent.proto. +func (x *PrivateLink) GetAws() *PrivateLink_AWSConfig { + if x != nil { + if x, ok := x.Config.(*PrivateLink_Aws); ok { + return x.Aws + } + } + return nil +} + +type isPrivateLink_Config interface { + isPrivateLink_Config() +} + +type PrivateLink_Aws struct { + // Deprecated: Marked as deprecated in livekit_cloud_agent.proto. + Aws *PrivateLink_AWSConfig `protobuf:"bytes,3,opt,name=aws,proto3,oneof"` +} + +func (*PrivateLink_Aws) isPrivateLink_Config() {} + +type PrivateLinkStatus struct { + state protoimpl.MessageState `protogen:"open.v1"` + Status PrivateLinkStatus_Status `protobuf:"varint,1,opt,name=status,proto3,enum=livekit.PrivateLinkStatus_Status" json:"status,omitempty"` + UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` + Reason string `protobuf:"bytes,3,opt,name=reason,proto3" json:"reason,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *PrivateLinkStatus) Reset() { + *x = PrivateLinkStatus{} + mi := &file_livekit_cloud_agent_proto_msgTypes[34] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *PrivateLinkStatus) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PrivateLinkStatus) ProtoMessage() {} + +func (x *PrivateLinkStatus) ProtoReflect() protoreflect.Message { + mi := &file_livekit_cloud_agent_proto_msgTypes[34] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PrivateLinkStatus.ProtoReflect.Descriptor instead. +func (*PrivateLinkStatus) Descriptor() ([]byte, []int) { + return file_livekit_cloud_agent_proto_rawDescGZIP(), []int{34} +} + +func (x *PrivateLinkStatus) GetStatus() PrivateLinkStatus_Status { + if x != nil { + return x.Status + } + return PrivateLinkStatus_PRIVATE_LINK_STATUS_UNKNOWN +} + +func (x *PrivateLinkStatus) GetUpdatedAt() *timestamppb.Timestamp { + if x != nil { + return x.UpdatedAt + } + return nil +} + +func (x *PrivateLinkStatus) GetReason() string { + if x != nil { + return x.Reason + } + return "" +} + +type CreatePrivateLinkRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Region string `protobuf:"bytes,3,opt,name=region,proto3" json:"region,omitempty"` + Port uint32 `protobuf:"varint,4,opt,name=port,proto3" json:"port,omitempty"` + Endpoint string `protobuf:"bytes,5,opt,name=endpoint,proto3" json:"endpoint,omitempty"` + CloudRegion *string `protobuf:"bytes,6,opt,name=cloud_region,json=cloudRegion,proto3,oneof" json:"cloud_region,omitempty"` + // Types that are valid to be assigned to Config: + // + // *CreatePrivateLinkRequest_Aws + Config isCreatePrivateLinkRequest_Config `protobuf_oneof:"config"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CreatePrivateLinkRequest) Reset() { + *x = CreatePrivateLinkRequest{} + mi := &file_livekit_cloud_agent_proto_msgTypes[35] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CreatePrivateLinkRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreatePrivateLinkRequest) ProtoMessage() {} + +func (x *CreatePrivateLinkRequest) ProtoReflect() protoreflect.Message { + mi := &file_livekit_cloud_agent_proto_msgTypes[35] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreatePrivateLinkRequest.ProtoReflect.Descriptor instead. +func (*CreatePrivateLinkRequest) Descriptor() ([]byte, []int) { + return file_livekit_cloud_agent_proto_rawDescGZIP(), []int{35} +} + +func (x *CreatePrivateLinkRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *CreatePrivateLinkRequest) GetRegion() string { + if x != nil { + return x.Region + } + return "" +} + +func (x *CreatePrivateLinkRequest) GetPort() uint32 { + if x != nil { + return x.Port + } + return 0 +} + +func (x *CreatePrivateLinkRequest) GetEndpoint() string { + if x != nil { + return x.Endpoint + } + return "" +} + +func (x *CreatePrivateLinkRequest) GetCloudRegion() string { + if x != nil && x.CloudRegion != nil { + return *x.CloudRegion + } + return "" +} + +func (x *CreatePrivateLinkRequest) GetConfig() isCreatePrivateLinkRequest_Config { + if x != nil { + return x.Config + } + return nil +} + +// Deprecated: Marked as deprecated in livekit_cloud_agent.proto. +func (x *CreatePrivateLinkRequest) GetAws() *CreatePrivateLinkRequest_AWSCreateConfig { + if x != nil { + if x, ok := x.Config.(*CreatePrivateLinkRequest_Aws); ok { + return x.Aws + } + } + return nil +} + +type isCreatePrivateLinkRequest_Config interface { + isCreatePrivateLinkRequest_Config() +} + +type CreatePrivateLinkRequest_Aws struct { + // Deprecated: Marked as deprecated in livekit_cloud_agent.proto. + Aws *CreatePrivateLinkRequest_AWSCreateConfig `protobuf:"bytes,2,opt,name=aws,proto3,oneof"` +} + +func (*CreatePrivateLinkRequest_Aws) isCreatePrivateLinkRequest_Config() {} + +type CreatePrivateLinkResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + PrivateLink *PrivateLink `protobuf:"bytes,1,opt,name=private_link,json=privateLink,proto3" json:"private_link,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CreatePrivateLinkResponse) Reset() { + *x = CreatePrivateLinkResponse{} + mi := &file_livekit_cloud_agent_proto_msgTypes[36] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CreatePrivateLinkResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreatePrivateLinkResponse) ProtoMessage() {} + +func (x *CreatePrivateLinkResponse) ProtoReflect() protoreflect.Message { + mi := &file_livekit_cloud_agent_proto_msgTypes[36] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreatePrivateLinkResponse.ProtoReflect.Descriptor instead. +func (*CreatePrivateLinkResponse) Descriptor() ([]byte, []int) { + return file_livekit_cloud_agent_proto_rawDescGZIP(), []int{36} +} + +func (x *CreatePrivateLinkResponse) GetPrivateLink() *PrivateLink { + if x != nil { + return x.PrivateLink + } + return nil +} + +type DestroyPrivateLinkRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + PrivateLinkId string `protobuf:"bytes,1,opt,name=private_link_id,json=privateLinkId,proto3" json:"private_link_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DestroyPrivateLinkRequest) Reset() { + *x = DestroyPrivateLinkRequest{} + mi := &file_livekit_cloud_agent_proto_msgTypes[37] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DestroyPrivateLinkRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DestroyPrivateLinkRequest) ProtoMessage() {} + +func (x *DestroyPrivateLinkRequest) ProtoReflect() protoreflect.Message { + mi := &file_livekit_cloud_agent_proto_msgTypes[37] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DestroyPrivateLinkRequest.ProtoReflect.Descriptor instead. +func (*DestroyPrivateLinkRequest) Descriptor() ([]byte, []int) { + return file_livekit_cloud_agent_proto_rawDescGZIP(), []int{37} +} + +func (x *DestroyPrivateLinkRequest) GetPrivateLinkId() string { + if x != nil { + return x.PrivateLinkId + } + return "" +} + +type DestroyPrivateLinkResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DestroyPrivateLinkResponse) Reset() { + *x = DestroyPrivateLinkResponse{} + mi := &file_livekit_cloud_agent_proto_msgTypes[38] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DestroyPrivateLinkResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DestroyPrivateLinkResponse) ProtoMessage() {} + +func (x *DestroyPrivateLinkResponse) ProtoReflect() protoreflect.Message { + mi := &file_livekit_cloud_agent_proto_msgTypes[38] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DestroyPrivateLinkResponse.ProtoReflect.Descriptor instead. +func (*DestroyPrivateLinkResponse) Descriptor() ([]byte, []int) { + return file_livekit_cloud_agent_proto_rawDescGZIP(), []int{38} +} + +type ListPrivateLinksRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListPrivateLinksRequest) Reset() { + *x = ListPrivateLinksRequest{} + mi := &file_livekit_cloud_agent_proto_msgTypes[39] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListPrivateLinksRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListPrivateLinksRequest) ProtoMessage() {} + +func (x *ListPrivateLinksRequest) ProtoReflect() protoreflect.Message { + mi := &file_livekit_cloud_agent_proto_msgTypes[39] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListPrivateLinksRequest.ProtoReflect.Descriptor instead. +func (*ListPrivateLinksRequest) Descriptor() ([]byte, []int) { + return file_livekit_cloud_agent_proto_rawDescGZIP(), []int{39} +} + +type ListPrivateLinksResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Items []*PrivateLink `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListPrivateLinksResponse) Reset() { + *x = ListPrivateLinksResponse{} + mi := &file_livekit_cloud_agent_proto_msgTypes[40] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListPrivateLinksResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListPrivateLinksResponse) ProtoMessage() {} + +func (x *ListPrivateLinksResponse) ProtoReflect() protoreflect.Message { + mi := &file_livekit_cloud_agent_proto_msgTypes[40] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListPrivateLinksResponse.ProtoReflect.Descriptor instead. +func (*ListPrivateLinksResponse) Descriptor() ([]byte, []int) { + return file_livekit_cloud_agent_proto_rawDescGZIP(), []int{40} +} + +func (x *ListPrivateLinksResponse) GetItems() []*PrivateLink { + if x != nil { + return x.Items + } + return nil +} + +type GetPrivateLinkStatusRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + PrivateLinkId string `protobuf:"bytes,1,opt,name=private_link_id,json=privateLinkId,proto3" json:"private_link_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetPrivateLinkStatusRequest) Reset() { + *x = GetPrivateLinkStatusRequest{} + mi := &file_livekit_cloud_agent_proto_msgTypes[41] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetPrivateLinkStatusRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetPrivateLinkStatusRequest) ProtoMessage() {} + +func (x *GetPrivateLinkStatusRequest) ProtoReflect() protoreflect.Message { + mi := &file_livekit_cloud_agent_proto_msgTypes[41] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetPrivateLinkStatusRequest.ProtoReflect.Descriptor instead. +func (*GetPrivateLinkStatusRequest) Descriptor() ([]byte, []int) { + return file_livekit_cloud_agent_proto_rawDescGZIP(), []int{41} +} + +func (x *GetPrivateLinkStatusRequest) GetPrivateLinkId() string { + if x != nil { + return x.PrivateLinkId + } + return "" +} + +type GetPrivateLinkStatusResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Value *PrivateLinkStatus `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetPrivateLinkStatusResponse) Reset() { + *x = GetPrivateLinkStatusResponse{} + mi := &file_livekit_cloud_agent_proto_msgTypes[42] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetPrivateLinkStatusResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetPrivateLinkStatusResponse) ProtoMessage() {} + +func (x *GetPrivateLinkStatusResponse) ProtoReflect() protoreflect.Message { + mi := &file_livekit_cloud_agent_proto_msgTypes[42] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetPrivateLinkStatusResponse.ProtoReflect.Descriptor instead. +func (*GetPrivateLinkStatusResponse) Descriptor() ([]byte, []int) { + return file_livekit_cloud_agent_proto_rawDescGZIP(), []int{42} +} + +func (x *GetPrivateLinkStatusResponse) GetValue() *PrivateLinkStatus { + if x != nil { + return x.Value + } + return nil +} + +type PrivateLink_AWSConfig struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Deprecated: Marked as deprecated in livekit_cloud_agent.proto. + Endpoint string `protobuf:"bytes,1,opt,name=endpoint,proto3" json:"endpoint,omitempty"` // Use the generic "endpoint" instead + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *PrivateLink_AWSConfig) Reset() { + *x = PrivateLink_AWSConfig{} + mi := &file_livekit_cloud_agent_proto_msgTypes[45] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *PrivateLink_AWSConfig) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PrivateLink_AWSConfig) ProtoMessage() {} + +func (x *PrivateLink_AWSConfig) ProtoReflect() protoreflect.Message { + mi := &file_livekit_cloud_agent_proto_msgTypes[45] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PrivateLink_AWSConfig.ProtoReflect.Descriptor instead. +func (*PrivateLink_AWSConfig) Descriptor() ([]byte, []int) { + return file_livekit_cloud_agent_proto_rawDescGZIP(), []int{33, 0} +} + +// Deprecated: Marked as deprecated in livekit_cloud_agent.proto. +func (x *PrivateLink_AWSConfig) GetEndpoint() string { + if x != nil { + return x.Endpoint + } + return "" +} + +type CreatePrivateLinkRequest_AWSCreateConfig struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Deprecated: Marked as deprecated in livekit_cloud_agent.proto. + Endpoint string `protobuf:"bytes,1,opt,name=endpoint,proto3" json:"endpoint,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CreatePrivateLinkRequest_AWSCreateConfig) Reset() { + *x = CreatePrivateLinkRequest_AWSCreateConfig{} + mi := &file_livekit_cloud_agent_proto_msgTypes[46] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CreatePrivateLinkRequest_AWSCreateConfig) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreatePrivateLinkRequest_AWSCreateConfig) ProtoMessage() {} + +func (x *CreatePrivateLinkRequest_AWSCreateConfig) ProtoReflect() protoreflect.Message { + mi := &file_livekit_cloud_agent_proto_msgTypes[46] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreatePrivateLinkRequest_AWSCreateConfig.ProtoReflect.Descriptor instead. +func (*CreatePrivateLinkRequest_AWSCreateConfig) Descriptor() ([]byte, []int) { + return file_livekit_cloud_agent_proto_rawDescGZIP(), []int{35, 0} +} + +// Deprecated: Marked as deprecated in livekit_cloud_agent.proto. +func (x *CreatePrivateLinkRequest_AWSCreateConfig) GetEndpoint() string { + if x != nil { + return x.Endpoint + } + return "" +} + +var File_livekit_cloud_agent_proto protoreflect.FileDescriptor + +const file_livekit_cloud_agent_proto_rawDesc = "" + + "\n" + + "\x19livekit_cloud_agent.proto\x12\alivekit\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x14logger/options.proto\"\x89\x01\n" + + "\n" + + "AgentEvent\x12+\n" + + "\x04type\x18\x01 \x01(\x0e2\x17.livekit.AgentEventTypeR\x04type\x12\x14\n" + + "\x05count\x18\x02 \x01(\x05R\x05count\x128\n" + + "\ttimestamp\x18\x03 \x01(\v2\x1a.google.protobuf.TimestampR\ttimestamp\"\xff\x01\n" + + "\vAgentSecret\x12\x12\n" + + "\x04name\x18\x01 \x01(\tR\x04name\x12\x14\n" + + "\x05value\x18\x02 \x01(\fR\x05value\x129\n" + + "\n" + + "created_at\x18\x03 \x01(\v2\x1a.google.protobuf.TimestampR\tcreatedAt\x129\n" + + "\n" + + "updated_at\x18\x04 \x01(\v2\x1a.google.protobuf.TimestampR\tupdatedAt\x12,\n" + + "\x04kind\x18\x05 \x01(\x0e2\x18.livekit.AgentSecretKindR\x04kind\x12\"\n" + + "\fenvironments\x18\x06 \x03(\tR\fenvironments\"\xe5\x01\n" + + "\x12CreateAgentRequest\x12!\n" + + "\n" + + "agent_name\x18\x01 \x01(\tB\x02\x18\x01R\tagentName\x12.\n" + + "\asecrets\x18\x02 \x03(\v2\x14.livekit.AgentSecretR\asecrets\x12\x1e\n" + + "\breplicas\x18\x03 \x01(\x05B\x02\x18\x01R\breplicas\x12%\n" + + "\fmax_replicas\x18\x04 \x01(\x05B\x02\x18\x01R\vmaxReplicas\x12\x1b\n" + + "\acpu_req\x18\x05 \x01(\tB\x02\x18\x01R\x06cpuReq\x12\x18\n" + + "\aregions\x18\x06 \x03(\tR\aregions\"\xc0\x02\n" + + "\x13CreateAgentResponse\x12%\n" + + "\bagent_id\x18\x01 \x01(\tB\n" + + "\xbaP\aagentIDR\aagentId\x12\x1d\n" + + "\n" + + "agent_name\x18\x02 \x01(\tR\tagentName\x12\x16\n" + + "\x06status\x18\x03 \x01(\tR\x06status\x12\x18\n" + + "\aversion\x18\x04 \x01(\tR\aversion\x12#\n" + + "\rpresigned_url\x18\x05 \x01(\tR\fpresignedUrl\x12\x10\n" + + "\x03tag\x18\x06 \x01(\tR\x03tag\x12%\n" + + "\x0eserver_regions\x18\a \x03(\tR\rserverRegions\x12S\n" + + "\x16presigned_post_request\x18\b \x01(\v2\x1d.livekit.PresignedPostRequestR\x14presignedPostRequest\"`\n" + + "\x14CreateAgentV2Request\x12.\n" + + "\asecrets\x18\x01 \x03(\v2\x14.livekit.AgentSecretR\asecrets\x12\x18\n" + + "\aregions\x18\x02 \x03(\tR\aregions\"}\n" + + "\x15CreateAgentV2Response\x12%\n" + + "\bagent_id\x18\x01 \x01(\tB\n" + + "\xbaP\aagentIDR\aagentId\x12\x16\n" + + "\x06status\x18\x02 \x01(\tR\x06status\x12%\n" + + "\x0eserver_regions\x18\x03 \x03(\tR\rserverRegions\"\xa6\x01\n" + + "\x14PresignedPostRequest\x12\x10\n" + + "\x03url\x18\x01 \x01(\tR\x03url\x12A\n" + + "\x06values\x18\x02 \x03(\v2).livekit.PresignedPostRequest.ValuesEntryR\x06values\x1a9\n" + + "\vValuesEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + + "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\xf6\x03\n" + + "\x0fAgentDeployment\x12\x16\n" + + "\x06region\x18\x01 \x01(\tR\x06region\x12%\n" + + "\bagent_id\x18\x02 \x01(\tB\n" + + "\xbaP\aagentIDR\aagentId\x12\x16\n" + + "\x06status\x18\x03 \x01(\tR\x06status\x12\x1a\n" + + "\breplicas\x18\x04 \x01(\x05R\breplicas\x12!\n" + + "\fmin_replicas\x18\x05 \x01(\x05R\vminReplicas\x12!\n" + + "\fmax_replicas\x18\x06 \x01(\x05R\vmaxReplicas\x12\x17\n" + + "\acpu_req\x18\a \x01(\tR\x06cpuReq\x12\x17\n" + + "\acur_cpu\x18\b \x01(\tR\x06curCpu\x12\x17\n" + + "\acur_mem\x18\t \x01(\tR\x06curMem\x12\x17\n" + + "\amem_req\x18\n" + + " \x01(\tR\x06memReq\x12\x1b\n" + + "\tmem_limit\x18\v \x01(\tR\bmemLimit\x12\x1b\n" + + "\tcpu_limit\x18\f \x01(\tR\bcpuLimit\x12#\n" + + "\rserver_region\x18\r \x01(\tR\fserverRegion\x12+\n" + + "\x06events\x18\x0e \x03(\v2\x13.livekit.AgentEventR\x06events\x12 \n" + + "\venvironment\x18\x0f \x01(\tR\venvironment\x12\x18\n" + + "\aversion\x18\x10 \x01(\tR\aversion\"\x9f\x02\n" + + "\tAgentInfo\x12%\n" + + "\bagent_id\x18\x01 \x01(\tB\n" + + "\xbaP\aagentIDR\aagentId\x12\x1d\n" + + "\n" + + "agent_name\x18\x02 \x01(\tR\tagentName\x12\x18\n" + + "\aversion\x18\x03 \x01(\tR\aversion\x12E\n" + + "\x11agent_deployments\x18\x04 \x03(\v2\x18.livekit.AgentDeploymentR\x10agentDeployments\x12.\n" + + "\asecrets\x18\x05 \x03(\v2\x14.livekit.AgentSecretR\asecrets\x12;\n" + + "\vdeployed_at\x18\x06 \x01(\v2\x1a.google.protobuf.TimestampR\n" + + "deployedAt\"Y\n" + + "\x11ListAgentsRequest\x12\x1d\n" + + "\n" + + "agent_name\x18\x01 \x01(\tR\tagentName\x12%\n" + + "\bagent_id\x18\x02 \x01(\tB\n" + + "\xbaP\aagentIDR\aagentId\"@\n" + + "\x12ListAgentsResponse\x12*\n" + + "\x06agents\x18\x01 \x03(\v2\x12.livekit.AgentInfoR\x06agents\"\x8a\x03\n" + + "\fAgentVersion\x12\x18\n" + + "\aversion\x18\x01 \x01(\tR\aversion\x12\x18\n" + + "\acurrent\x18\x02 \x01(\bR\acurrent\x129\n" + + "\n" + + "created_at\x18\x03 \x01(\v2\x1a.google.protobuf.TimestampR\tcreatedAt\x12;\n" + + "\vdeployed_at\x18\x04 \x01(\v2\x1a.google.protobuf.TimestampR\n" + + "deployedAt\x12E\n" + + "\n" + + "attributes\x18\x05 \x03(\v2%.livekit.AgentVersion.AttributesEntryR\n" + + "attributes\x12\x16\n" + + "\x06status\x18\x06 \x01(\tR\x06status\x12\x14\n" + + "\x05owner\x18\a \x01(\tR\x05owner\x12\x1a\n" + + "\bdraining\x18\b \x01(\bR\bdraining\x1a=\n" + + "\x0fAttributesEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + + "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"`\n" + + "\x18ListAgentVersionsRequest\x12%\n" + + "\bagent_id\x18\x01 \x01(\tB\n" + + "\xbaP\aagentIDR\aagentId\x12\x1d\n" + + "\n" + + "agent_name\x18\x02 \x01(\tR\tagentName\"N\n" + + "\x19ListAgentVersionsResponse\x121\n" + + "\bversions\x18\x01 \x03(\v2\x15.livekit.AgentVersionR\bversions\"\x8c\x02\n" + + "\x12UpdateAgentRequest\x12%\n" + + "\bagent_id\x18\x01 \x01(\tB\n" + + "\xbaP\aagentIDR\aagentId\x12!\n" + + "\n" + + "agent_name\x18\x02 \x01(\tB\x02\x18\x01R\tagentName\x12\x1e\n" + + "\breplicas\x18\x03 \x01(\x05B\x02\x18\x01R\breplicas\x12%\n" + + "\fmax_replicas\x18\x04 \x01(\x05B\x02\x18\x01R\vmaxReplicas\x12\x1b\n" + + "\acpu_req\x18\x05 \x01(\tB\x02\x18\x01R\x06cpuReq\x12\x18\n" + + "\aregions\x18\x06 \x03(\tR\aregions\x12.\n" + + "\asecrets\x18\a \x03(\v2\x14.livekit.AgentSecretR\asecrets\"I\n" + + "\x13UpdateAgentResponse\x12\x18\n" + + "\asuccess\x18\x01 \x01(\bR\asuccess\x12\x18\n" + + "\amessage\x18\x02 \x01(\tR\amessage\"<\n" + + "\x13RestartAgentRequest\x12%\n" + + "\bagent_id\x18\x01 \x01(\tB\n" + + "\xbaP\aagentIDR\aagentId\"J\n" + + "\x14RestartAgentResponse\x12\x18\n" + + "\asuccess\x18\x01 \x01(\bR\asuccess\x12\x18\n" + + "\amessage\x18\x02 \x01(\tR\amessage\"\x94\x02\n" + + "\x12DeployAgentRequest\x12%\n" + + "\bagent_id\x18\x01 \x01(\tB\n" + + "\xbaP\aagentIDR\aagentId\x12!\n" + + "\n" + + "agent_name\x18\x02 \x01(\tB\x02\x18\x01R\tagentName\x12.\n" + + "\asecrets\x18\x03 \x03(\v2\x14.livekit.AgentSecretR\asecrets\x12\x1e\n" + + "\breplicas\x18\x04 \x01(\x05B\x02\x18\x01R\breplicas\x12%\n" + + "\fmax_replicas\x18\x05 \x01(\x05B\x02\x18\x01R\vmaxReplicas\x12\x1b\n" + + "\acpu_req\x18\x06 \x01(\tB\x02\x18\x01R\x06cpuReq\x12 \n" + + "\venvironment\x18\a \x01(\tR\venvironment\"\xa2\x02\n" + + "\x13DeployAgentResponse\x12\x18\n" + + "\asuccess\x18\x01 \x01(\bR\asuccess\x12\x18\n" + + "\amessage\x18\x02 \x01(\tR\amessage\x12%\n" + + "\bagent_id\x18\x03 \x01(\tB\n" + + "\xbaP\aagentIDR\aagentId\x12'\n" + + "\rpresigned_url\x18\x04 \x01(\tB\x02\x18\x01R\fpresignedUrl\x12\x10\n" + + "\x03tag\x18\x05 \x01(\tR\x03tag\x12S\n" + + "\x16presigned_post_request\x18\x06 \x01(\v2\x1d.livekit.PresignedPostRequestR\x14presignedPostRequest\x12 \n" + + "\venvironment\x18\a \x01(\tR\venvironment\"\x8f\x01\n" + + "\x14DeployAgentV2Request\x12%\n" + + "\bagent_id\x18\x01 \x01(\tB\n" + + "\xbaP\aagentIDR\aagentId\x12.\n" + + "\asecrets\x18\x02 \x03(\v2\x14.livekit.AgentSecretR\asecrets\x12 \n" + + "\venvironment\x18\x03 \x01(\tR\venvironment\"\xea\x01\n" + + "\x15DeployAgentV2Response\x12\x18\n" + + "\asuccess\x18\x01 \x01(\bR\asuccess\x12\x18\n" + + "\amessage\x18\x02 \x01(\tR\amessage\x12%\n" + + "\bagent_id\x18\x03 \x01(\tB\n" + + "\xbaP\aagentIDR\aagentId\x12\x10\n" + + "\x03tag\x18\x04 \x01(\tR\x03tag\x12B\n" + + "\rpresigned_req\x18\x05 \x01(\v2\x1d.livekit.PresignedPostRequestR\fpresignedReq\x12 \n" + + "\venvironment\x18\x06 \x01(\tR\venvironment\"\xc7\x01\n" + + "\x19UpdateAgentSecretsRequest\x12%\n" + + "\bagent_id\x18\x01 \x01(\tB\n" + + "\xbaP\aagentIDR\aagentId\x12\x1d\n" + + "\n" + + "agent_name\x18\x02 \x01(\tR\tagentName\x12\x1c\n" + + "\toverwrite\x18\x03 \x01(\bR\toverwrite\x12.\n" + + "\asecrets\x18\x04 \x03(\v2\x14.livekit.AgentSecretR\asecrets\x12\x16\n" + + "\x06remove\x18\x05 \x03(\tR\x06remove\"P\n" + + "\x1aUpdateAgentSecretsResponse\x12\x18\n" + + "\asuccess\x18\x01 \x01(\bR\asuccess\x12\x18\n" + + "\amessage\x18\x02 \x01(\tR\amessage\"v\n" + + "\x14RollbackAgentRequest\x12%\n" + + "\bagent_id\x18\x01 \x01(\tB\n" + + "\xbaP\aagentIDR\aagentId\x12\x1d\n" + + "\n" + + "agent_name\x18\x02 \x01(\tR\tagentName\x12\x18\n" + + "\aversion\x18\x03 \x01(\tR\aversion\"K\n" + + "\x15RollbackAgentResponse\x12\x18\n" + + "\asuccess\x18\x01 \x01(\bR\asuccess\x12\x18\n" + + "\amessage\x18\x02 \x01(\tR\amessage\"|\n" + + "\x12DeleteAgentRequest\x12%\n" + + "\bagent_id\x18\x01 \x01(\tB\n" + + "\xbaP\aagentIDR\aagentId\x12\x1d\n" + + "\n" + + "agent_name\x18\x02 \x01(\tR\tagentName\x12 \n" + + "\venvironment\x18\x03 \x01(\tR\venvironment\"I\n" + + "\x13DeleteAgentResponse\x12\x18\n" + + "\asuccess\x18\x01 \x01(\bR\asuccess\x12\x18\n" + + "\amessage\x18\x02 \x01(\tR\amessage\"_\n" + + "\x17ListAgentSecretsRequest\x12%\n" + + "\bagent_id\x18\x01 \x01(\tB\n" + + "\xbaP\aagentIDR\aagentId\x12\x1d\n" + + "\n" + + "agent_name\x18\x02 \x01(\tR\tagentName\"J\n" + + "\x18ListAgentSecretsResponse\x12.\n" + + "\asecrets\x18\x01 \x03(\v2\x14.livekit.AgentSecretR\asecrets\"9\n" + + "\rSettingsParam\x12\x12\n" + + "\x04name\x18\x01 \x01(\tR\x04name\x12\x14\n" + + "\x05value\x18\x02 \x01(\tR\x05value\"H\n" + + "\x16ClientSettingsResponse\x12.\n" + + "\x06params\x18\x01 \x03(\v2\x16.livekit.SettingsParamR\x06params\"\x17\n" + + "\x15ClientSettingsRequest\"\xc3\x02\n" + + "\vPrivateLink\x128\n" + + "\x0fprivate_link_id\x18\x01 \x01(\tB\x10\xbaP\rprivateLinkIDR\rprivateLinkId\x12\x12\n" + + "\x04name\x18\x02 \x01(\tR\x04name\x12\x16\n" + + "\x06region\x18\x04 \x01(\tR\x06region\x12\x12\n" + + "\x04port\x18\x05 \x01(\rR\x04port\x12\x1a\n" + + "\bendpoint\x18\x06 \x01(\tR\bendpoint\x12/\n" + + "\x13connection_endpoint\x18\a \x01(\tR\x12connectionEndpoint\x126\n" + + "\x03aws\x18\x03 \x01(\v2\x1e.livekit.PrivateLink.AWSConfigB\x02\x18\x01H\x00R\x03aws\x1a+\n" + + "\tAWSConfig\x12\x1e\n" + + "\bendpoint\x18\x01 \x01(\tB\x02\x18\x01R\bendpointB\b\n" + + "\x06config\"\x83\x03\n" + + "\x11PrivateLinkStatus\x129\n" + + "\x06status\x18\x01 \x01(\x0e2!.livekit.PrivateLinkStatus.StatusR\x06status\x129\n" + + "\n" + + "updated_at\x18\x02 \x01(\v2\x1a.google.protobuf.TimestampR\tupdatedAt\x12\x16\n" + + "\x06reason\x18\x03 \x01(\tR\x06reason\"\xdf\x01\n" + + "\x06Status\x12\x1f\n" + + "\x1bPRIVATE_LINK_STATUS_UNKNOWN\x10\x00\x12$\n" + + " PRIVATE_LINK_STATUS_PROVISIONING\x10\x01\x12(\n" + + "$PRIVATE_LINK_STATUS_PENDING_APPROVAL\x10\x02\x12\x1f\n" + + "\x1bPRIVATE_LINK_STATUS_HEALTHY\x10\x03\x12!\n" + + "\x1dPRIVATE_LINK_STATUS_UNHEALTHY\x10\x04\x12 \n" + + "\x1cPRIVATE_LINK_STATUS_APPROVED\x10\x05\"\xb7\x02\n" + + "\x18CreatePrivateLinkRequest\x12\x12\n" + + "\x04name\x18\x01 \x01(\tR\x04name\x12\x16\n" + + "\x06region\x18\x03 \x01(\tR\x06region\x12\x12\n" + + "\x04port\x18\x04 \x01(\rR\x04port\x12\x1a\n" + + "\bendpoint\x18\x05 \x01(\tR\bendpoint\x12&\n" + + "\fcloud_region\x18\x06 \x01(\tH\x01R\vcloudRegion\x88\x01\x01\x12I\n" + + "\x03aws\x18\x02 \x01(\v21.livekit.CreatePrivateLinkRequest.AWSCreateConfigB\x02\x18\x01H\x00R\x03aws\x1a1\n" + + "\x0fAWSCreateConfig\x12\x1e\n" + + "\bendpoint\x18\x01 \x01(\tB\x02\x18\x01R\bendpointB\b\n" + + "\x06configB\x0f\n" + + "\r_cloud_region\"T\n" + + "\x19CreatePrivateLinkResponse\x127\n" + + "\fprivate_link\x18\x01 \x01(\v2\x14.livekit.PrivateLinkR\vprivateLink\"U\n" + + "\x19DestroyPrivateLinkRequest\x128\n" + + "\x0fprivate_link_id\x18\x01 \x01(\tB\x10\xbaP\rprivateLinkIDR\rprivateLinkId\"\x1c\n" + + "\x1aDestroyPrivateLinkResponse\"\x19\n" + + "\x17ListPrivateLinksRequest\"F\n" + + "\x18ListPrivateLinksResponse\x12*\n" + + "\x05items\x18\x01 \x03(\v2\x14.livekit.PrivateLinkR\x05items\"W\n" + + "\x1bGetPrivateLinkStatusRequest\x128\n" + + "\x0fprivate_link_id\x18\x01 \x01(\tB\x10\xbaP\rprivateLinkIDR\rprivateLinkId\"P\n" + + "\x1cGetPrivateLinkStatusResponse\x120\n" + + "\x05value\x18\x01 \x01(\v2\x1a.livekit.PrivateLinkStatusR\x05value*o\n" + + "\x0fAgentSecretKind\x12\x1d\n" + + "\x19AGENT_SECRET_KIND_UNKNOWN\x10\x00\x12!\n" + + "\x1dAGENT_SECRET_KIND_ENVIRONMENT\x10\x01\x12\x1a\n" + + "\x16AGENT_SECRET_KIND_FILE\x10\x02*\xba\x01\n" + + "\x0eAgentEventType\x12\x1c\n" + + "\x18AGENT_EVENT_TYPE_UNKNOWN\x10\x00\x12(\n" + + "$AGENT_EVENT_TYPE_APPLICATION_CRASHED\x10\x01\x12.\n" + + "*AGENT_EVENT_TYPE_RESTARTED_HIGH_DISK_USAGE\x10\x02\x120\n" + + ",AGENT_EVENT_TYPE_RESTARTED_HIGH_MEMORY_USAGE\x10\x032\xbd\v\n" + + "\n" + + "CloudAgent\x12J\n" + + "\vCreateAgent\x12\x1b.livekit.CreateAgentRequest\x1a\x1c.livekit.CreateAgentResponse\"\x00\x12P\n" + + "\rCreateAgentV2\x12\x1d.livekit.CreateAgentV2Request\x1a\x1e.livekit.CreateAgentV2Response\"\x00\x12G\n" + + "\n" + + "ListAgents\x12\x1a.livekit.ListAgentsRequest\x1a\x1b.livekit.ListAgentsResponse\"\x00\x12\\\n" + + "\x11ListAgentVersions\x12!.livekit.ListAgentVersionsRequest\x1a\".livekit.ListAgentVersionsResponse\"\x00\x12Y\n" + + "\x10ListAgentSecrets\x12 .livekit.ListAgentSecretsRequest\x1a!.livekit.ListAgentSecretsResponse\"\x00\x12J\n" + + "\vUpdateAgent\x12\x1b.livekit.UpdateAgentRequest\x1a\x1c.livekit.UpdateAgentResponse\"\x00\x12M\n" + + "\fRestartAgent\x12\x1c.livekit.RestartAgentRequest\x1a\x1d.livekit.RestartAgentResponse\"\x00\x12J\n" + + "\vDeployAgent\x12\x1b.livekit.DeployAgentRequest\x1a\x1c.livekit.DeployAgentResponse\"\x00\x12P\n" + + "\rDeployAgentV2\x12\x1d.livekit.DeployAgentV2Request\x1a\x1e.livekit.DeployAgentV2Response\"\x00\x12_\n" + + "\x12UpdateAgentSecrets\x12\".livekit.UpdateAgentSecretsRequest\x1a#.livekit.UpdateAgentSecretsResponse\"\x00\x12P\n" + + "\rRollbackAgent\x12\x1d.livekit.RollbackAgentRequest\x1a\x1e.livekit.RollbackAgentResponse\"\x00\x12J\n" + + "\vDeleteAgent\x12\x1b.livekit.DeleteAgentRequest\x1a\x1c.livekit.DeleteAgentResponse\"\x00\x12V\n" + + "\x11GetClientSettings\x12\x1e.livekit.ClientSettingsRequest\x1a\x1f.livekit.ClientSettingsResponse\"\x00\x12\\\n" + + "\x11CreatePrivateLink\x12!.livekit.CreatePrivateLinkRequest\x1a\".livekit.CreatePrivateLinkResponse\"\x00\x12_\n" + + "\x12DestroyPrivateLink\x12\".livekit.DestroyPrivateLinkRequest\x1a#.livekit.DestroyPrivateLinkResponse\"\x00\x12Y\n" + + "\x10ListPrivateLinks\x12 .livekit.ListPrivateLinksRequest\x1a!.livekit.ListPrivateLinksResponse\"\x00\x12e\n" + + "\x14GetPrivateLinkStatus\x12$.livekit.GetPrivateLinkStatusRequest\x1a%.livekit.GetPrivateLinkStatusResponse\"\x00BFZ#github.com/livekit/protocol/livekit\xaa\x02\rLiveKit.Proto\xea\x02\x0eLiveKit::Protob\x06proto3" + +var ( + file_livekit_cloud_agent_proto_rawDescOnce sync.Once + file_livekit_cloud_agent_proto_rawDescData []byte +) + +func file_livekit_cloud_agent_proto_rawDescGZIP() []byte { + file_livekit_cloud_agent_proto_rawDescOnce.Do(func() { + file_livekit_cloud_agent_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_livekit_cloud_agent_proto_rawDesc), len(file_livekit_cloud_agent_proto_rawDesc))) + }) + return file_livekit_cloud_agent_proto_rawDescData +} + +var file_livekit_cloud_agent_proto_enumTypes = make([]protoimpl.EnumInfo, 3) +var file_livekit_cloud_agent_proto_msgTypes = make([]protoimpl.MessageInfo, 47) +var file_livekit_cloud_agent_proto_goTypes = []any{ + (AgentSecretKind)(0), // 0: livekit.AgentSecretKind + (AgentEventType)(0), // 1: livekit.AgentEventType + (PrivateLinkStatus_Status)(0), // 2: livekit.PrivateLinkStatus.Status + (*AgentEvent)(nil), // 3: livekit.AgentEvent + (*AgentSecret)(nil), // 4: livekit.AgentSecret + (*CreateAgentRequest)(nil), // 5: livekit.CreateAgentRequest + (*CreateAgentResponse)(nil), // 6: livekit.CreateAgentResponse + (*CreateAgentV2Request)(nil), // 7: livekit.CreateAgentV2Request + (*CreateAgentV2Response)(nil), // 8: livekit.CreateAgentV2Response + (*PresignedPostRequest)(nil), // 9: livekit.PresignedPostRequest + (*AgentDeployment)(nil), // 10: livekit.AgentDeployment + (*AgentInfo)(nil), // 11: livekit.AgentInfo + (*ListAgentsRequest)(nil), // 12: livekit.ListAgentsRequest + (*ListAgentsResponse)(nil), // 13: livekit.ListAgentsResponse + (*AgentVersion)(nil), // 14: livekit.AgentVersion + (*ListAgentVersionsRequest)(nil), // 15: livekit.ListAgentVersionsRequest + (*ListAgentVersionsResponse)(nil), // 16: livekit.ListAgentVersionsResponse + (*UpdateAgentRequest)(nil), // 17: livekit.UpdateAgentRequest + (*UpdateAgentResponse)(nil), // 18: livekit.UpdateAgentResponse + (*RestartAgentRequest)(nil), // 19: livekit.RestartAgentRequest + (*RestartAgentResponse)(nil), // 20: livekit.RestartAgentResponse + (*DeployAgentRequest)(nil), // 21: livekit.DeployAgentRequest + (*DeployAgentResponse)(nil), // 22: livekit.DeployAgentResponse + (*DeployAgentV2Request)(nil), // 23: livekit.DeployAgentV2Request + (*DeployAgentV2Response)(nil), // 24: livekit.DeployAgentV2Response + (*UpdateAgentSecretsRequest)(nil), // 25: livekit.UpdateAgentSecretsRequest + (*UpdateAgentSecretsResponse)(nil), // 26: livekit.UpdateAgentSecretsResponse + (*RollbackAgentRequest)(nil), // 27: livekit.RollbackAgentRequest + (*RollbackAgentResponse)(nil), // 28: livekit.RollbackAgentResponse + (*DeleteAgentRequest)(nil), // 29: livekit.DeleteAgentRequest + (*DeleteAgentResponse)(nil), // 30: livekit.DeleteAgentResponse + (*ListAgentSecretsRequest)(nil), // 31: livekit.ListAgentSecretsRequest + (*ListAgentSecretsResponse)(nil), // 32: livekit.ListAgentSecretsResponse + (*SettingsParam)(nil), // 33: livekit.SettingsParam + (*ClientSettingsResponse)(nil), // 34: livekit.ClientSettingsResponse + (*ClientSettingsRequest)(nil), // 35: livekit.ClientSettingsRequest + (*PrivateLink)(nil), // 36: livekit.PrivateLink + (*PrivateLinkStatus)(nil), // 37: livekit.PrivateLinkStatus + (*CreatePrivateLinkRequest)(nil), // 38: livekit.CreatePrivateLinkRequest + (*CreatePrivateLinkResponse)(nil), // 39: livekit.CreatePrivateLinkResponse + (*DestroyPrivateLinkRequest)(nil), // 40: livekit.DestroyPrivateLinkRequest + (*DestroyPrivateLinkResponse)(nil), // 41: livekit.DestroyPrivateLinkResponse + (*ListPrivateLinksRequest)(nil), // 42: livekit.ListPrivateLinksRequest + (*ListPrivateLinksResponse)(nil), // 43: livekit.ListPrivateLinksResponse + (*GetPrivateLinkStatusRequest)(nil), // 44: livekit.GetPrivateLinkStatusRequest + (*GetPrivateLinkStatusResponse)(nil), // 45: livekit.GetPrivateLinkStatusResponse + nil, // 46: livekit.PresignedPostRequest.ValuesEntry + nil, // 47: livekit.AgentVersion.AttributesEntry + (*PrivateLink_AWSConfig)(nil), // 48: livekit.PrivateLink.AWSConfig + (*CreatePrivateLinkRequest_AWSCreateConfig)(nil), // 49: livekit.CreatePrivateLinkRequest.AWSCreateConfig + (*timestamppb.Timestamp)(nil), // 50: google.protobuf.Timestamp +} +var file_livekit_cloud_agent_proto_depIdxs = []int32{ + 1, // 0: livekit.AgentEvent.type:type_name -> livekit.AgentEventType + 50, // 1: livekit.AgentEvent.timestamp:type_name -> google.protobuf.Timestamp + 50, // 2: livekit.AgentSecret.created_at:type_name -> google.protobuf.Timestamp + 50, // 3: livekit.AgentSecret.updated_at:type_name -> google.protobuf.Timestamp + 0, // 4: livekit.AgentSecret.kind:type_name -> livekit.AgentSecretKind + 4, // 5: livekit.CreateAgentRequest.secrets:type_name -> livekit.AgentSecret + 9, // 6: livekit.CreateAgentResponse.presigned_post_request:type_name -> livekit.PresignedPostRequest + 4, // 7: livekit.CreateAgentV2Request.secrets:type_name -> livekit.AgentSecret + 46, // 8: livekit.PresignedPostRequest.values:type_name -> livekit.PresignedPostRequest.ValuesEntry + 3, // 9: livekit.AgentDeployment.events:type_name -> livekit.AgentEvent + 10, // 10: livekit.AgentInfo.agent_deployments:type_name -> livekit.AgentDeployment + 4, // 11: livekit.AgentInfo.secrets:type_name -> livekit.AgentSecret + 50, // 12: livekit.AgentInfo.deployed_at:type_name -> google.protobuf.Timestamp + 11, // 13: livekit.ListAgentsResponse.agents:type_name -> livekit.AgentInfo + 50, // 14: livekit.AgentVersion.created_at:type_name -> google.protobuf.Timestamp + 50, // 15: livekit.AgentVersion.deployed_at:type_name -> google.protobuf.Timestamp + 47, // 16: livekit.AgentVersion.attributes:type_name -> livekit.AgentVersion.AttributesEntry + 14, // 17: livekit.ListAgentVersionsResponse.versions:type_name -> livekit.AgentVersion + 4, // 18: livekit.UpdateAgentRequest.secrets:type_name -> livekit.AgentSecret + 4, // 19: livekit.DeployAgentRequest.secrets:type_name -> livekit.AgentSecret + 9, // 20: livekit.DeployAgentResponse.presigned_post_request:type_name -> livekit.PresignedPostRequest + 4, // 21: livekit.DeployAgentV2Request.secrets:type_name -> livekit.AgentSecret + 9, // 22: livekit.DeployAgentV2Response.presigned_req:type_name -> livekit.PresignedPostRequest + 4, // 23: livekit.UpdateAgentSecretsRequest.secrets:type_name -> livekit.AgentSecret + 4, // 24: livekit.ListAgentSecretsResponse.secrets:type_name -> livekit.AgentSecret + 33, // 25: livekit.ClientSettingsResponse.params:type_name -> livekit.SettingsParam + 48, // 26: livekit.PrivateLink.aws:type_name -> livekit.PrivateLink.AWSConfig + 2, // 27: livekit.PrivateLinkStatus.status:type_name -> livekit.PrivateLinkStatus.Status + 50, // 28: livekit.PrivateLinkStatus.updated_at:type_name -> google.protobuf.Timestamp + 49, // 29: livekit.CreatePrivateLinkRequest.aws:type_name -> livekit.CreatePrivateLinkRequest.AWSCreateConfig + 36, // 30: livekit.CreatePrivateLinkResponse.private_link:type_name -> livekit.PrivateLink + 36, // 31: livekit.ListPrivateLinksResponse.items:type_name -> livekit.PrivateLink + 37, // 32: livekit.GetPrivateLinkStatusResponse.value:type_name -> livekit.PrivateLinkStatus + 5, // 33: livekit.CloudAgent.CreateAgent:input_type -> livekit.CreateAgentRequest + 7, // 34: livekit.CloudAgent.CreateAgentV2:input_type -> livekit.CreateAgentV2Request + 12, // 35: livekit.CloudAgent.ListAgents:input_type -> livekit.ListAgentsRequest + 15, // 36: livekit.CloudAgent.ListAgentVersions:input_type -> livekit.ListAgentVersionsRequest + 31, // 37: livekit.CloudAgent.ListAgentSecrets:input_type -> livekit.ListAgentSecretsRequest + 17, // 38: livekit.CloudAgent.UpdateAgent:input_type -> livekit.UpdateAgentRequest + 19, // 39: livekit.CloudAgent.RestartAgent:input_type -> livekit.RestartAgentRequest + 21, // 40: livekit.CloudAgent.DeployAgent:input_type -> livekit.DeployAgentRequest + 23, // 41: livekit.CloudAgent.DeployAgentV2:input_type -> livekit.DeployAgentV2Request + 25, // 42: livekit.CloudAgent.UpdateAgentSecrets:input_type -> livekit.UpdateAgentSecretsRequest + 27, // 43: livekit.CloudAgent.RollbackAgent:input_type -> livekit.RollbackAgentRequest + 29, // 44: livekit.CloudAgent.DeleteAgent:input_type -> livekit.DeleteAgentRequest + 35, // 45: livekit.CloudAgent.GetClientSettings:input_type -> livekit.ClientSettingsRequest + 38, // 46: livekit.CloudAgent.CreatePrivateLink:input_type -> livekit.CreatePrivateLinkRequest + 40, // 47: livekit.CloudAgent.DestroyPrivateLink:input_type -> livekit.DestroyPrivateLinkRequest + 42, // 48: livekit.CloudAgent.ListPrivateLinks:input_type -> livekit.ListPrivateLinksRequest + 44, // 49: livekit.CloudAgent.GetPrivateLinkStatus:input_type -> livekit.GetPrivateLinkStatusRequest + 6, // 50: livekit.CloudAgent.CreateAgent:output_type -> livekit.CreateAgentResponse + 8, // 51: livekit.CloudAgent.CreateAgentV2:output_type -> livekit.CreateAgentV2Response + 13, // 52: livekit.CloudAgent.ListAgents:output_type -> livekit.ListAgentsResponse + 16, // 53: livekit.CloudAgent.ListAgentVersions:output_type -> livekit.ListAgentVersionsResponse + 32, // 54: livekit.CloudAgent.ListAgentSecrets:output_type -> livekit.ListAgentSecretsResponse + 18, // 55: livekit.CloudAgent.UpdateAgent:output_type -> livekit.UpdateAgentResponse + 20, // 56: livekit.CloudAgent.RestartAgent:output_type -> livekit.RestartAgentResponse + 22, // 57: livekit.CloudAgent.DeployAgent:output_type -> livekit.DeployAgentResponse + 24, // 58: livekit.CloudAgent.DeployAgentV2:output_type -> livekit.DeployAgentV2Response + 26, // 59: livekit.CloudAgent.UpdateAgentSecrets:output_type -> livekit.UpdateAgentSecretsResponse + 28, // 60: livekit.CloudAgent.RollbackAgent:output_type -> livekit.RollbackAgentResponse + 30, // 61: livekit.CloudAgent.DeleteAgent:output_type -> livekit.DeleteAgentResponse + 34, // 62: livekit.CloudAgent.GetClientSettings:output_type -> livekit.ClientSettingsResponse + 39, // 63: livekit.CloudAgent.CreatePrivateLink:output_type -> livekit.CreatePrivateLinkResponse + 41, // 64: livekit.CloudAgent.DestroyPrivateLink:output_type -> livekit.DestroyPrivateLinkResponse + 43, // 65: livekit.CloudAgent.ListPrivateLinks:output_type -> livekit.ListPrivateLinksResponse + 45, // 66: livekit.CloudAgent.GetPrivateLinkStatus:output_type -> livekit.GetPrivateLinkStatusResponse + 50, // [50:67] is the sub-list for method output_type + 33, // [33:50] is the sub-list for method input_type + 33, // [33:33] is the sub-list for extension type_name + 33, // [33:33] is the sub-list for extension extendee + 0, // [0:33] is the sub-list for field type_name +} + +func init() { file_livekit_cloud_agent_proto_init() } +func file_livekit_cloud_agent_proto_init() { + if File_livekit_cloud_agent_proto != nil { + return + } + file_livekit_cloud_agent_proto_msgTypes[33].OneofWrappers = []any{ + (*PrivateLink_Aws)(nil), + } + file_livekit_cloud_agent_proto_msgTypes[35].OneofWrappers = []any{ + (*CreatePrivateLinkRequest_Aws)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_livekit_cloud_agent_proto_rawDesc), len(file_livekit_cloud_agent_proto_rawDesc)), + NumEnums: 3, + NumMessages: 47, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_livekit_cloud_agent_proto_goTypes, + DependencyIndexes: file_livekit_cloud_agent_proto_depIdxs, + EnumInfos: file_livekit_cloud_agent_proto_enumTypes, + MessageInfos: file_livekit_cloud_agent_proto_msgTypes, + }.Build() + File_livekit_cloud_agent_proto = out.File + file_livekit_cloud_agent_proto_goTypes = nil + file_livekit_cloud_agent_proto_depIdxs = nil +} diff --git a/livekit/livekit_cloud_agent.twirp.go b/livekit/livekit_cloud_agent.twirp.go new file mode 100644 index 000000000..8d6a99a48 --- /dev/null +++ b/livekit/livekit_cloud_agent.twirp.go @@ -0,0 +1,5136 @@ +// Code generated by protoc-gen-twirp v8.1.3, DO NOT EDIT. +// source: livekit_cloud_agent.proto + +package livekit + +import context "context" +import fmt "fmt" +import http "net/http" +import io "io" +import json "encoding/json" +import strconv "strconv" +import strings "strings" + +import protojson "google.golang.org/protobuf/encoding/protojson" +import proto "google.golang.org/protobuf/proto" +import twirp "github.com/twitchtv/twirp" +import ctxsetters "github.com/twitchtv/twirp/ctxsetters" + +// Version compatibility assertion. +// If the constant is not defined in the package, that likely means +// the package needs to be updated to work with this generated code. +// See https://twitchtv.github.io/twirp/docs/version_matrix.html +const _ = twirp.TwirpPackageMinVersion_8_1_0 + +// ==================== +// CloudAgent Interface +// ==================== + +type CloudAgent interface { + CreateAgent(context.Context, *CreateAgentRequest) (*CreateAgentResponse, error) + + CreateAgentV2(context.Context, *CreateAgentV2Request) (*CreateAgentV2Response, error) + + ListAgents(context.Context, *ListAgentsRequest) (*ListAgentsResponse, error) + + ListAgentVersions(context.Context, *ListAgentVersionsRequest) (*ListAgentVersionsResponse, error) + + ListAgentSecrets(context.Context, *ListAgentSecretsRequest) (*ListAgentSecretsResponse, error) + + UpdateAgent(context.Context, *UpdateAgentRequest) (*UpdateAgentResponse, error) + + RestartAgent(context.Context, *RestartAgentRequest) (*RestartAgentResponse, error) + + DeployAgent(context.Context, *DeployAgentRequest) (*DeployAgentResponse, error) + + DeployAgentV2(context.Context, *DeployAgentV2Request) (*DeployAgentV2Response, error) + + UpdateAgentSecrets(context.Context, *UpdateAgentSecretsRequest) (*UpdateAgentSecretsResponse, error) + + RollbackAgent(context.Context, *RollbackAgentRequest) (*RollbackAgentResponse, error) + + DeleteAgent(context.Context, *DeleteAgentRequest) (*DeleteAgentResponse, error) + + GetClientSettings(context.Context, *ClientSettingsRequest) (*ClientSettingsResponse, error) + + CreatePrivateLink(context.Context, *CreatePrivateLinkRequest) (*CreatePrivateLinkResponse, error) + + DestroyPrivateLink(context.Context, *DestroyPrivateLinkRequest) (*DestroyPrivateLinkResponse, error) + + ListPrivateLinks(context.Context, *ListPrivateLinksRequest) (*ListPrivateLinksResponse, error) + + GetPrivateLinkStatus(context.Context, *GetPrivateLinkStatusRequest) (*GetPrivateLinkStatusResponse, error) +} + +// ========================== +// CloudAgent Protobuf Client +// ========================== + +type cloudAgentProtobufClient struct { + client HTTPClient + urls [17]string + interceptor twirp.Interceptor + opts twirp.ClientOptions +} + +// NewCloudAgentProtobufClient creates a Protobuf client that implements the CloudAgent interface. +// It communicates using Protobuf and can be configured with a custom HTTPClient. +func NewCloudAgentProtobufClient(baseURL string, client HTTPClient, opts ...twirp.ClientOption) CloudAgent { + if c, ok := client.(*http.Client); ok { + client = withoutRedirects(c) + } + + clientOpts := twirp.ClientOptions{} + for _, o := range opts { + o(&clientOpts) + } + + // Using ReadOpt allows backwards and forwards compatibility with new options in the future + literalURLs := false + _ = clientOpts.ReadOpt("literalURLs", &literalURLs) + var pathPrefix string + if ok := clientOpts.ReadOpt("pathPrefix", &pathPrefix); !ok { + pathPrefix = "/twirp" // default prefix + } + + // Build method URLs: []/./ + serviceURL := sanitizeBaseURL(baseURL) + serviceURL += baseServicePath(pathPrefix, "livekit", "CloudAgent") + urls := [17]string{ + serviceURL + "CreateAgent", + serviceURL + "CreateAgentV2", + serviceURL + "ListAgents", + serviceURL + "ListAgentVersions", + serviceURL + "ListAgentSecrets", + serviceURL + "UpdateAgent", + serviceURL + "RestartAgent", + serviceURL + "DeployAgent", + serviceURL + "DeployAgentV2", + serviceURL + "UpdateAgentSecrets", + serviceURL + "RollbackAgent", + serviceURL + "DeleteAgent", + serviceURL + "GetClientSettings", + serviceURL + "CreatePrivateLink", + serviceURL + "DestroyPrivateLink", + serviceURL + "ListPrivateLinks", + serviceURL + "GetPrivateLinkStatus", + } + + return &cloudAgentProtobufClient{ + client: client, + urls: urls, + interceptor: twirp.ChainInterceptors(clientOpts.Interceptors...), + opts: clientOpts, + } +} + +func (c *cloudAgentProtobufClient) CreateAgent(ctx context.Context, in *CreateAgentRequest) (*CreateAgentResponse, error) { + ctx = ctxsetters.WithPackageName(ctx, "livekit") + ctx = ctxsetters.WithServiceName(ctx, "CloudAgent") + ctx = ctxsetters.WithMethodName(ctx, "CreateAgent") + caller := c.callCreateAgent + if c.interceptor != nil { + caller = func(ctx context.Context, req *CreateAgentRequest) (*CreateAgentResponse, error) { + resp, err := c.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*CreateAgentRequest) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*CreateAgentRequest) when calling interceptor") + } + return c.callCreateAgent(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*CreateAgentResponse) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*CreateAgentResponse) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + return caller(ctx, in) +} + +func (c *cloudAgentProtobufClient) callCreateAgent(ctx context.Context, in *CreateAgentRequest) (*CreateAgentResponse, error) { + out := new(CreateAgentResponse) + ctx, err := doProtobufRequest(ctx, c.client, c.opts.Hooks, c.urls[0], in, out) + if err != nil { + twerr, ok := err.(twirp.Error) + if !ok { + twerr = twirp.InternalErrorWith(err) + } + callClientError(ctx, c.opts.Hooks, twerr) + return nil, err + } + + callClientResponseReceived(ctx, c.opts.Hooks) + + return out, nil +} + +func (c *cloudAgentProtobufClient) CreateAgentV2(ctx context.Context, in *CreateAgentV2Request) (*CreateAgentV2Response, error) { + ctx = ctxsetters.WithPackageName(ctx, "livekit") + ctx = ctxsetters.WithServiceName(ctx, "CloudAgent") + ctx = ctxsetters.WithMethodName(ctx, "CreateAgentV2") + caller := c.callCreateAgentV2 + if c.interceptor != nil { + caller = func(ctx context.Context, req *CreateAgentV2Request) (*CreateAgentV2Response, error) { + resp, err := c.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*CreateAgentV2Request) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*CreateAgentV2Request) when calling interceptor") + } + return c.callCreateAgentV2(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*CreateAgentV2Response) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*CreateAgentV2Response) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + return caller(ctx, in) +} + +func (c *cloudAgentProtobufClient) callCreateAgentV2(ctx context.Context, in *CreateAgentV2Request) (*CreateAgentV2Response, error) { + out := new(CreateAgentV2Response) + ctx, err := doProtobufRequest(ctx, c.client, c.opts.Hooks, c.urls[1], in, out) + if err != nil { + twerr, ok := err.(twirp.Error) + if !ok { + twerr = twirp.InternalErrorWith(err) + } + callClientError(ctx, c.opts.Hooks, twerr) + return nil, err + } + + callClientResponseReceived(ctx, c.opts.Hooks) + + return out, nil +} + +func (c *cloudAgentProtobufClient) ListAgents(ctx context.Context, in *ListAgentsRequest) (*ListAgentsResponse, error) { + ctx = ctxsetters.WithPackageName(ctx, "livekit") + ctx = ctxsetters.WithServiceName(ctx, "CloudAgent") + ctx = ctxsetters.WithMethodName(ctx, "ListAgents") + caller := c.callListAgents + if c.interceptor != nil { + caller = func(ctx context.Context, req *ListAgentsRequest) (*ListAgentsResponse, error) { + resp, err := c.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*ListAgentsRequest) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*ListAgentsRequest) when calling interceptor") + } + return c.callListAgents(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*ListAgentsResponse) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*ListAgentsResponse) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + return caller(ctx, in) +} + +func (c *cloudAgentProtobufClient) callListAgents(ctx context.Context, in *ListAgentsRequest) (*ListAgentsResponse, error) { + out := new(ListAgentsResponse) + ctx, err := doProtobufRequest(ctx, c.client, c.opts.Hooks, c.urls[2], in, out) + if err != nil { + twerr, ok := err.(twirp.Error) + if !ok { + twerr = twirp.InternalErrorWith(err) + } + callClientError(ctx, c.opts.Hooks, twerr) + return nil, err + } + + callClientResponseReceived(ctx, c.opts.Hooks) + + return out, nil +} + +func (c *cloudAgentProtobufClient) ListAgentVersions(ctx context.Context, in *ListAgentVersionsRequest) (*ListAgentVersionsResponse, error) { + ctx = ctxsetters.WithPackageName(ctx, "livekit") + ctx = ctxsetters.WithServiceName(ctx, "CloudAgent") + ctx = ctxsetters.WithMethodName(ctx, "ListAgentVersions") + caller := c.callListAgentVersions + if c.interceptor != nil { + caller = func(ctx context.Context, req *ListAgentVersionsRequest) (*ListAgentVersionsResponse, error) { + resp, err := c.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*ListAgentVersionsRequest) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*ListAgentVersionsRequest) when calling interceptor") + } + return c.callListAgentVersions(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*ListAgentVersionsResponse) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*ListAgentVersionsResponse) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + return caller(ctx, in) +} + +func (c *cloudAgentProtobufClient) callListAgentVersions(ctx context.Context, in *ListAgentVersionsRequest) (*ListAgentVersionsResponse, error) { + out := new(ListAgentVersionsResponse) + ctx, err := doProtobufRequest(ctx, c.client, c.opts.Hooks, c.urls[3], in, out) + if err != nil { + twerr, ok := err.(twirp.Error) + if !ok { + twerr = twirp.InternalErrorWith(err) + } + callClientError(ctx, c.opts.Hooks, twerr) + return nil, err + } + + callClientResponseReceived(ctx, c.opts.Hooks) + + return out, nil +} + +func (c *cloudAgentProtobufClient) ListAgentSecrets(ctx context.Context, in *ListAgentSecretsRequest) (*ListAgentSecretsResponse, error) { + ctx = ctxsetters.WithPackageName(ctx, "livekit") + ctx = ctxsetters.WithServiceName(ctx, "CloudAgent") + ctx = ctxsetters.WithMethodName(ctx, "ListAgentSecrets") + caller := c.callListAgentSecrets + if c.interceptor != nil { + caller = func(ctx context.Context, req *ListAgentSecretsRequest) (*ListAgentSecretsResponse, error) { + resp, err := c.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*ListAgentSecretsRequest) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*ListAgentSecretsRequest) when calling interceptor") + } + return c.callListAgentSecrets(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*ListAgentSecretsResponse) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*ListAgentSecretsResponse) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + return caller(ctx, in) +} + +func (c *cloudAgentProtobufClient) callListAgentSecrets(ctx context.Context, in *ListAgentSecretsRequest) (*ListAgentSecretsResponse, error) { + out := new(ListAgentSecretsResponse) + ctx, err := doProtobufRequest(ctx, c.client, c.opts.Hooks, c.urls[4], in, out) + if err != nil { + twerr, ok := err.(twirp.Error) + if !ok { + twerr = twirp.InternalErrorWith(err) + } + callClientError(ctx, c.opts.Hooks, twerr) + return nil, err + } + + callClientResponseReceived(ctx, c.opts.Hooks) + + return out, nil +} + +func (c *cloudAgentProtobufClient) UpdateAgent(ctx context.Context, in *UpdateAgentRequest) (*UpdateAgentResponse, error) { + ctx = ctxsetters.WithPackageName(ctx, "livekit") + ctx = ctxsetters.WithServiceName(ctx, "CloudAgent") + ctx = ctxsetters.WithMethodName(ctx, "UpdateAgent") + caller := c.callUpdateAgent + if c.interceptor != nil { + caller = func(ctx context.Context, req *UpdateAgentRequest) (*UpdateAgentResponse, error) { + resp, err := c.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*UpdateAgentRequest) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*UpdateAgentRequest) when calling interceptor") + } + return c.callUpdateAgent(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*UpdateAgentResponse) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*UpdateAgentResponse) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + return caller(ctx, in) +} + +func (c *cloudAgentProtobufClient) callUpdateAgent(ctx context.Context, in *UpdateAgentRequest) (*UpdateAgentResponse, error) { + out := new(UpdateAgentResponse) + ctx, err := doProtobufRequest(ctx, c.client, c.opts.Hooks, c.urls[5], in, out) + if err != nil { + twerr, ok := err.(twirp.Error) + if !ok { + twerr = twirp.InternalErrorWith(err) + } + callClientError(ctx, c.opts.Hooks, twerr) + return nil, err + } + + callClientResponseReceived(ctx, c.opts.Hooks) + + return out, nil +} + +func (c *cloudAgentProtobufClient) RestartAgent(ctx context.Context, in *RestartAgentRequest) (*RestartAgentResponse, error) { + ctx = ctxsetters.WithPackageName(ctx, "livekit") + ctx = ctxsetters.WithServiceName(ctx, "CloudAgent") + ctx = ctxsetters.WithMethodName(ctx, "RestartAgent") + caller := c.callRestartAgent + if c.interceptor != nil { + caller = func(ctx context.Context, req *RestartAgentRequest) (*RestartAgentResponse, error) { + resp, err := c.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*RestartAgentRequest) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*RestartAgentRequest) when calling interceptor") + } + return c.callRestartAgent(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*RestartAgentResponse) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*RestartAgentResponse) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + return caller(ctx, in) +} + +func (c *cloudAgentProtobufClient) callRestartAgent(ctx context.Context, in *RestartAgentRequest) (*RestartAgentResponse, error) { + out := new(RestartAgentResponse) + ctx, err := doProtobufRequest(ctx, c.client, c.opts.Hooks, c.urls[6], in, out) + if err != nil { + twerr, ok := err.(twirp.Error) + if !ok { + twerr = twirp.InternalErrorWith(err) + } + callClientError(ctx, c.opts.Hooks, twerr) + return nil, err + } + + callClientResponseReceived(ctx, c.opts.Hooks) + + return out, nil +} + +func (c *cloudAgentProtobufClient) DeployAgent(ctx context.Context, in *DeployAgentRequest) (*DeployAgentResponse, error) { + ctx = ctxsetters.WithPackageName(ctx, "livekit") + ctx = ctxsetters.WithServiceName(ctx, "CloudAgent") + ctx = ctxsetters.WithMethodName(ctx, "DeployAgent") + caller := c.callDeployAgent + if c.interceptor != nil { + caller = func(ctx context.Context, req *DeployAgentRequest) (*DeployAgentResponse, error) { + resp, err := c.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*DeployAgentRequest) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*DeployAgentRequest) when calling interceptor") + } + return c.callDeployAgent(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*DeployAgentResponse) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*DeployAgentResponse) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + return caller(ctx, in) +} + +func (c *cloudAgentProtobufClient) callDeployAgent(ctx context.Context, in *DeployAgentRequest) (*DeployAgentResponse, error) { + out := new(DeployAgentResponse) + ctx, err := doProtobufRequest(ctx, c.client, c.opts.Hooks, c.urls[7], in, out) + if err != nil { + twerr, ok := err.(twirp.Error) + if !ok { + twerr = twirp.InternalErrorWith(err) + } + callClientError(ctx, c.opts.Hooks, twerr) + return nil, err + } + + callClientResponseReceived(ctx, c.opts.Hooks) + + return out, nil +} + +func (c *cloudAgentProtobufClient) DeployAgentV2(ctx context.Context, in *DeployAgentV2Request) (*DeployAgentV2Response, error) { + ctx = ctxsetters.WithPackageName(ctx, "livekit") + ctx = ctxsetters.WithServiceName(ctx, "CloudAgent") + ctx = ctxsetters.WithMethodName(ctx, "DeployAgentV2") + caller := c.callDeployAgentV2 + if c.interceptor != nil { + caller = func(ctx context.Context, req *DeployAgentV2Request) (*DeployAgentV2Response, error) { + resp, err := c.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*DeployAgentV2Request) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*DeployAgentV2Request) when calling interceptor") + } + return c.callDeployAgentV2(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*DeployAgentV2Response) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*DeployAgentV2Response) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + return caller(ctx, in) +} + +func (c *cloudAgentProtobufClient) callDeployAgentV2(ctx context.Context, in *DeployAgentV2Request) (*DeployAgentV2Response, error) { + out := new(DeployAgentV2Response) + ctx, err := doProtobufRequest(ctx, c.client, c.opts.Hooks, c.urls[8], in, out) + if err != nil { + twerr, ok := err.(twirp.Error) + if !ok { + twerr = twirp.InternalErrorWith(err) + } + callClientError(ctx, c.opts.Hooks, twerr) + return nil, err + } + + callClientResponseReceived(ctx, c.opts.Hooks) + + return out, nil +} + +func (c *cloudAgentProtobufClient) UpdateAgentSecrets(ctx context.Context, in *UpdateAgentSecretsRequest) (*UpdateAgentSecretsResponse, error) { + ctx = ctxsetters.WithPackageName(ctx, "livekit") + ctx = ctxsetters.WithServiceName(ctx, "CloudAgent") + ctx = ctxsetters.WithMethodName(ctx, "UpdateAgentSecrets") + caller := c.callUpdateAgentSecrets + if c.interceptor != nil { + caller = func(ctx context.Context, req *UpdateAgentSecretsRequest) (*UpdateAgentSecretsResponse, error) { + resp, err := c.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*UpdateAgentSecretsRequest) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*UpdateAgentSecretsRequest) when calling interceptor") + } + return c.callUpdateAgentSecrets(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*UpdateAgentSecretsResponse) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*UpdateAgentSecretsResponse) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + return caller(ctx, in) +} + +func (c *cloudAgentProtobufClient) callUpdateAgentSecrets(ctx context.Context, in *UpdateAgentSecretsRequest) (*UpdateAgentSecretsResponse, error) { + out := new(UpdateAgentSecretsResponse) + ctx, err := doProtobufRequest(ctx, c.client, c.opts.Hooks, c.urls[9], in, out) + if err != nil { + twerr, ok := err.(twirp.Error) + if !ok { + twerr = twirp.InternalErrorWith(err) + } + callClientError(ctx, c.opts.Hooks, twerr) + return nil, err + } + + callClientResponseReceived(ctx, c.opts.Hooks) + + return out, nil +} + +func (c *cloudAgentProtobufClient) RollbackAgent(ctx context.Context, in *RollbackAgentRequest) (*RollbackAgentResponse, error) { + ctx = ctxsetters.WithPackageName(ctx, "livekit") + ctx = ctxsetters.WithServiceName(ctx, "CloudAgent") + ctx = ctxsetters.WithMethodName(ctx, "RollbackAgent") + caller := c.callRollbackAgent + if c.interceptor != nil { + caller = func(ctx context.Context, req *RollbackAgentRequest) (*RollbackAgentResponse, error) { + resp, err := c.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*RollbackAgentRequest) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*RollbackAgentRequest) when calling interceptor") + } + return c.callRollbackAgent(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*RollbackAgentResponse) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*RollbackAgentResponse) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + return caller(ctx, in) +} + +func (c *cloudAgentProtobufClient) callRollbackAgent(ctx context.Context, in *RollbackAgentRequest) (*RollbackAgentResponse, error) { + out := new(RollbackAgentResponse) + ctx, err := doProtobufRequest(ctx, c.client, c.opts.Hooks, c.urls[10], in, out) + if err != nil { + twerr, ok := err.(twirp.Error) + if !ok { + twerr = twirp.InternalErrorWith(err) + } + callClientError(ctx, c.opts.Hooks, twerr) + return nil, err + } + + callClientResponseReceived(ctx, c.opts.Hooks) + + return out, nil +} + +func (c *cloudAgentProtobufClient) DeleteAgent(ctx context.Context, in *DeleteAgentRequest) (*DeleteAgentResponse, error) { + ctx = ctxsetters.WithPackageName(ctx, "livekit") + ctx = ctxsetters.WithServiceName(ctx, "CloudAgent") + ctx = ctxsetters.WithMethodName(ctx, "DeleteAgent") + caller := c.callDeleteAgent + if c.interceptor != nil { + caller = func(ctx context.Context, req *DeleteAgentRequest) (*DeleteAgentResponse, error) { + resp, err := c.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*DeleteAgentRequest) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*DeleteAgentRequest) when calling interceptor") + } + return c.callDeleteAgent(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*DeleteAgentResponse) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*DeleteAgentResponse) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + return caller(ctx, in) +} + +func (c *cloudAgentProtobufClient) callDeleteAgent(ctx context.Context, in *DeleteAgentRequest) (*DeleteAgentResponse, error) { + out := new(DeleteAgentResponse) + ctx, err := doProtobufRequest(ctx, c.client, c.opts.Hooks, c.urls[11], in, out) + if err != nil { + twerr, ok := err.(twirp.Error) + if !ok { + twerr = twirp.InternalErrorWith(err) + } + callClientError(ctx, c.opts.Hooks, twerr) + return nil, err + } + + callClientResponseReceived(ctx, c.opts.Hooks) + + return out, nil +} + +func (c *cloudAgentProtobufClient) GetClientSettings(ctx context.Context, in *ClientSettingsRequest) (*ClientSettingsResponse, error) { + ctx = ctxsetters.WithPackageName(ctx, "livekit") + ctx = ctxsetters.WithServiceName(ctx, "CloudAgent") + ctx = ctxsetters.WithMethodName(ctx, "GetClientSettings") + caller := c.callGetClientSettings + if c.interceptor != nil { + caller = func(ctx context.Context, req *ClientSettingsRequest) (*ClientSettingsResponse, error) { + resp, err := c.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*ClientSettingsRequest) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*ClientSettingsRequest) when calling interceptor") + } + return c.callGetClientSettings(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*ClientSettingsResponse) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*ClientSettingsResponse) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + return caller(ctx, in) +} + +func (c *cloudAgentProtobufClient) callGetClientSettings(ctx context.Context, in *ClientSettingsRequest) (*ClientSettingsResponse, error) { + out := new(ClientSettingsResponse) + ctx, err := doProtobufRequest(ctx, c.client, c.opts.Hooks, c.urls[12], in, out) + if err != nil { + twerr, ok := err.(twirp.Error) + if !ok { + twerr = twirp.InternalErrorWith(err) + } + callClientError(ctx, c.opts.Hooks, twerr) + return nil, err + } + + callClientResponseReceived(ctx, c.opts.Hooks) + + return out, nil +} + +func (c *cloudAgentProtobufClient) CreatePrivateLink(ctx context.Context, in *CreatePrivateLinkRequest) (*CreatePrivateLinkResponse, error) { + ctx = ctxsetters.WithPackageName(ctx, "livekit") + ctx = ctxsetters.WithServiceName(ctx, "CloudAgent") + ctx = ctxsetters.WithMethodName(ctx, "CreatePrivateLink") + caller := c.callCreatePrivateLink + if c.interceptor != nil { + caller = func(ctx context.Context, req *CreatePrivateLinkRequest) (*CreatePrivateLinkResponse, error) { + resp, err := c.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*CreatePrivateLinkRequest) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*CreatePrivateLinkRequest) when calling interceptor") + } + return c.callCreatePrivateLink(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*CreatePrivateLinkResponse) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*CreatePrivateLinkResponse) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + return caller(ctx, in) +} + +func (c *cloudAgentProtobufClient) callCreatePrivateLink(ctx context.Context, in *CreatePrivateLinkRequest) (*CreatePrivateLinkResponse, error) { + out := new(CreatePrivateLinkResponse) + ctx, err := doProtobufRequest(ctx, c.client, c.opts.Hooks, c.urls[13], in, out) + if err != nil { + twerr, ok := err.(twirp.Error) + if !ok { + twerr = twirp.InternalErrorWith(err) + } + callClientError(ctx, c.opts.Hooks, twerr) + return nil, err + } + + callClientResponseReceived(ctx, c.opts.Hooks) + + return out, nil +} + +func (c *cloudAgentProtobufClient) DestroyPrivateLink(ctx context.Context, in *DestroyPrivateLinkRequest) (*DestroyPrivateLinkResponse, error) { + ctx = ctxsetters.WithPackageName(ctx, "livekit") + ctx = ctxsetters.WithServiceName(ctx, "CloudAgent") + ctx = ctxsetters.WithMethodName(ctx, "DestroyPrivateLink") + caller := c.callDestroyPrivateLink + if c.interceptor != nil { + caller = func(ctx context.Context, req *DestroyPrivateLinkRequest) (*DestroyPrivateLinkResponse, error) { + resp, err := c.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*DestroyPrivateLinkRequest) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*DestroyPrivateLinkRequest) when calling interceptor") + } + return c.callDestroyPrivateLink(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*DestroyPrivateLinkResponse) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*DestroyPrivateLinkResponse) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + return caller(ctx, in) +} + +func (c *cloudAgentProtobufClient) callDestroyPrivateLink(ctx context.Context, in *DestroyPrivateLinkRequest) (*DestroyPrivateLinkResponse, error) { + out := new(DestroyPrivateLinkResponse) + ctx, err := doProtobufRequest(ctx, c.client, c.opts.Hooks, c.urls[14], in, out) + if err != nil { + twerr, ok := err.(twirp.Error) + if !ok { + twerr = twirp.InternalErrorWith(err) + } + callClientError(ctx, c.opts.Hooks, twerr) + return nil, err + } + + callClientResponseReceived(ctx, c.opts.Hooks) + + return out, nil +} + +func (c *cloudAgentProtobufClient) ListPrivateLinks(ctx context.Context, in *ListPrivateLinksRequest) (*ListPrivateLinksResponse, error) { + ctx = ctxsetters.WithPackageName(ctx, "livekit") + ctx = ctxsetters.WithServiceName(ctx, "CloudAgent") + ctx = ctxsetters.WithMethodName(ctx, "ListPrivateLinks") + caller := c.callListPrivateLinks + if c.interceptor != nil { + caller = func(ctx context.Context, req *ListPrivateLinksRequest) (*ListPrivateLinksResponse, error) { + resp, err := c.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*ListPrivateLinksRequest) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*ListPrivateLinksRequest) when calling interceptor") + } + return c.callListPrivateLinks(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*ListPrivateLinksResponse) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*ListPrivateLinksResponse) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + return caller(ctx, in) +} + +func (c *cloudAgentProtobufClient) callListPrivateLinks(ctx context.Context, in *ListPrivateLinksRequest) (*ListPrivateLinksResponse, error) { + out := new(ListPrivateLinksResponse) + ctx, err := doProtobufRequest(ctx, c.client, c.opts.Hooks, c.urls[15], in, out) + if err != nil { + twerr, ok := err.(twirp.Error) + if !ok { + twerr = twirp.InternalErrorWith(err) + } + callClientError(ctx, c.opts.Hooks, twerr) + return nil, err + } + + callClientResponseReceived(ctx, c.opts.Hooks) + + return out, nil +} + +func (c *cloudAgentProtobufClient) GetPrivateLinkStatus(ctx context.Context, in *GetPrivateLinkStatusRequest) (*GetPrivateLinkStatusResponse, error) { + ctx = ctxsetters.WithPackageName(ctx, "livekit") + ctx = ctxsetters.WithServiceName(ctx, "CloudAgent") + ctx = ctxsetters.WithMethodName(ctx, "GetPrivateLinkStatus") + caller := c.callGetPrivateLinkStatus + if c.interceptor != nil { + caller = func(ctx context.Context, req *GetPrivateLinkStatusRequest) (*GetPrivateLinkStatusResponse, error) { + resp, err := c.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*GetPrivateLinkStatusRequest) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*GetPrivateLinkStatusRequest) when calling interceptor") + } + return c.callGetPrivateLinkStatus(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*GetPrivateLinkStatusResponse) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*GetPrivateLinkStatusResponse) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + return caller(ctx, in) +} + +func (c *cloudAgentProtobufClient) callGetPrivateLinkStatus(ctx context.Context, in *GetPrivateLinkStatusRequest) (*GetPrivateLinkStatusResponse, error) { + out := new(GetPrivateLinkStatusResponse) + ctx, err := doProtobufRequest(ctx, c.client, c.opts.Hooks, c.urls[16], in, out) + if err != nil { + twerr, ok := err.(twirp.Error) + if !ok { + twerr = twirp.InternalErrorWith(err) + } + callClientError(ctx, c.opts.Hooks, twerr) + return nil, err + } + + callClientResponseReceived(ctx, c.opts.Hooks) + + return out, nil +} + +// ====================== +// CloudAgent JSON Client +// ====================== + +type cloudAgentJSONClient struct { + client HTTPClient + urls [17]string + interceptor twirp.Interceptor + opts twirp.ClientOptions +} + +// NewCloudAgentJSONClient creates a JSON client that implements the CloudAgent interface. +// It communicates using JSON and can be configured with a custom HTTPClient. +func NewCloudAgentJSONClient(baseURL string, client HTTPClient, opts ...twirp.ClientOption) CloudAgent { + if c, ok := client.(*http.Client); ok { + client = withoutRedirects(c) + } + + clientOpts := twirp.ClientOptions{} + for _, o := range opts { + o(&clientOpts) + } + + // Using ReadOpt allows backwards and forwards compatibility with new options in the future + literalURLs := false + _ = clientOpts.ReadOpt("literalURLs", &literalURLs) + var pathPrefix string + if ok := clientOpts.ReadOpt("pathPrefix", &pathPrefix); !ok { + pathPrefix = "/twirp" // default prefix + } + + // Build method URLs: []/./ + serviceURL := sanitizeBaseURL(baseURL) + serviceURL += baseServicePath(pathPrefix, "livekit", "CloudAgent") + urls := [17]string{ + serviceURL + "CreateAgent", + serviceURL + "CreateAgentV2", + serviceURL + "ListAgents", + serviceURL + "ListAgentVersions", + serviceURL + "ListAgentSecrets", + serviceURL + "UpdateAgent", + serviceURL + "RestartAgent", + serviceURL + "DeployAgent", + serviceURL + "DeployAgentV2", + serviceURL + "UpdateAgentSecrets", + serviceURL + "RollbackAgent", + serviceURL + "DeleteAgent", + serviceURL + "GetClientSettings", + serviceURL + "CreatePrivateLink", + serviceURL + "DestroyPrivateLink", + serviceURL + "ListPrivateLinks", + serviceURL + "GetPrivateLinkStatus", + } + + return &cloudAgentJSONClient{ + client: client, + urls: urls, + interceptor: twirp.ChainInterceptors(clientOpts.Interceptors...), + opts: clientOpts, + } +} + +func (c *cloudAgentJSONClient) CreateAgent(ctx context.Context, in *CreateAgentRequest) (*CreateAgentResponse, error) { + ctx = ctxsetters.WithPackageName(ctx, "livekit") + ctx = ctxsetters.WithServiceName(ctx, "CloudAgent") + ctx = ctxsetters.WithMethodName(ctx, "CreateAgent") + caller := c.callCreateAgent + if c.interceptor != nil { + caller = func(ctx context.Context, req *CreateAgentRequest) (*CreateAgentResponse, error) { + resp, err := c.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*CreateAgentRequest) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*CreateAgentRequest) when calling interceptor") + } + return c.callCreateAgent(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*CreateAgentResponse) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*CreateAgentResponse) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + return caller(ctx, in) +} + +func (c *cloudAgentJSONClient) callCreateAgent(ctx context.Context, in *CreateAgentRequest) (*CreateAgentResponse, error) { + out := new(CreateAgentResponse) + ctx, err := doJSONRequest(ctx, c.client, c.opts.Hooks, c.urls[0], in, out) + if err != nil { + twerr, ok := err.(twirp.Error) + if !ok { + twerr = twirp.InternalErrorWith(err) + } + callClientError(ctx, c.opts.Hooks, twerr) + return nil, err + } + + callClientResponseReceived(ctx, c.opts.Hooks) + + return out, nil +} + +func (c *cloudAgentJSONClient) CreateAgentV2(ctx context.Context, in *CreateAgentV2Request) (*CreateAgentV2Response, error) { + ctx = ctxsetters.WithPackageName(ctx, "livekit") + ctx = ctxsetters.WithServiceName(ctx, "CloudAgent") + ctx = ctxsetters.WithMethodName(ctx, "CreateAgentV2") + caller := c.callCreateAgentV2 + if c.interceptor != nil { + caller = func(ctx context.Context, req *CreateAgentV2Request) (*CreateAgentV2Response, error) { + resp, err := c.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*CreateAgentV2Request) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*CreateAgentV2Request) when calling interceptor") + } + return c.callCreateAgentV2(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*CreateAgentV2Response) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*CreateAgentV2Response) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + return caller(ctx, in) +} + +func (c *cloudAgentJSONClient) callCreateAgentV2(ctx context.Context, in *CreateAgentV2Request) (*CreateAgentV2Response, error) { + out := new(CreateAgentV2Response) + ctx, err := doJSONRequest(ctx, c.client, c.opts.Hooks, c.urls[1], in, out) + if err != nil { + twerr, ok := err.(twirp.Error) + if !ok { + twerr = twirp.InternalErrorWith(err) + } + callClientError(ctx, c.opts.Hooks, twerr) + return nil, err + } + + callClientResponseReceived(ctx, c.opts.Hooks) + + return out, nil +} + +func (c *cloudAgentJSONClient) ListAgents(ctx context.Context, in *ListAgentsRequest) (*ListAgentsResponse, error) { + ctx = ctxsetters.WithPackageName(ctx, "livekit") + ctx = ctxsetters.WithServiceName(ctx, "CloudAgent") + ctx = ctxsetters.WithMethodName(ctx, "ListAgents") + caller := c.callListAgents + if c.interceptor != nil { + caller = func(ctx context.Context, req *ListAgentsRequest) (*ListAgentsResponse, error) { + resp, err := c.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*ListAgentsRequest) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*ListAgentsRequest) when calling interceptor") + } + return c.callListAgents(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*ListAgentsResponse) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*ListAgentsResponse) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + return caller(ctx, in) +} + +func (c *cloudAgentJSONClient) callListAgents(ctx context.Context, in *ListAgentsRequest) (*ListAgentsResponse, error) { + out := new(ListAgentsResponse) + ctx, err := doJSONRequest(ctx, c.client, c.opts.Hooks, c.urls[2], in, out) + if err != nil { + twerr, ok := err.(twirp.Error) + if !ok { + twerr = twirp.InternalErrorWith(err) + } + callClientError(ctx, c.opts.Hooks, twerr) + return nil, err + } + + callClientResponseReceived(ctx, c.opts.Hooks) + + return out, nil +} + +func (c *cloudAgentJSONClient) ListAgentVersions(ctx context.Context, in *ListAgentVersionsRequest) (*ListAgentVersionsResponse, error) { + ctx = ctxsetters.WithPackageName(ctx, "livekit") + ctx = ctxsetters.WithServiceName(ctx, "CloudAgent") + ctx = ctxsetters.WithMethodName(ctx, "ListAgentVersions") + caller := c.callListAgentVersions + if c.interceptor != nil { + caller = func(ctx context.Context, req *ListAgentVersionsRequest) (*ListAgentVersionsResponse, error) { + resp, err := c.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*ListAgentVersionsRequest) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*ListAgentVersionsRequest) when calling interceptor") + } + return c.callListAgentVersions(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*ListAgentVersionsResponse) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*ListAgentVersionsResponse) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + return caller(ctx, in) +} + +func (c *cloudAgentJSONClient) callListAgentVersions(ctx context.Context, in *ListAgentVersionsRequest) (*ListAgentVersionsResponse, error) { + out := new(ListAgentVersionsResponse) + ctx, err := doJSONRequest(ctx, c.client, c.opts.Hooks, c.urls[3], in, out) + if err != nil { + twerr, ok := err.(twirp.Error) + if !ok { + twerr = twirp.InternalErrorWith(err) + } + callClientError(ctx, c.opts.Hooks, twerr) + return nil, err + } + + callClientResponseReceived(ctx, c.opts.Hooks) + + return out, nil +} + +func (c *cloudAgentJSONClient) ListAgentSecrets(ctx context.Context, in *ListAgentSecretsRequest) (*ListAgentSecretsResponse, error) { + ctx = ctxsetters.WithPackageName(ctx, "livekit") + ctx = ctxsetters.WithServiceName(ctx, "CloudAgent") + ctx = ctxsetters.WithMethodName(ctx, "ListAgentSecrets") + caller := c.callListAgentSecrets + if c.interceptor != nil { + caller = func(ctx context.Context, req *ListAgentSecretsRequest) (*ListAgentSecretsResponse, error) { + resp, err := c.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*ListAgentSecretsRequest) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*ListAgentSecretsRequest) when calling interceptor") + } + return c.callListAgentSecrets(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*ListAgentSecretsResponse) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*ListAgentSecretsResponse) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + return caller(ctx, in) +} + +func (c *cloudAgentJSONClient) callListAgentSecrets(ctx context.Context, in *ListAgentSecretsRequest) (*ListAgentSecretsResponse, error) { + out := new(ListAgentSecretsResponse) + ctx, err := doJSONRequest(ctx, c.client, c.opts.Hooks, c.urls[4], in, out) + if err != nil { + twerr, ok := err.(twirp.Error) + if !ok { + twerr = twirp.InternalErrorWith(err) + } + callClientError(ctx, c.opts.Hooks, twerr) + return nil, err + } + + callClientResponseReceived(ctx, c.opts.Hooks) + + return out, nil +} + +func (c *cloudAgentJSONClient) UpdateAgent(ctx context.Context, in *UpdateAgentRequest) (*UpdateAgentResponse, error) { + ctx = ctxsetters.WithPackageName(ctx, "livekit") + ctx = ctxsetters.WithServiceName(ctx, "CloudAgent") + ctx = ctxsetters.WithMethodName(ctx, "UpdateAgent") + caller := c.callUpdateAgent + if c.interceptor != nil { + caller = func(ctx context.Context, req *UpdateAgentRequest) (*UpdateAgentResponse, error) { + resp, err := c.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*UpdateAgentRequest) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*UpdateAgentRequest) when calling interceptor") + } + return c.callUpdateAgent(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*UpdateAgentResponse) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*UpdateAgentResponse) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + return caller(ctx, in) +} + +func (c *cloudAgentJSONClient) callUpdateAgent(ctx context.Context, in *UpdateAgentRequest) (*UpdateAgentResponse, error) { + out := new(UpdateAgentResponse) + ctx, err := doJSONRequest(ctx, c.client, c.opts.Hooks, c.urls[5], in, out) + if err != nil { + twerr, ok := err.(twirp.Error) + if !ok { + twerr = twirp.InternalErrorWith(err) + } + callClientError(ctx, c.opts.Hooks, twerr) + return nil, err + } + + callClientResponseReceived(ctx, c.opts.Hooks) + + return out, nil +} + +func (c *cloudAgentJSONClient) RestartAgent(ctx context.Context, in *RestartAgentRequest) (*RestartAgentResponse, error) { + ctx = ctxsetters.WithPackageName(ctx, "livekit") + ctx = ctxsetters.WithServiceName(ctx, "CloudAgent") + ctx = ctxsetters.WithMethodName(ctx, "RestartAgent") + caller := c.callRestartAgent + if c.interceptor != nil { + caller = func(ctx context.Context, req *RestartAgentRequest) (*RestartAgentResponse, error) { + resp, err := c.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*RestartAgentRequest) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*RestartAgentRequest) when calling interceptor") + } + return c.callRestartAgent(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*RestartAgentResponse) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*RestartAgentResponse) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + return caller(ctx, in) +} + +func (c *cloudAgentJSONClient) callRestartAgent(ctx context.Context, in *RestartAgentRequest) (*RestartAgentResponse, error) { + out := new(RestartAgentResponse) + ctx, err := doJSONRequest(ctx, c.client, c.opts.Hooks, c.urls[6], in, out) + if err != nil { + twerr, ok := err.(twirp.Error) + if !ok { + twerr = twirp.InternalErrorWith(err) + } + callClientError(ctx, c.opts.Hooks, twerr) + return nil, err + } + + callClientResponseReceived(ctx, c.opts.Hooks) + + return out, nil +} + +func (c *cloudAgentJSONClient) DeployAgent(ctx context.Context, in *DeployAgentRequest) (*DeployAgentResponse, error) { + ctx = ctxsetters.WithPackageName(ctx, "livekit") + ctx = ctxsetters.WithServiceName(ctx, "CloudAgent") + ctx = ctxsetters.WithMethodName(ctx, "DeployAgent") + caller := c.callDeployAgent + if c.interceptor != nil { + caller = func(ctx context.Context, req *DeployAgentRequest) (*DeployAgentResponse, error) { + resp, err := c.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*DeployAgentRequest) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*DeployAgentRequest) when calling interceptor") + } + return c.callDeployAgent(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*DeployAgentResponse) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*DeployAgentResponse) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + return caller(ctx, in) +} + +func (c *cloudAgentJSONClient) callDeployAgent(ctx context.Context, in *DeployAgentRequest) (*DeployAgentResponse, error) { + out := new(DeployAgentResponse) + ctx, err := doJSONRequest(ctx, c.client, c.opts.Hooks, c.urls[7], in, out) + if err != nil { + twerr, ok := err.(twirp.Error) + if !ok { + twerr = twirp.InternalErrorWith(err) + } + callClientError(ctx, c.opts.Hooks, twerr) + return nil, err + } + + callClientResponseReceived(ctx, c.opts.Hooks) + + return out, nil +} + +func (c *cloudAgentJSONClient) DeployAgentV2(ctx context.Context, in *DeployAgentV2Request) (*DeployAgentV2Response, error) { + ctx = ctxsetters.WithPackageName(ctx, "livekit") + ctx = ctxsetters.WithServiceName(ctx, "CloudAgent") + ctx = ctxsetters.WithMethodName(ctx, "DeployAgentV2") + caller := c.callDeployAgentV2 + if c.interceptor != nil { + caller = func(ctx context.Context, req *DeployAgentV2Request) (*DeployAgentV2Response, error) { + resp, err := c.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*DeployAgentV2Request) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*DeployAgentV2Request) when calling interceptor") + } + return c.callDeployAgentV2(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*DeployAgentV2Response) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*DeployAgentV2Response) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + return caller(ctx, in) +} + +func (c *cloudAgentJSONClient) callDeployAgentV2(ctx context.Context, in *DeployAgentV2Request) (*DeployAgentV2Response, error) { + out := new(DeployAgentV2Response) + ctx, err := doJSONRequest(ctx, c.client, c.opts.Hooks, c.urls[8], in, out) + if err != nil { + twerr, ok := err.(twirp.Error) + if !ok { + twerr = twirp.InternalErrorWith(err) + } + callClientError(ctx, c.opts.Hooks, twerr) + return nil, err + } + + callClientResponseReceived(ctx, c.opts.Hooks) + + return out, nil +} + +func (c *cloudAgentJSONClient) UpdateAgentSecrets(ctx context.Context, in *UpdateAgentSecretsRequest) (*UpdateAgentSecretsResponse, error) { + ctx = ctxsetters.WithPackageName(ctx, "livekit") + ctx = ctxsetters.WithServiceName(ctx, "CloudAgent") + ctx = ctxsetters.WithMethodName(ctx, "UpdateAgentSecrets") + caller := c.callUpdateAgentSecrets + if c.interceptor != nil { + caller = func(ctx context.Context, req *UpdateAgentSecretsRequest) (*UpdateAgentSecretsResponse, error) { + resp, err := c.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*UpdateAgentSecretsRequest) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*UpdateAgentSecretsRequest) when calling interceptor") + } + return c.callUpdateAgentSecrets(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*UpdateAgentSecretsResponse) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*UpdateAgentSecretsResponse) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + return caller(ctx, in) +} + +func (c *cloudAgentJSONClient) callUpdateAgentSecrets(ctx context.Context, in *UpdateAgentSecretsRequest) (*UpdateAgentSecretsResponse, error) { + out := new(UpdateAgentSecretsResponse) + ctx, err := doJSONRequest(ctx, c.client, c.opts.Hooks, c.urls[9], in, out) + if err != nil { + twerr, ok := err.(twirp.Error) + if !ok { + twerr = twirp.InternalErrorWith(err) + } + callClientError(ctx, c.opts.Hooks, twerr) + return nil, err + } + + callClientResponseReceived(ctx, c.opts.Hooks) + + return out, nil +} + +func (c *cloudAgentJSONClient) RollbackAgent(ctx context.Context, in *RollbackAgentRequest) (*RollbackAgentResponse, error) { + ctx = ctxsetters.WithPackageName(ctx, "livekit") + ctx = ctxsetters.WithServiceName(ctx, "CloudAgent") + ctx = ctxsetters.WithMethodName(ctx, "RollbackAgent") + caller := c.callRollbackAgent + if c.interceptor != nil { + caller = func(ctx context.Context, req *RollbackAgentRequest) (*RollbackAgentResponse, error) { + resp, err := c.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*RollbackAgentRequest) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*RollbackAgentRequest) when calling interceptor") + } + return c.callRollbackAgent(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*RollbackAgentResponse) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*RollbackAgentResponse) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + return caller(ctx, in) +} + +func (c *cloudAgentJSONClient) callRollbackAgent(ctx context.Context, in *RollbackAgentRequest) (*RollbackAgentResponse, error) { + out := new(RollbackAgentResponse) + ctx, err := doJSONRequest(ctx, c.client, c.opts.Hooks, c.urls[10], in, out) + if err != nil { + twerr, ok := err.(twirp.Error) + if !ok { + twerr = twirp.InternalErrorWith(err) + } + callClientError(ctx, c.opts.Hooks, twerr) + return nil, err + } + + callClientResponseReceived(ctx, c.opts.Hooks) + + return out, nil +} + +func (c *cloudAgentJSONClient) DeleteAgent(ctx context.Context, in *DeleteAgentRequest) (*DeleteAgentResponse, error) { + ctx = ctxsetters.WithPackageName(ctx, "livekit") + ctx = ctxsetters.WithServiceName(ctx, "CloudAgent") + ctx = ctxsetters.WithMethodName(ctx, "DeleteAgent") + caller := c.callDeleteAgent + if c.interceptor != nil { + caller = func(ctx context.Context, req *DeleteAgentRequest) (*DeleteAgentResponse, error) { + resp, err := c.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*DeleteAgentRequest) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*DeleteAgentRequest) when calling interceptor") + } + return c.callDeleteAgent(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*DeleteAgentResponse) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*DeleteAgentResponse) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + return caller(ctx, in) +} + +func (c *cloudAgentJSONClient) callDeleteAgent(ctx context.Context, in *DeleteAgentRequest) (*DeleteAgentResponse, error) { + out := new(DeleteAgentResponse) + ctx, err := doJSONRequest(ctx, c.client, c.opts.Hooks, c.urls[11], in, out) + if err != nil { + twerr, ok := err.(twirp.Error) + if !ok { + twerr = twirp.InternalErrorWith(err) + } + callClientError(ctx, c.opts.Hooks, twerr) + return nil, err + } + + callClientResponseReceived(ctx, c.opts.Hooks) + + return out, nil +} + +func (c *cloudAgentJSONClient) GetClientSettings(ctx context.Context, in *ClientSettingsRequest) (*ClientSettingsResponse, error) { + ctx = ctxsetters.WithPackageName(ctx, "livekit") + ctx = ctxsetters.WithServiceName(ctx, "CloudAgent") + ctx = ctxsetters.WithMethodName(ctx, "GetClientSettings") + caller := c.callGetClientSettings + if c.interceptor != nil { + caller = func(ctx context.Context, req *ClientSettingsRequest) (*ClientSettingsResponse, error) { + resp, err := c.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*ClientSettingsRequest) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*ClientSettingsRequest) when calling interceptor") + } + return c.callGetClientSettings(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*ClientSettingsResponse) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*ClientSettingsResponse) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + return caller(ctx, in) +} + +func (c *cloudAgentJSONClient) callGetClientSettings(ctx context.Context, in *ClientSettingsRequest) (*ClientSettingsResponse, error) { + out := new(ClientSettingsResponse) + ctx, err := doJSONRequest(ctx, c.client, c.opts.Hooks, c.urls[12], in, out) + if err != nil { + twerr, ok := err.(twirp.Error) + if !ok { + twerr = twirp.InternalErrorWith(err) + } + callClientError(ctx, c.opts.Hooks, twerr) + return nil, err + } + + callClientResponseReceived(ctx, c.opts.Hooks) + + return out, nil +} + +func (c *cloudAgentJSONClient) CreatePrivateLink(ctx context.Context, in *CreatePrivateLinkRequest) (*CreatePrivateLinkResponse, error) { + ctx = ctxsetters.WithPackageName(ctx, "livekit") + ctx = ctxsetters.WithServiceName(ctx, "CloudAgent") + ctx = ctxsetters.WithMethodName(ctx, "CreatePrivateLink") + caller := c.callCreatePrivateLink + if c.interceptor != nil { + caller = func(ctx context.Context, req *CreatePrivateLinkRequest) (*CreatePrivateLinkResponse, error) { + resp, err := c.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*CreatePrivateLinkRequest) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*CreatePrivateLinkRequest) when calling interceptor") + } + return c.callCreatePrivateLink(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*CreatePrivateLinkResponse) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*CreatePrivateLinkResponse) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + return caller(ctx, in) +} + +func (c *cloudAgentJSONClient) callCreatePrivateLink(ctx context.Context, in *CreatePrivateLinkRequest) (*CreatePrivateLinkResponse, error) { + out := new(CreatePrivateLinkResponse) + ctx, err := doJSONRequest(ctx, c.client, c.opts.Hooks, c.urls[13], in, out) + if err != nil { + twerr, ok := err.(twirp.Error) + if !ok { + twerr = twirp.InternalErrorWith(err) + } + callClientError(ctx, c.opts.Hooks, twerr) + return nil, err + } + + callClientResponseReceived(ctx, c.opts.Hooks) + + return out, nil +} + +func (c *cloudAgentJSONClient) DestroyPrivateLink(ctx context.Context, in *DestroyPrivateLinkRequest) (*DestroyPrivateLinkResponse, error) { + ctx = ctxsetters.WithPackageName(ctx, "livekit") + ctx = ctxsetters.WithServiceName(ctx, "CloudAgent") + ctx = ctxsetters.WithMethodName(ctx, "DestroyPrivateLink") + caller := c.callDestroyPrivateLink + if c.interceptor != nil { + caller = func(ctx context.Context, req *DestroyPrivateLinkRequest) (*DestroyPrivateLinkResponse, error) { + resp, err := c.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*DestroyPrivateLinkRequest) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*DestroyPrivateLinkRequest) when calling interceptor") + } + return c.callDestroyPrivateLink(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*DestroyPrivateLinkResponse) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*DestroyPrivateLinkResponse) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + return caller(ctx, in) +} + +func (c *cloudAgentJSONClient) callDestroyPrivateLink(ctx context.Context, in *DestroyPrivateLinkRequest) (*DestroyPrivateLinkResponse, error) { + out := new(DestroyPrivateLinkResponse) + ctx, err := doJSONRequest(ctx, c.client, c.opts.Hooks, c.urls[14], in, out) + if err != nil { + twerr, ok := err.(twirp.Error) + if !ok { + twerr = twirp.InternalErrorWith(err) + } + callClientError(ctx, c.opts.Hooks, twerr) + return nil, err + } + + callClientResponseReceived(ctx, c.opts.Hooks) + + return out, nil +} + +func (c *cloudAgentJSONClient) ListPrivateLinks(ctx context.Context, in *ListPrivateLinksRequest) (*ListPrivateLinksResponse, error) { + ctx = ctxsetters.WithPackageName(ctx, "livekit") + ctx = ctxsetters.WithServiceName(ctx, "CloudAgent") + ctx = ctxsetters.WithMethodName(ctx, "ListPrivateLinks") + caller := c.callListPrivateLinks + if c.interceptor != nil { + caller = func(ctx context.Context, req *ListPrivateLinksRequest) (*ListPrivateLinksResponse, error) { + resp, err := c.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*ListPrivateLinksRequest) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*ListPrivateLinksRequest) when calling interceptor") + } + return c.callListPrivateLinks(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*ListPrivateLinksResponse) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*ListPrivateLinksResponse) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + return caller(ctx, in) +} + +func (c *cloudAgentJSONClient) callListPrivateLinks(ctx context.Context, in *ListPrivateLinksRequest) (*ListPrivateLinksResponse, error) { + out := new(ListPrivateLinksResponse) + ctx, err := doJSONRequest(ctx, c.client, c.opts.Hooks, c.urls[15], in, out) + if err != nil { + twerr, ok := err.(twirp.Error) + if !ok { + twerr = twirp.InternalErrorWith(err) + } + callClientError(ctx, c.opts.Hooks, twerr) + return nil, err + } + + callClientResponseReceived(ctx, c.opts.Hooks) + + return out, nil +} + +func (c *cloudAgentJSONClient) GetPrivateLinkStatus(ctx context.Context, in *GetPrivateLinkStatusRequest) (*GetPrivateLinkStatusResponse, error) { + ctx = ctxsetters.WithPackageName(ctx, "livekit") + ctx = ctxsetters.WithServiceName(ctx, "CloudAgent") + ctx = ctxsetters.WithMethodName(ctx, "GetPrivateLinkStatus") + caller := c.callGetPrivateLinkStatus + if c.interceptor != nil { + caller = func(ctx context.Context, req *GetPrivateLinkStatusRequest) (*GetPrivateLinkStatusResponse, error) { + resp, err := c.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*GetPrivateLinkStatusRequest) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*GetPrivateLinkStatusRequest) when calling interceptor") + } + return c.callGetPrivateLinkStatus(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*GetPrivateLinkStatusResponse) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*GetPrivateLinkStatusResponse) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + return caller(ctx, in) +} + +func (c *cloudAgentJSONClient) callGetPrivateLinkStatus(ctx context.Context, in *GetPrivateLinkStatusRequest) (*GetPrivateLinkStatusResponse, error) { + out := new(GetPrivateLinkStatusResponse) + ctx, err := doJSONRequest(ctx, c.client, c.opts.Hooks, c.urls[16], in, out) + if err != nil { + twerr, ok := err.(twirp.Error) + if !ok { + twerr = twirp.InternalErrorWith(err) + } + callClientError(ctx, c.opts.Hooks, twerr) + return nil, err + } + + callClientResponseReceived(ctx, c.opts.Hooks) + + return out, nil +} + +// ========================= +// CloudAgent Server Handler +// ========================= + +type cloudAgentServer struct { + CloudAgent + interceptor twirp.Interceptor + hooks *twirp.ServerHooks + pathPrefix string // prefix for routing + jsonSkipDefaults bool // do not include unpopulated fields (default values) in the response + jsonCamelCase bool // JSON fields are serialized as lowerCamelCase rather than keeping the original proto names +} + +// NewCloudAgentServer builds a TwirpServer that can be used as an http.Handler to handle +// HTTP requests that are routed to the right method in the provided svc implementation. +// The opts are twirp.ServerOption modifiers, for example twirp.WithServerHooks(hooks). +func NewCloudAgentServer(svc CloudAgent, opts ...interface{}) TwirpServer { + serverOpts := newServerOpts(opts) + + // Using ReadOpt allows backwards and forwards compatibility with new options in the future + jsonSkipDefaults := false + _ = serverOpts.ReadOpt("jsonSkipDefaults", &jsonSkipDefaults) + jsonCamelCase := false + _ = serverOpts.ReadOpt("jsonCamelCase", &jsonCamelCase) + var pathPrefix string + if ok := serverOpts.ReadOpt("pathPrefix", &pathPrefix); !ok { + pathPrefix = "/twirp" // default prefix + } + + return &cloudAgentServer{ + CloudAgent: svc, + hooks: serverOpts.Hooks, + interceptor: twirp.ChainInterceptors(serverOpts.Interceptors...), + pathPrefix: pathPrefix, + jsonSkipDefaults: jsonSkipDefaults, + jsonCamelCase: jsonCamelCase, + } +} + +// writeError writes an HTTP response with a valid Twirp error format, and triggers hooks. +// If err is not a twirp.Error, it will get wrapped with twirp.InternalErrorWith(err) +func (s *cloudAgentServer) writeError(ctx context.Context, resp http.ResponseWriter, err error) { + writeError(ctx, resp, err, s.hooks) +} + +// handleRequestBodyError is used to handle error when the twirp server cannot read request +func (s *cloudAgentServer) handleRequestBodyError(ctx context.Context, resp http.ResponseWriter, msg string, err error) { + if context.Canceled == ctx.Err() { + s.writeError(ctx, resp, twirp.NewError(twirp.Canceled, "failed to read request: context canceled")) + return + } + if context.DeadlineExceeded == ctx.Err() { + s.writeError(ctx, resp, twirp.NewError(twirp.DeadlineExceeded, "failed to read request: deadline exceeded")) + return + } + s.writeError(ctx, resp, twirp.WrapError(malformedRequestError(msg), err)) +} + +// CloudAgentPathPrefix is a convenience constant that may identify URL paths. +// Should be used with caution, it only matches routes generated by Twirp Go clients, +// with the default "/twirp" prefix and default CamelCase service and method names. +// More info: https://twitchtv.github.io/twirp/docs/routing.html +const CloudAgentPathPrefix = "/twirp/livekit.CloudAgent/" + +func (s *cloudAgentServer) ServeHTTP(resp http.ResponseWriter, req *http.Request) { + ctx := req.Context() + ctx = ctxsetters.WithPackageName(ctx, "livekit") + ctx = ctxsetters.WithServiceName(ctx, "CloudAgent") + ctx = ctxsetters.WithResponseWriter(ctx, resp) + + var err error + ctx, err = callRequestReceived(ctx, s.hooks) + if err != nil { + s.writeError(ctx, resp, err) + return + } + + if req.Method != "POST" { + msg := fmt.Sprintf("unsupported method %q (only POST is allowed)", req.Method) + s.writeError(ctx, resp, badRouteError(msg, req.Method, req.URL.Path)) + return + } + + // Verify path format: []/./ + prefix, pkgService, method := parseTwirpPath(req.URL.Path) + if pkgService != "livekit.CloudAgent" { + msg := fmt.Sprintf("no handler for path %q", req.URL.Path) + s.writeError(ctx, resp, badRouteError(msg, req.Method, req.URL.Path)) + return + } + if prefix != s.pathPrefix { + msg := fmt.Sprintf("invalid path prefix %q, expected %q, on path %q", prefix, s.pathPrefix, req.URL.Path) + s.writeError(ctx, resp, badRouteError(msg, req.Method, req.URL.Path)) + return + } + + switch method { + case "CreateAgent": + s.serveCreateAgent(ctx, resp, req) + return + case "CreateAgentV2": + s.serveCreateAgentV2(ctx, resp, req) + return + case "ListAgents": + s.serveListAgents(ctx, resp, req) + return + case "ListAgentVersions": + s.serveListAgentVersions(ctx, resp, req) + return + case "ListAgentSecrets": + s.serveListAgentSecrets(ctx, resp, req) + return + case "UpdateAgent": + s.serveUpdateAgent(ctx, resp, req) + return + case "RestartAgent": + s.serveRestartAgent(ctx, resp, req) + return + case "DeployAgent": + s.serveDeployAgent(ctx, resp, req) + return + case "DeployAgentV2": + s.serveDeployAgentV2(ctx, resp, req) + return + case "UpdateAgentSecrets": + s.serveUpdateAgentSecrets(ctx, resp, req) + return + case "RollbackAgent": + s.serveRollbackAgent(ctx, resp, req) + return + case "DeleteAgent": + s.serveDeleteAgent(ctx, resp, req) + return + case "GetClientSettings": + s.serveGetClientSettings(ctx, resp, req) + return + case "CreatePrivateLink": + s.serveCreatePrivateLink(ctx, resp, req) + return + case "DestroyPrivateLink": + s.serveDestroyPrivateLink(ctx, resp, req) + return + case "ListPrivateLinks": + s.serveListPrivateLinks(ctx, resp, req) + return + case "GetPrivateLinkStatus": + s.serveGetPrivateLinkStatus(ctx, resp, req) + return + default: + msg := fmt.Sprintf("no handler for path %q", req.URL.Path) + s.writeError(ctx, resp, badRouteError(msg, req.Method, req.URL.Path)) + return + } +} + +func (s *cloudAgentServer) serveCreateAgent(ctx context.Context, resp http.ResponseWriter, req *http.Request) { + header := req.Header.Get("Content-Type") + i := strings.Index(header, ";") + if i == -1 { + i = len(header) + } + switch strings.TrimSpace(strings.ToLower(header[:i])) { + case "application/json": + s.serveCreateAgentJSON(ctx, resp, req) + case "application/protobuf": + s.serveCreateAgentProtobuf(ctx, resp, req) + default: + msg := fmt.Sprintf("unexpected Content-Type: %q", req.Header.Get("Content-Type")) + twerr := badRouteError(msg, req.Method, req.URL.Path) + s.writeError(ctx, resp, twerr) + } +} + +func (s *cloudAgentServer) serveCreateAgentJSON(ctx context.Context, resp http.ResponseWriter, req *http.Request) { + var err error + ctx = ctxsetters.WithMethodName(ctx, "CreateAgent") + ctx, err = callRequestRouted(ctx, s.hooks) + if err != nil { + s.writeError(ctx, resp, err) + return + } + + d := json.NewDecoder(req.Body) + rawReqBody := json.RawMessage{} + if err := d.Decode(&rawReqBody); err != nil { + s.handleRequestBodyError(ctx, resp, "the json request could not be decoded", err) + return + } + reqContent := new(CreateAgentRequest) + unmarshaler := protojson.UnmarshalOptions{DiscardUnknown: true} + if err = unmarshaler.Unmarshal(rawReqBody, reqContent); err != nil { + s.handleRequestBodyError(ctx, resp, "the json request could not be decoded", err) + return + } + + handler := s.CloudAgent.CreateAgent + if s.interceptor != nil { + handler = func(ctx context.Context, req *CreateAgentRequest) (*CreateAgentResponse, error) { + resp, err := s.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*CreateAgentRequest) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*CreateAgentRequest) when calling interceptor") + } + return s.CloudAgent.CreateAgent(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*CreateAgentResponse) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*CreateAgentResponse) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + + // Call service method + var respContent *CreateAgentResponse + func() { + defer ensurePanicResponses(ctx, resp, s.hooks) + respContent, err = handler(ctx, reqContent) + }() + + if err != nil { + s.writeError(ctx, resp, err) + return + } + if respContent == nil { + s.writeError(ctx, resp, twirp.InternalError("received a nil *CreateAgentResponse and nil error while calling CreateAgent. nil responses are not supported")) + return + } + + ctx = callResponsePrepared(ctx, s.hooks) + + marshaler := &protojson.MarshalOptions{UseProtoNames: !s.jsonCamelCase, EmitUnpopulated: !s.jsonSkipDefaults} + respBytes, err := marshaler.Marshal(respContent) + if err != nil { + s.writeError(ctx, resp, wrapInternal(err, "failed to marshal json response")) + return + } + + ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK) + resp.Header().Set("Content-Type", "application/json") + resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes))) + resp.WriteHeader(http.StatusOK) + + if n, err := resp.Write(respBytes); err != nil { + msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error()) + twerr := twirp.NewError(twirp.Unknown, msg) + ctx = callError(ctx, s.hooks, twerr) + } + callResponseSent(ctx, s.hooks) +} + +func (s *cloudAgentServer) serveCreateAgentProtobuf(ctx context.Context, resp http.ResponseWriter, req *http.Request) { + var err error + ctx = ctxsetters.WithMethodName(ctx, "CreateAgent") + ctx, err = callRequestRouted(ctx, s.hooks) + if err != nil { + s.writeError(ctx, resp, err) + return + } + + buf, err := io.ReadAll(req.Body) + if err != nil { + s.handleRequestBodyError(ctx, resp, "failed to read request body", err) + return + } + reqContent := new(CreateAgentRequest) + if err = proto.Unmarshal(buf, reqContent); err != nil { + s.writeError(ctx, resp, malformedRequestError("the protobuf request could not be decoded")) + return + } + + handler := s.CloudAgent.CreateAgent + if s.interceptor != nil { + handler = func(ctx context.Context, req *CreateAgentRequest) (*CreateAgentResponse, error) { + resp, err := s.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*CreateAgentRequest) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*CreateAgentRequest) when calling interceptor") + } + return s.CloudAgent.CreateAgent(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*CreateAgentResponse) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*CreateAgentResponse) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + + // Call service method + var respContent *CreateAgentResponse + func() { + defer ensurePanicResponses(ctx, resp, s.hooks) + respContent, err = handler(ctx, reqContent) + }() + + if err != nil { + s.writeError(ctx, resp, err) + return + } + if respContent == nil { + s.writeError(ctx, resp, twirp.InternalError("received a nil *CreateAgentResponse and nil error while calling CreateAgent. nil responses are not supported")) + return + } + + ctx = callResponsePrepared(ctx, s.hooks) + + respBytes, err := proto.Marshal(respContent) + if err != nil { + s.writeError(ctx, resp, wrapInternal(err, "failed to marshal proto response")) + return + } + + ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK) + resp.Header().Set("Content-Type", "application/protobuf") + resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes))) + resp.WriteHeader(http.StatusOK) + if n, err := resp.Write(respBytes); err != nil { + msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error()) + twerr := twirp.NewError(twirp.Unknown, msg) + ctx = callError(ctx, s.hooks, twerr) + } + callResponseSent(ctx, s.hooks) +} + +func (s *cloudAgentServer) serveCreateAgentV2(ctx context.Context, resp http.ResponseWriter, req *http.Request) { + header := req.Header.Get("Content-Type") + i := strings.Index(header, ";") + if i == -1 { + i = len(header) + } + switch strings.TrimSpace(strings.ToLower(header[:i])) { + case "application/json": + s.serveCreateAgentV2JSON(ctx, resp, req) + case "application/protobuf": + s.serveCreateAgentV2Protobuf(ctx, resp, req) + default: + msg := fmt.Sprintf("unexpected Content-Type: %q", req.Header.Get("Content-Type")) + twerr := badRouteError(msg, req.Method, req.URL.Path) + s.writeError(ctx, resp, twerr) + } +} + +func (s *cloudAgentServer) serveCreateAgentV2JSON(ctx context.Context, resp http.ResponseWriter, req *http.Request) { + var err error + ctx = ctxsetters.WithMethodName(ctx, "CreateAgentV2") + ctx, err = callRequestRouted(ctx, s.hooks) + if err != nil { + s.writeError(ctx, resp, err) + return + } + + d := json.NewDecoder(req.Body) + rawReqBody := json.RawMessage{} + if err := d.Decode(&rawReqBody); err != nil { + s.handleRequestBodyError(ctx, resp, "the json request could not be decoded", err) + return + } + reqContent := new(CreateAgentV2Request) + unmarshaler := protojson.UnmarshalOptions{DiscardUnknown: true} + if err = unmarshaler.Unmarshal(rawReqBody, reqContent); err != nil { + s.handleRequestBodyError(ctx, resp, "the json request could not be decoded", err) + return + } + + handler := s.CloudAgent.CreateAgentV2 + if s.interceptor != nil { + handler = func(ctx context.Context, req *CreateAgentV2Request) (*CreateAgentV2Response, error) { + resp, err := s.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*CreateAgentV2Request) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*CreateAgentV2Request) when calling interceptor") + } + return s.CloudAgent.CreateAgentV2(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*CreateAgentV2Response) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*CreateAgentV2Response) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + + // Call service method + var respContent *CreateAgentV2Response + func() { + defer ensurePanicResponses(ctx, resp, s.hooks) + respContent, err = handler(ctx, reqContent) + }() + + if err != nil { + s.writeError(ctx, resp, err) + return + } + if respContent == nil { + s.writeError(ctx, resp, twirp.InternalError("received a nil *CreateAgentV2Response and nil error while calling CreateAgentV2. nil responses are not supported")) + return + } + + ctx = callResponsePrepared(ctx, s.hooks) + + marshaler := &protojson.MarshalOptions{UseProtoNames: !s.jsonCamelCase, EmitUnpopulated: !s.jsonSkipDefaults} + respBytes, err := marshaler.Marshal(respContent) + if err != nil { + s.writeError(ctx, resp, wrapInternal(err, "failed to marshal json response")) + return + } + + ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK) + resp.Header().Set("Content-Type", "application/json") + resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes))) + resp.WriteHeader(http.StatusOK) + + if n, err := resp.Write(respBytes); err != nil { + msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error()) + twerr := twirp.NewError(twirp.Unknown, msg) + ctx = callError(ctx, s.hooks, twerr) + } + callResponseSent(ctx, s.hooks) +} + +func (s *cloudAgentServer) serveCreateAgentV2Protobuf(ctx context.Context, resp http.ResponseWriter, req *http.Request) { + var err error + ctx = ctxsetters.WithMethodName(ctx, "CreateAgentV2") + ctx, err = callRequestRouted(ctx, s.hooks) + if err != nil { + s.writeError(ctx, resp, err) + return + } + + buf, err := io.ReadAll(req.Body) + if err != nil { + s.handleRequestBodyError(ctx, resp, "failed to read request body", err) + return + } + reqContent := new(CreateAgentV2Request) + if err = proto.Unmarshal(buf, reqContent); err != nil { + s.writeError(ctx, resp, malformedRequestError("the protobuf request could not be decoded")) + return + } + + handler := s.CloudAgent.CreateAgentV2 + if s.interceptor != nil { + handler = func(ctx context.Context, req *CreateAgentV2Request) (*CreateAgentV2Response, error) { + resp, err := s.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*CreateAgentV2Request) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*CreateAgentV2Request) when calling interceptor") + } + return s.CloudAgent.CreateAgentV2(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*CreateAgentV2Response) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*CreateAgentV2Response) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + + // Call service method + var respContent *CreateAgentV2Response + func() { + defer ensurePanicResponses(ctx, resp, s.hooks) + respContent, err = handler(ctx, reqContent) + }() + + if err != nil { + s.writeError(ctx, resp, err) + return + } + if respContent == nil { + s.writeError(ctx, resp, twirp.InternalError("received a nil *CreateAgentV2Response and nil error while calling CreateAgentV2. nil responses are not supported")) + return + } + + ctx = callResponsePrepared(ctx, s.hooks) + + respBytes, err := proto.Marshal(respContent) + if err != nil { + s.writeError(ctx, resp, wrapInternal(err, "failed to marshal proto response")) + return + } + + ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK) + resp.Header().Set("Content-Type", "application/protobuf") + resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes))) + resp.WriteHeader(http.StatusOK) + if n, err := resp.Write(respBytes); err != nil { + msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error()) + twerr := twirp.NewError(twirp.Unknown, msg) + ctx = callError(ctx, s.hooks, twerr) + } + callResponseSent(ctx, s.hooks) +} + +func (s *cloudAgentServer) serveListAgents(ctx context.Context, resp http.ResponseWriter, req *http.Request) { + header := req.Header.Get("Content-Type") + i := strings.Index(header, ";") + if i == -1 { + i = len(header) + } + switch strings.TrimSpace(strings.ToLower(header[:i])) { + case "application/json": + s.serveListAgentsJSON(ctx, resp, req) + case "application/protobuf": + s.serveListAgentsProtobuf(ctx, resp, req) + default: + msg := fmt.Sprintf("unexpected Content-Type: %q", req.Header.Get("Content-Type")) + twerr := badRouteError(msg, req.Method, req.URL.Path) + s.writeError(ctx, resp, twerr) + } +} + +func (s *cloudAgentServer) serveListAgentsJSON(ctx context.Context, resp http.ResponseWriter, req *http.Request) { + var err error + ctx = ctxsetters.WithMethodName(ctx, "ListAgents") + ctx, err = callRequestRouted(ctx, s.hooks) + if err != nil { + s.writeError(ctx, resp, err) + return + } + + d := json.NewDecoder(req.Body) + rawReqBody := json.RawMessage{} + if err := d.Decode(&rawReqBody); err != nil { + s.handleRequestBodyError(ctx, resp, "the json request could not be decoded", err) + return + } + reqContent := new(ListAgentsRequest) + unmarshaler := protojson.UnmarshalOptions{DiscardUnknown: true} + if err = unmarshaler.Unmarshal(rawReqBody, reqContent); err != nil { + s.handleRequestBodyError(ctx, resp, "the json request could not be decoded", err) + return + } + + handler := s.CloudAgent.ListAgents + if s.interceptor != nil { + handler = func(ctx context.Context, req *ListAgentsRequest) (*ListAgentsResponse, error) { + resp, err := s.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*ListAgentsRequest) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*ListAgentsRequest) when calling interceptor") + } + return s.CloudAgent.ListAgents(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*ListAgentsResponse) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*ListAgentsResponse) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + + // Call service method + var respContent *ListAgentsResponse + func() { + defer ensurePanicResponses(ctx, resp, s.hooks) + respContent, err = handler(ctx, reqContent) + }() + + if err != nil { + s.writeError(ctx, resp, err) + return + } + if respContent == nil { + s.writeError(ctx, resp, twirp.InternalError("received a nil *ListAgentsResponse and nil error while calling ListAgents. nil responses are not supported")) + return + } + + ctx = callResponsePrepared(ctx, s.hooks) + + marshaler := &protojson.MarshalOptions{UseProtoNames: !s.jsonCamelCase, EmitUnpopulated: !s.jsonSkipDefaults} + respBytes, err := marshaler.Marshal(respContent) + if err != nil { + s.writeError(ctx, resp, wrapInternal(err, "failed to marshal json response")) + return + } + + ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK) + resp.Header().Set("Content-Type", "application/json") + resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes))) + resp.WriteHeader(http.StatusOK) + + if n, err := resp.Write(respBytes); err != nil { + msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error()) + twerr := twirp.NewError(twirp.Unknown, msg) + ctx = callError(ctx, s.hooks, twerr) + } + callResponseSent(ctx, s.hooks) +} + +func (s *cloudAgentServer) serveListAgentsProtobuf(ctx context.Context, resp http.ResponseWriter, req *http.Request) { + var err error + ctx = ctxsetters.WithMethodName(ctx, "ListAgents") + ctx, err = callRequestRouted(ctx, s.hooks) + if err != nil { + s.writeError(ctx, resp, err) + return + } + + buf, err := io.ReadAll(req.Body) + if err != nil { + s.handleRequestBodyError(ctx, resp, "failed to read request body", err) + return + } + reqContent := new(ListAgentsRequest) + if err = proto.Unmarshal(buf, reqContent); err != nil { + s.writeError(ctx, resp, malformedRequestError("the protobuf request could not be decoded")) + return + } + + handler := s.CloudAgent.ListAgents + if s.interceptor != nil { + handler = func(ctx context.Context, req *ListAgentsRequest) (*ListAgentsResponse, error) { + resp, err := s.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*ListAgentsRequest) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*ListAgentsRequest) when calling interceptor") + } + return s.CloudAgent.ListAgents(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*ListAgentsResponse) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*ListAgentsResponse) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + + // Call service method + var respContent *ListAgentsResponse + func() { + defer ensurePanicResponses(ctx, resp, s.hooks) + respContent, err = handler(ctx, reqContent) + }() + + if err != nil { + s.writeError(ctx, resp, err) + return + } + if respContent == nil { + s.writeError(ctx, resp, twirp.InternalError("received a nil *ListAgentsResponse and nil error while calling ListAgents. nil responses are not supported")) + return + } + + ctx = callResponsePrepared(ctx, s.hooks) + + respBytes, err := proto.Marshal(respContent) + if err != nil { + s.writeError(ctx, resp, wrapInternal(err, "failed to marshal proto response")) + return + } + + ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK) + resp.Header().Set("Content-Type", "application/protobuf") + resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes))) + resp.WriteHeader(http.StatusOK) + if n, err := resp.Write(respBytes); err != nil { + msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error()) + twerr := twirp.NewError(twirp.Unknown, msg) + ctx = callError(ctx, s.hooks, twerr) + } + callResponseSent(ctx, s.hooks) +} + +func (s *cloudAgentServer) serveListAgentVersions(ctx context.Context, resp http.ResponseWriter, req *http.Request) { + header := req.Header.Get("Content-Type") + i := strings.Index(header, ";") + if i == -1 { + i = len(header) + } + switch strings.TrimSpace(strings.ToLower(header[:i])) { + case "application/json": + s.serveListAgentVersionsJSON(ctx, resp, req) + case "application/protobuf": + s.serveListAgentVersionsProtobuf(ctx, resp, req) + default: + msg := fmt.Sprintf("unexpected Content-Type: %q", req.Header.Get("Content-Type")) + twerr := badRouteError(msg, req.Method, req.URL.Path) + s.writeError(ctx, resp, twerr) + } +} + +func (s *cloudAgentServer) serveListAgentVersionsJSON(ctx context.Context, resp http.ResponseWriter, req *http.Request) { + var err error + ctx = ctxsetters.WithMethodName(ctx, "ListAgentVersions") + ctx, err = callRequestRouted(ctx, s.hooks) + if err != nil { + s.writeError(ctx, resp, err) + return + } + + d := json.NewDecoder(req.Body) + rawReqBody := json.RawMessage{} + if err := d.Decode(&rawReqBody); err != nil { + s.handleRequestBodyError(ctx, resp, "the json request could not be decoded", err) + return + } + reqContent := new(ListAgentVersionsRequest) + unmarshaler := protojson.UnmarshalOptions{DiscardUnknown: true} + if err = unmarshaler.Unmarshal(rawReqBody, reqContent); err != nil { + s.handleRequestBodyError(ctx, resp, "the json request could not be decoded", err) + return + } + + handler := s.CloudAgent.ListAgentVersions + if s.interceptor != nil { + handler = func(ctx context.Context, req *ListAgentVersionsRequest) (*ListAgentVersionsResponse, error) { + resp, err := s.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*ListAgentVersionsRequest) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*ListAgentVersionsRequest) when calling interceptor") + } + return s.CloudAgent.ListAgentVersions(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*ListAgentVersionsResponse) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*ListAgentVersionsResponse) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + + // Call service method + var respContent *ListAgentVersionsResponse + func() { + defer ensurePanicResponses(ctx, resp, s.hooks) + respContent, err = handler(ctx, reqContent) + }() + + if err != nil { + s.writeError(ctx, resp, err) + return + } + if respContent == nil { + s.writeError(ctx, resp, twirp.InternalError("received a nil *ListAgentVersionsResponse and nil error while calling ListAgentVersions. nil responses are not supported")) + return + } + + ctx = callResponsePrepared(ctx, s.hooks) + + marshaler := &protojson.MarshalOptions{UseProtoNames: !s.jsonCamelCase, EmitUnpopulated: !s.jsonSkipDefaults} + respBytes, err := marshaler.Marshal(respContent) + if err != nil { + s.writeError(ctx, resp, wrapInternal(err, "failed to marshal json response")) + return + } + + ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK) + resp.Header().Set("Content-Type", "application/json") + resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes))) + resp.WriteHeader(http.StatusOK) + + if n, err := resp.Write(respBytes); err != nil { + msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error()) + twerr := twirp.NewError(twirp.Unknown, msg) + ctx = callError(ctx, s.hooks, twerr) + } + callResponseSent(ctx, s.hooks) +} + +func (s *cloudAgentServer) serveListAgentVersionsProtobuf(ctx context.Context, resp http.ResponseWriter, req *http.Request) { + var err error + ctx = ctxsetters.WithMethodName(ctx, "ListAgentVersions") + ctx, err = callRequestRouted(ctx, s.hooks) + if err != nil { + s.writeError(ctx, resp, err) + return + } + + buf, err := io.ReadAll(req.Body) + if err != nil { + s.handleRequestBodyError(ctx, resp, "failed to read request body", err) + return + } + reqContent := new(ListAgentVersionsRequest) + if err = proto.Unmarshal(buf, reqContent); err != nil { + s.writeError(ctx, resp, malformedRequestError("the protobuf request could not be decoded")) + return + } + + handler := s.CloudAgent.ListAgentVersions + if s.interceptor != nil { + handler = func(ctx context.Context, req *ListAgentVersionsRequest) (*ListAgentVersionsResponse, error) { + resp, err := s.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*ListAgentVersionsRequest) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*ListAgentVersionsRequest) when calling interceptor") + } + return s.CloudAgent.ListAgentVersions(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*ListAgentVersionsResponse) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*ListAgentVersionsResponse) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + + // Call service method + var respContent *ListAgentVersionsResponse + func() { + defer ensurePanicResponses(ctx, resp, s.hooks) + respContent, err = handler(ctx, reqContent) + }() + + if err != nil { + s.writeError(ctx, resp, err) + return + } + if respContent == nil { + s.writeError(ctx, resp, twirp.InternalError("received a nil *ListAgentVersionsResponse and nil error while calling ListAgentVersions. nil responses are not supported")) + return + } + + ctx = callResponsePrepared(ctx, s.hooks) + + respBytes, err := proto.Marshal(respContent) + if err != nil { + s.writeError(ctx, resp, wrapInternal(err, "failed to marshal proto response")) + return + } + + ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK) + resp.Header().Set("Content-Type", "application/protobuf") + resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes))) + resp.WriteHeader(http.StatusOK) + if n, err := resp.Write(respBytes); err != nil { + msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error()) + twerr := twirp.NewError(twirp.Unknown, msg) + ctx = callError(ctx, s.hooks, twerr) + } + callResponseSent(ctx, s.hooks) +} + +func (s *cloudAgentServer) serveListAgentSecrets(ctx context.Context, resp http.ResponseWriter, req *http.Request) { + header := req.Header.Get("Content-Type") + i := strings.Index(header, ";") + if i == -1 { + i = len(header) + } + switch strings.TrimSpace(strings.ToLower(header[:i])) { + case "application/json": + s.serveListAgentSecretsJSON(ctx, resp, req) + case "application/protobuf": + s.serveListAgentSecretsProtobuf(ctx, resp, req) + default: + msg := fmt.Sprintf("unexpected Content-Type: %q", req.Header.Get("Content-Type")) + twerr := badRouteError(msg, req.Method, req.URL.Path) + s.writeError(ctx, resp, twerr) + } +} + +func (s *cloudAgentServer) serveListAgentSecretsJSON(ctx context.Context, resp http.ResponseWriter, req *http.Request) { + var err error + ctx = ctxsetters.WithMethodName(ctx, "ListAgentSecrets") + ctx, err = callRequestRouted(ctx, s.hooks) + if err != nil { + s.writeError(ctx, resp, err) + return + } + + d := json.NewDecoder(req.Body) + rawReqBody := json.RawMessage{} + if err := d.Decode(&rawReqBody); err != nil { + s.handleRequestBodyError(ctx, resp, "the json request could not be decoded", err) + return + } + reqContent := new(ListAgentSecretsRequest) + unmarshaler := protojson.UnmarshalOptions{DiscardUnknown: true} + if err = unmarshaler.Unmarshal(rawReqBody, reqContent); err != nil { + s.handleRequestBodyError(ctx, resp, "the json request could not be decoded", err) + return + } + + handler := s.CloudAgent.ListAgentSecrets + if s.interceptor != nil { + handler = func(ctx context.Context, req *ListAgentSecretsRequest) (*ListAgentSecretsResponse, error) { + resp, err := s.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*ListAgentSecretsRequest) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*ListAgentSecretsRequest) when calling interceptor") + } + return s.CloudAgent.ListAgentSecrets(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*ListAgentSecretsResponse) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*ListAgentSecretsResponse) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + + // Call service method + var respContent *ListAgentSecretsResponse + func() { + defer ensurePanicResponses(ctx, resp, s.hooks) + respContent, err = handler(ctx, reqContent) + }() + + if err != nil { + s.writeError(ctx, resp, err) + return + } + if respContent == nil { + s.writeError(ctx, resp, twirp.InternalError("received a nil *ListAgentSecretsResponse and nil error while calling ListAgentSecrets. nil responses are not supported")) + return + } + + ctx = callResponsePrepared(ctx, s.hooks) + + marshaler := &protojson.MarshalOptions{UseProtoNames: !s.jsonCamelCase, EmitUnpopulated: !s.jsonSkipDefaults} + respBytes, err := marshaler.Marshal(respContent) + if err != nil { + s.writeError(ctx, resp, wrapInternal(err, "failed to marshal json response")) + return + } + + ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK) + resp.Header().Set("Content-Type", "application/json") + resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes))) + resp.WriteHeader(http.StatusOK) + + if n, err := resp.Write(respBytes); err != nil { + msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error()) + twerr := twirp.NewError(twirp.Unknown, msg) + ctx = callError(ctx, s.hooks, twerr) + } + callResponseSent(ctx, s.hooks) +} + +func (s *cloudAgentServer) serveListAgentSecretsProtobuf(ctx context.Context, resp http.ResponseWriter, req *http.Request) { + var err error + ctx = ctxsetters.WithMethodName(ctx, "ListAgentSecrets") + ctx, err = callRequestRouted(ctx, s.hooks) + if err != nil { + s.writeError(ctx, resp, err) + return + } + + buf, err := io.ReadAll(req.Body) + if err != nil { + s.handleRequestBodyError(ctx, resp, "failed to read request body", err) + return + } + reqContent := new(ListAgentSecretsRequest) + if err = proto.Unmarshal(buf, reqContent); err != nil { + s.writeError(ctx, resp, malformedRequestError("the protobuf request could not be decoded")) + return + } + + handler := s.CloudAgent.ListAgentSecrets + if s.interceptor != nil { + handler = func(ctx context.Context, req *ListAgentSecretsRequest) (*ListAgentSecretsResponse, error) { + resp, err := s.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*ListAgentSecretsRequest) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*ListAgentSecretsRequest) when calling interceptor") + } + return s.CloudAgent.ListAgentSecrets(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*ListAgentSecretsResponse) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*ListAgentSecretsResponse) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + + // Call service method + var respContent *ListAgentSecretsResponse + func() { + defer ensurePanicResponses(ctx, resp, s.hooks) + respContent, err = handler(ctx, reqContent) + }() + + if err != nil { + s.writeError(ctx, resp, err) + return + } + if respContent == nil { + s.writeError(ctx, resp, twirp.InternalError("received a nil *ListAgentSecretsResponse and nil error while calling ListAgentSecrets. nil responses are not supported")) + return + } + + ctx = callResponsePrepared(ctx, s.hooks) + + respBytes, err := proto.Marshal(respContent) + if err != nil { + s.writeError(ctx, resp, wrapInternal(err, "failed to marshal proto response")) + return + } + + ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK) + resp.Header().Set("Content-Type", "application/protobuf") + resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes))) + resp.WriteHeader(http.StatusOK) + if n, err := resp.Write(respBytes); err != nil { + msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error()) + twerr := twirp.NewError(twirp.Unknown, msg) + ctx = callError(ctx, s.hooks, twerr) + } + callResponseSent(ctx, s.hooks) +} + +func (s *cloudAgentServer) serveUpdateAgent(ctx context.Context, resp http.ResponseWriter, req *http.Request) { + header := req.Header.Get("Content-Type") + i := strings.Index(header, ";") + if i == -1 { + i = len(header) + } + switch strings.TrimSpace(strings.ToLower(header[:i])) { + case "application/json": + s.serveUpdateAgentJSON(ctx, resp, req) + case "application/protobuf": + s.serveUpdateAgentProtobuf(ctx, resp, req) + default: + msg := fmt.Sprintf("unexpected Content-Type: %q", req.Header.Get("Content-Type")) + twerr := badRouteError(msg, req.Method, req.URL.Path) + s.writeError(ctx, resp, twerr) + } +} + +func (s *cloudAgentServer) serveUpdateAgentJSON(ctx context.Context, resp http.ResponseWriter, req *http.Request) { + var err error + ctx = ctxsetters.WithMethodName(ctx, "UpdateAgent") + ctx, err = callRequestRouted(ctx, s.hooks) + if err != nil { + s.writeError(ctx, resp, err) + return + } + + d := json.NewDecoder(req.Body) + rawReqBody := json.RawMessage{} + if err := d.Decode(&rawReqBody); err != nil { + s.handleRequestBodyError(ctx, resp, "the json request could not be decoded", err) + return + } + reqContent := new(UpdateAgentRequest) + unmarshaler := protojson.UnmarshalOptions{DiscardUnknown: true} + if err = unmarshaler.Unmarshal(rawReqBody, reqContent); err != nil { + s.handleRequestBodyError(ctx, resp, "the json request could not be decoded", err) + return + } + + handler := s.CloudAgent.UpdateAgent + if s.interceptor != nil { + handler = func(ctx context.Context, req *UpdateAgentRequest) (*UpdateAgentResponse, error) { + resp, err := s.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*UpdateAgentRequest) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*UpdateAgentRequest) when calling interceptor") + } + return s.CloudAgent.UpdateAgent(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*UpdateAgentResponse) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*UpdateAgentResponse) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + + // Call service method + var respContent *UpdateAgentResponse + func() { + defer ensurePanicResponses(ctx, resp, s.hooks) + respContent, err = handler(ctx, reqContent) + }() + + if err != nil { + s.writeError(ctx, resp, err) + return + } + if respContent == nil { + s.writeError(ctx, resp, twirp.InternalError("received a nil *UpdateAgentResponse and nil error while calling UpdateAgent. nil responses are not supported")) + return + } + + ctx = callResponsePrepared(ctx, s.hooks) + + marshaler := &protojson.MarshalOptions{UseProtoNames: !s.jsonCamelCase, EmitUnpopulated: !s.jsonSkipDefaults} + respBytes, err := marshaler.Marshal(respContent) + if err != nil { + s.writeError(ctx, resp, wrapInternal(err, "failed to marshal json response")) + return + } + + ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK) + resp.Header().Set("Content-Type", "application/json") + resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes))) + resp.WriteHeader(http.StatusOK) + + if n, err := resp.Write(respBytes); err != nil { + msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error()) + twerr := twirp.NewError(twirp.Unknown, msg) + ctx = callError(ctx, s.hooks, twerr) + } + callResponseSent(ctx, s.hooks) +} + +func (s *cloudAgentServer) serveUpdateAgentProtobuf(ctx context.Context, resp http.ResponseWriter, req *http.Request) { + var err error + ctx = ctxsetters.WithMethodName(ctx, "UpdateAgent") + ctx, err = callRequestRouted(ctx, s.hooks) + if err != nil { + s.writeError(ctx, resp, err) + return + } + + buf, err := io.ReadAll(req.Body) + if err != nil { + s.handleRequestBodyError(ctx, resp, "failed to read request body", err) + return + } + reqContent := new(UpdateAgentRequest) + if err = proto.Unmarshal(buf, reqContent); err != nil { + s.writeError(ctx, resp, malformedRequestError("the protobuf request could not be decoded")) + return + } + + handler := s.CloudAgent.UpdateAgent + if s.interceptor != nil { + handler = func(ctx context.Context, req *UpdateAgentRequest) (*UpdateAgentResponse, error) { + resp, err := s.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*UpdateAgentRequest) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*UpdateAgentRequest) when calling interceptor") + } + return s.CloudAgent.UpdateAgent(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*UpdateAgentResponse) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*UpdateAgentResponse) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + + // Call service method + var respContent *UpdateAgentResponse + func() { + defer ensurePanicResponses(ctx, resp, s.hooks) + respContent, err = handler(ctx, reqContent) + }() + + if err != nil { + s.writeError(ctx, resp, err) + return + } + if respContent == nil { + s.writeError(ctx, resp, twirp.InternalError("received a nil *UpdateAgentResponse and nil error while calling UpdateAgent. nil responses are not supported")) + return + } + + ctx = callResponsePrepared(ctx, s.hooks) + + respBytes, err := proto.Marshal(respContent) + if err != nil { + s.writeError(ctx, resp, wrapInternal(err, "failed to marshal proto response")) + return + } + + ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK) + resp.Header().Set("Content-Type", "application/protobuf") + resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes))) + resp.WriteHeader(http.StatusOK) + if n, err := resp.Write(respBytes); err != nil { + msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error()) + twerr := twirp.NewError(twirp.Unknown, msg) + ctx = callError(ctx, s.hooks, twerr) + } + callResponseSent(ctx, s.hooks) +} + +func (s *cloudAgentServer) serveRestartAgent(ctx context.Context, resp http.ResponseWriter, req *http.Request) { + header := req.Header.Get("Content-Type") + i := strings.Index(header, ";") + if i == -1 { + i = len(header) + } + switch strings.TrimSpace(strings.ToLower(header[:i])) { + case "application/json": + s.serveRestartAgentJSON(ctx, resp, req) + case "application/protobuf": + s.serveRestartAgentProtobuf(ctx, resp, req) + default: + msg := fmt.Sprintf("unexpected Content-Type: %q", req.Header.Get("Content-Type")) + twerr := badRouteError(msg, req.Method, req.URL.Path) + s.writeError(ctx, resp, twerr) + } +} + +func (s *cloudAgentServer) serveRestartAgentJSON(ctx context.Context, resp http.ResponseWriter, req *http.Request) { + var err error + ctx = ctxsetters.WithMethodName(ctx, "RestartAgent") + ctx, err = callRequestRouted(ctx, s.hooks) + if err != nil { + s.writeError(ctx, resp, err) + return + } + + d := json.NewDecoder(req.Body) + rawReqBody := json.RawMessage{} + if err := d.Decode(&rawReqBody); err != nil { + s.handleRequestBodyError(ctx, resp, "the json request could not be decoded", err) + return + } + reqContent := new(RestartAgentRequest) + unmarshaler := protojson.UnmarshalOptions{DiscardUnknown: true} + if err = unmarshaler.Unmarshal(rawReqBody, reqContent); err != nil { + s.handleRequestBodyError(ctx, resp, "the json request could not be decoded", err) + return + } + + handler := s.CloudAgent.RestartAgent + if s.interceptor != nil { + handler = func(ctx context.Context, req *RestartAgentRequest) (*RestartAgentResponse, error) { + resp, err := s.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*RestartAgentRequest) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*RestartAgentRequest) when calling interceptor") + } + return s.CloudAgent.RestartAgent(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*RestartAgentResponse) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*RestartAgentResponse) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + + // Call service method + var respContent *RestartAgentResponse + func() { + defer ensurePanicResponses(ctx, resp, s.hooks) + respContent, err = handler(ctx, reqContent) + }() + + if err != nil { + s.writeError(ctx, resp, err) + return + } + if respContent == nil { + s.writeError(ctx, resp, twirp.InternalError("received a nil *RestartAgentResponse and nil error while calling RestartAgent. nil responses are not supported")) + return + } + + ctx = callResponsePrepared(ctx, s.hooks) + + marshaler := &protojson.MarshalOptions{UseProtoNames: !s.jsonCamelCase, EmitUnpopulated: !s.jsonSkipDefaults} + respBytes, err := marshaler.Marshal(respContent) + if err != nil { + s.writeError(ctx, resp, wrapInternal(err, "failed to marshal json response")) + return + } + + ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK) + resp.Header().Set("Content-Type", "application/json") + resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes))) + resp.WriteHeader(http.StatusOK) + + if n, err := resp.Write(respBytes); err != nil { + msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error()) + twerr := twirp.NewError(twirp.Unknown, msg) + ctx = callError(ctx, s.hooks, twerr) + } + callResponseSent(ctx, s.hooks) +} + +func (s *cloudAgentServer) serveRestartAgentProtobuf(ctx context.Context, resp http.ResponseWriter, req *http.Request) { + var err error + ctx = ctxsetters.WithMethodName(ctx, "RestartAgent") + ctx, err = callRequestRouted(ctx, s.hooks) + if err != nil { + s.writeError(ctx, resp, err) + return + } + + buf, err := io.ReadAll(req.Body) + if err != nil { + s.handleRequestBodyError(ctx, resp, "failed to read request body", err) + return + } + reqContent := new(RestartAgentRequest) + if err = proto.Unmarshal(buf, reqContent); err != nil { + s.writeError(ctx, resp, malformedRequestError("the protobuf request could not be decoded")) + return + } + + handler := s.CloudAgent.RestartAgent + if s.interceptor != nil { + handler = func(ctx context.Context, req *RestartAgentRequest) (*RestartAgentResponse, error) { + resp, err := s.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*RestartAgentRequest) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*RestartAgentRequest) when calling interceptor") + } + return s.CloudAgent.RestartAgent(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*RestartAgentResponse) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*RestartAgentResponse) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + + // Call service method + var respContent *RestartAgentResponse + func() { + defer ensurePanicResponses(ctx, resp, s.hooks) + respContent, err = handler(ctx, reqContent) + }() + + if err != nil { + s.writeError(ctx, resp, err) + return + } + if respContent == nil { + s.writeError(ctx, resp, twirp.InternalError("received a nil *RestartAgentResponse and nil error while calling RestartAgent. nil responses are not supported")) + return + } + + ctx = callResponsePrepared(ctx, s.hooks) + + respBytes, err := proto.Marshal(respContent) + if err != nil { + s.writeError(ctx, resp, wrapInternal(err, "failed to marshal proto response")) + return + } + + ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK) + resp.Header().Set("Content-Type", "application/protobuf") + resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes))) + resp.WriteHeader(http.StatusOK) + if n, err := resp.Write(respBytes); err != nil { + msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error()) + twerr := twirp.NewError(twirp.Unknown, msg) + ctx = callError(ctx, s.hooks, twerr) + } + callResponseSent(ctx, s.hooks) +} + +func (s *cloudAgentServer) serveDeployAgent(ctx context.Context, resp http.ResponseWriter, req *http.Request) { + header := req.Header.Get("Content-Type") + i := strings.Index(header, ";") + if i == -1 { + i = len(header) + } + switch strings.TrimSpace(strings.ToLower(header[:i])) { + case "application/json": + s.serveDeployAgentJSON(ctx, resp, req) + case "application/protobuf": + s.serveDeployAgentProtobuf(ctx, resp, req) + default: + msg := fmt.Sprintf("unexpected Content-Type: %q", req.Header.Get("Content-Type")) + twerr := badRouteError(msg, req.Method, req.URL.Path) + s.writeError(ctx, resp, twerr) + } +} + +func (s *cloudAgentServer) serveDeployAgentJSON(ctx context.Context, resp http.ResponseWriter, req *http.Request) { + var err error + ctx = ctxsetters.WithMethodName(ctx, "DeployAgent") + ctx, err = callRequestRouted(ctx, s.hooks) + if err != nil { + s.writeError(ctx, resp, err) + return + } + + d := json.NewDecoder(req.Body) + rawReqBody := json.RawMessage{} + if err := d.Decode(&rawReqBody); err != nil { + s.handleRequestBodyError(ctx, resp, "the json request could not be decoded", err) + return + } + reqContent := new(DeployAgentRequest) + unmarshaler := protojson.UnmarshalOptions{DiscardUnknown: true} + if err = unmarshaler.Unmarshal(rawReqBody, reqContent); err != nil { + s.handleRequestBodyError(ctx, resp, "the json request could not be decoded", err) + return + } + + handler := s.CloudAgent.DeployAgent + if s.interceptor != nil { + handler = func(ctx context.Context, req *DeployAgentRequest) (*DeployAgentResponse, error) { + resp, err := s.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*DeployAgentRequest) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*DeployAgentRequest) when calling interceptor") + } + return s.CloudAgent.DeployAgent(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*DeployAgentResponse) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*DeployAgentResponse) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + + // Call service method + var respContent *DeployAgentResponse + func() { + defer ensurePanicResponses(ctx, resp, s.hooks) + respContent, err = handler(ctx, reqContent) + }() + + if err != nil { + s.writeError(ctx, resp, err) + return + } + if respContent == nil { + s.writeError(ctx, resp, twirp.InternalError("received a nil *DeployAgentResponse and nil error while calling DeployAgent. nil responses are not supported")) + return + } + + ctx = callResponsePrepared(ctx, s.hooks) + + marshaler := &protojson.MarshalOptions{UseProtoNames: !s.jsonCamelCase, EmitUnpopulated: !s.jsonSkipDefaults} + respBytes, err := marshaler.Marshal(respContent) + if err != nil { + s.writeError(ctx, resp, wrapInternal(err, "failed to marshal json response")) + return + } + + ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK) + resp.Header().Set("Content-Type", "application/json") + resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes))) + resp.WriteHeader(http.StatusOK) + + if n, err := resp.Write(respBytes); err != nil { + msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error()) + twerr := twirp.NewError(twirp.Unknown, msg) + ctx = callError(ctx, s.hooks, twerr) + } + callResponseSent(ctx, s.hooks) +} + +func (s *cloudAgentServer) serveDeployAgentProtobuf(ctx context.Context, resp http.ResponseWriter, req *http.Request) { + var err error + ctx = ctxsetters.WithMethodName(ctx, "DeployAgent") + ctx, err = callRequestRouted(ctx, s.hooks) + if err != nil { + s.writeError(ctx, resp, err) + return + } + + buf, err := io.ReadAll(req.Body) + if err != nil { + s.handleRequestBodyError(ctx, resp, "failed to read request body", err) + return + } + reqContent := new(DeployAgentRequest) + if err = proto.Unmarshal(buf, reqContent); err != nil { + s.writeError(ctx, resp, malformedRequestError("the protobuf request could not be decoded")) + return + } + + handler := s.CloudAgent.DeployAgent + if s.interceptor != nil { + handler = func(ctx context.Context, req *DeployAgentRequest) (*DeployAgentResponse, error) { + resp, err := s.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*DeployAgentRequest) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*DeployAgentRequest) when calling interceptor") + } + return s.CloudAgent.DeployAgent(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*DeployAgentResponse) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*DeployAgentResponse) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + + // Call service method + var respContent *DeployAgentResponse + func() { + defer ensurePanicResponses(ctx, resp, s.hooks) + respContent, err = handler(ctx, reqContent) + }() + + if err != nil { + s.writeError(ctx, resp, err) + return + } + if respContent == nil { + s.writeError(ctx, resp, twirp.InternalError("received a nil *DeployAgentResponse and nil error while calling DeployAgent. nil responses are not supported")) + return + } + + ctx = callResponsePrepared(ctx, s.hooks) + + respBytes, err := proto.Marshal(respContent) + if err != nil { + s.writeError(ctx, resp, wrapInternal(err, "failed to marshal proto response")) + return + } + + ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK) + resp.Header().Set("Content-Type", "application/protobuf") + resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes))) + resp.WriteHeader(http.StatusOK) + if n, err := resp.Write(respBytes); err != nil { + msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error()) + twerr := twirp.NewError(twirp.Unknown, msg) + ctx = callError(ctx, s.hooks, twerr) + } + callResponseSent(ctx, s.hooks) +} + +func (s *cloudAgentServer) serveDeployAgentV2(ctx context.Context, resp http.ResponseWriter, req *http.Request) { + header := req.Header.Get("Content-Type") + i := strings.Index(header, ";") + if i == -1 { + i = len(header) + } + switch strings.TrimSpace(strings.ToLower(header[:i])) { + case "application/json": + s.serveDeployAgentV2JSON(ctx, resp, req) + case "application/protobuf": + s.serveDeployAgentV2Protobuf(ctx, resp, req) + default: + msg := fmt.Sprintf("unexpected Content-Type: %q", req.Header.Get("Content-Type")) + twerr := badRouteError(msg, req.Method, req.URL.Path) + s.writeError(ctx, resp, twerr) + } +} + +func (s *cloudAgentServer) serveDeployAgentV2JSON(ctx context.Context, resp http.ResponseWriter, req *http.Request) { + var err error + ctx = ctxsetters.WithMethodName(ctx, "DeployAgentV2") + ctx, err = callRequestRouted(ctx, s.hooks) + if err != nil { + s.writeError(ctx, resp, err) + return + } + + d := json.NewDecoder(req.Body) + rawReqBody := json.RawMessage{} + if err := d.Decode(&rawReqBody); err != nil { + s.handleRequestBodyError(ctx, resp, "the json request could not be decoded", err) + return + } + reqContent := new(DeployAgentV2Request) + unmarshaler := protojson.UnmarshalOptions{DiscardUnknown: true} + if err = unmarshaler.Unmarshal(rawReqBody, reqContent); err != nil { + s.handleRequestBodyError(ctx, resp, "the json request could not be decoded", err) + return + } + + handler := s.CloudAgent.DeployAgentV2 + if s.interceptor != nil { + handler = func(ctx context.Context, req *DeployAgentV2Request) (*DeployAgentV2Response, error) { + resp, err := s.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*DeployAgentV2Request) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*DeployAgentV2Request) when calling interceptor") + } + return s.CloudAgent.DeployAgentV2(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*DeployAgentV2Response) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*DeployAgentV2Response) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + + // Call service method + var respContent *DeployAgentV2Response + func() { + defer ensurePanicResponses(ctx, resp, s.hooks) + respContent, err = handler(ctx, reqContent) + }() + + if err != nil { + s.writeError(ctx, resp, err) + return + } + if respContent == nil { + s.writeError(ctx, resp, twirp.InternalError("received a nil *DeployAgentV2Response and nil error while calling DeployAgentV2. nil responses are not supported")) + return + } + + ctx = callResponsePrepared(ctx, s.hooks) + + marshaler := &protojson.MarshalOptions{UseProtoNames: !s.jsonCamelCase, EmitUnpopulated: !s.jsonSkipDefaults} + respBytes, err := marshaler.Marshal(respContent) + if err != nil { + s.writeError(ctx, resp, wrapInternal(err, "failed to marshal json response")) + return + } + + ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK) + resp.Header().Set("Content-Type", "application/json") + resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes))) + resp.WriteHeader(http.StatusOK) + + if n, err := resp.Write(respBytes); err != nil { + msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error()) + twerr := twirp.NewError(twirp.Unknown, msg) + ctx = callError(ctx, s.hooks, twerr) + } + callResponseSent(ctx, s.hooks) +} + +func (s *cloudAgentServer) serveDeployAgentV2Protobuf(ctx context.Context, resp http.ResponseWriter, req *http.Request) { + var err error + ctx = ctxsetters.WithMethodName(ctx, "DeployAgentV2") + ctx, err = callRequestRouted(ctx, s.hooks) + if err != nil { + s.writeError(ctx, resp, err) + return + } + + buf, err := io.ReadAll(req.Body) + if err != nil { + s.handleRequestBodyError(ctx, resp, "failed to read request body", err) + return + } + reqContent := new(DeployAgentV2Request) + if err = proto.Unmarshal(buf, reqContent); err != nil { + s.writeError(ctx, resp, malformedRequestError("the protobuf request could not be decoded")) + return + } + + handler := s.CloudAgent.DeployAgentV2 + if s.interceptor != nil { + handler = func(ctx context.Context, req *DeployAgentV2Request) (*DeployAgentV2Response, error) { + resp, err := s.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*DeployAgentV2Request) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*DeployAgentV2Request) when calling interceptor") + } + return s.CloudAgent.DeployAgentV2(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*DeployAgentV2Response) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*DeployAgentV2Response) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + + // Call service method + var respContent *DeployAgentV2Response + func() { + defer ensurePanicResponses(ctx, resp, s.hooks) + respContent, err = handler(ctx, reqContent) + }() + + if err != nil { + s.writeError(ctx, resp, err) + return + } + if respContent == nil { + s.writeError(ctx, resp, twirp.InternalError("received a nil *DeployAgentV2Response and nil error while calling DeployAgentV2. nil responses are not supported")) + return + } + + ctx = callResponsePrepared(ctx, s.hooks) + + respBytes, err := proto.Marshal(respContent) + if err != nil { + s.writeError(ctx, resp, wrapInternal(err, "failed to marshal proto response")) + return + } + + ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK) + resp.Header().Set("Content-Type", "application/protobuf") + resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes))) + resp.WriteHeader(http.StatusOK) + if n, err := resp.Write(respBytes); err != nil { + msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error()) + twerr := twirp.NewError(twirp.Unknown, msg) + ctx = callError(ctx, s.hooks, twerr) + } + callResponseSent(ctx, s.hooks) +} + +func (s *cloudAgentServer) serveUpdateAgentSecrets(ctx context.Context, resp http.ResponseWriter, req *http.Request) { + header := req.Header.Get("Content-Type") + i := strings.Index(header, ";") + if i == -1 { + i = len(header) + } + switch strings.TrimSpace(strings.ToLower(header[:i])) { + case "application/json": + s.serveUpdateAgentSecretsJSON(ctx, resp, req) + case "application/protobuf": + s.serveUpdateAgentSecretsProtobuf(ctx, resp, req) + default: + msg := fmt.Sprintf("unexpected Content-Type: %q", req.Header.Get("Content-Type")) + twerr := badRouteError(msg, req.Method, req.URL.Path) + s.writeError(ctx, resp, twerr) + } +} + +func (s *cloudAgentServer) serveUpdateAgentSecretsJSON(ctx context.Context, resp http.ResponseWriter, req *http.Request) { + var err error + ctx = ctxsetters.WithMethodName(ctx, "UpdateAgentSecrets") + ctx, err = callRequestRouted(ctx, s.hooks) + if err != nil { + s.writeError(ctx, resp, err) + return + } + + d := json.NewDecoder(req.Body) + rawReqBody := json.RawMessage{} + if err := d.Decode(&rawReqBody); err != nil { + s.handleRequestBodyError(ctx, resp, "the json request could not be decoded", err) + return + } + reqContent := new(UpdateAgentSecretsRequest) + unmarshaler := protojson.UnmarshalOptions{DiscardUnknown: true} + if err = unmarshaler.Unmarshal(rawReqBody, reqContent); err != nil { + s.handleRequestBodyError(ctx, resp, "the json request could not be decoded", err) + return + } + + handler := s.CloudAgent.UpdateAgentSecrets + if s.interceptor != nil { + handler = func(ctx context.Context, req *UpdateAgentSecretsRequest) (*UpdateAgentSecretsResponse, error) { + resp, err := s.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*UpdateAgentSecretsRequest) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*UpdateAgentSecretsRequest) when calling interceptor") + } + return s.CloudAgent.UpdateAgentSecrets(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*UpdateAgentSecretsResponse) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*UpdateAgentSecretsResponse) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + + // Call service method + var respContent *UpdateAgentSecretsResponse + func() { + defer ensurePanicResponses(ctx, resp, s.hooks) + respContent, err = handler(ctx, reqContent) + }() + + if err != nil { + s.writeError(ctx, resp, err) + return + } + if respContent == nil { + s.writeError(ctx, resp, twirp.InternalError("received a nil *UpdateAgentSecretsResponse and nil error while calling UpdateAgentSecrets. nil responses are not supported")) + return + } + + ctx = callResponsePrepared(ctx, s.hooks) + + marshaler := &protojson.MarshalOptions{UseProtoNames: !s.jsonCamelCase, EmitUnpopulated: !s.jsonSkipDefaults} + respBytes, err := marshaler.Marshal(respContent) + if err != nil { + s.writeError(ctx, resp, wrapInternal(err, "failed to marshal json response")) + return + } + + ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK) + resp.Header().Set("Content-Type", "application/json") + resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes))) + resp.WriteHeader(http.StatusOK) + + if n, err := resp.Write(respBytes); err != nil { + msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error()) + twerr := twirp.NewError(twirp.Unknown, msg) + ctx = callError(ctx, s.hooks, twerr) + } + callResponseSent(ctx, s.hooks) +} + +func (s *cloudAgentServer) serveUpdateAgentSecretsProtobuf(ctx context.Context, resp http.ResponseWriter, req *http.Request) { + var err error + ctx = ctxsetters.WithMethodName(ctx, "UpdateAgentSecrets") + ctx, err = callRequestRouted(ctx, s.hooks) + if err != nil { + s.writeError(ctx, resp, err) + return + } + + buf, err := io.ReadAll(req.Body) + if err != nil { + s.handleRequestBodyError(ctx, resp, "failed to read request body", err) + return + } + reqContent := new(UpdateAgentSecretsRequest) + if err = proto.Unmarshal(buf, reqContent); err != nil { + s.writeError(ctx, resp, malformedRequestError("the protobuf request could not be decoded")) + return + } + + handler := s.CloudAgent.UpdateAgentSecrets + if s.interceptor != nil { + handler = func(ctx context.Context, req *UpdateAgentSecretsRequest) (*UpdateAgentSecretsResponse, error) { + resp, err := s.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*UpdateAgentSecretsRequest) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*UpdateAgentSecretsRequest) when calling interceptor") + } + return s.CloudAgent.UpdateAgentSecrets(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*UpdateAgentSecretsResponse) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*UpdateAgentSecretsResponse) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + + // Call service method + var respContent *UpdateAgentSecretsResponse + func() { + defer ensurePanicResponses(ctx, resp, s.hooks) + respContent, err = handler(ctx, reqContent) + }() + + if err != nil { + s.writeError(ctx, resp, err) + return + } + if respContent == nil { + s.writeError(ctx, resp, twirp.InternalError("received a nil *UpdateAgentSecretsResponse and nil error while calling UpdateAgentSecrets. nil responses are not supported")) + return + } + + ctx = callResponsePrepared(ctx, s.hooks) + + respBytes, err := proto.Marshal(respContent) + if err != nil { + s.writeError(ctx, resp, wrapInternal(err, "failed to marshal proto response")) + return + } + + ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK) + resp.Header().Set("Content-Type", "application/protobuf") + resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes))) + resp.WriteHeader(http.StatusOK) + if n, err := resp.Write(respBytes); err != nil { + msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error()) + twerr := twirp.NewError(twirp.Unknown, msg) + ctx = callError(ctx, s.hooks, twerr) + } + callResponseSent(ctx, s.hooks) +} + +func (s *cloudAgentServer) serveRollbackAgent(ctx context.Context, resp http.ResponseWriter, req *http.Request) { + header := req.Header.Get("Content-Type") + i := strings.Index(header, ";") + if i == -1 { + i = len(header) + } + switch strings.TrimSpace(strings.ToLower(header[:i])) { + case "application/json": + s.serveRollbackAgentJSON(ctx, resp, req) + case "application/protobuf": + s.serveRollbackAgentProtobuf(ctx, resp, req) + default: + msg := fmt.Sprintf("unexpected Content-Type: %q", req.Header.Get("Content-Type")) + twerr := badRouteError(msg, req.Method, req.URL.Path) + s.writeError(ctx, resp, twerr) + } +} + +func (s *cloudAgentServer) serveRollbackAgentJSON(ctx context.Context, resp http.ResponseWriter, req *http.Request) { + var err error + ctx = ctxsetters.WithMethodName(ctx, "RollbackAgent") + ctx, err = callRequestRouted(ctx, s.hooks) + if err != nil { + s.writeError(ctx, resp, err) + return + } + + d := json.NewDecoder(req.Body) + rawReqBody := json.RawMessage{} + if err := d.Decode(&rawReqBody); err != nil { + s.handleRequestBodyError(ctx, resp, "the json request could not be decoded", err) + return + } + reqContent := new(RollbackAgentRequest) + unmarshaler := protojson.UnmarshalOptions{DiscardUnknown: true} + if err = unmarshaler.Unmarshal(rawReqBody, reqContent); err != nil { + s.handleRequestBodyError(ctx, resp, "the json request could not be decoded", err) + return + } + + handler := s.CloudAgent.RollbackAgent + if s.interceptor != nil { + handler = func(ctx context.Context, req *RollbackAgentRequest) (*RollbackAgentResponse, error) { + resp, err := s.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*RollbackAgentRequest) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*RollbackAgentRequest) when calling interceptor") + } + return s.CloudAgent.RollbackAgent(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*RollbackAgentResponse) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*RollbackAgentResponse) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + + // Call service method + var respContent *RollbackAgentResponse + func() { + defer ensurePanicResponses(ctx, resp, s.hooks) + respContent, err = handler(ctx, reqContent) + }() + + if err != nil { + s.writeError(ctx, resp, err) + return + } + if respContent == nil { + s.writeError(ctx, resp, twirp.InternalError("received a nil *RollbackAgentResponse and nil error while calling RollbackAgent. nil responses are not supported")) + return + } + + ctx = callResponsePrepared(ctx, s.hooks) + + marshaler := &protojson.MarshalOptions{UseProtoNames: !s.jsonCamelCase, EmitUnpopulated: !s.jsonSkipDefaults} + respBytes, err := marshaler.Marshal(respContent) + if err != nil { + s.writeError(ctx, resp, wrapInternal(err, "failed to marshal json response")) + return + } + + ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK) + resp.Header().Set("Content-Type", "application/json") + resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes))) + resp.WriteHeader(http.StatusOK) + + if n, err := resp.Write(respBytes); err != nil { + msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error()) + twerr := twirp.NewError(twirp.Unknown, msg) + ctx = callError(ctx, s.hooks, twerr) + } + callResponseSent(ctx, s.hooks) +} + +func (s *cloudAgentServer) serveRollbackAgentProtobuf(ctx context.Context, resp http.ResponseWriter, req *http.Request) { + var err error + ctx = ctxsetters.WithMethodName(ctx, "RollbackAgent") + ctx, err = callRequestRouted(ctx, s.hooks) + if err != nil { + s.writeError(ctx, resp, err) + return + } + + buf, err := io.ReadAll(req.Body) + if err != nil { + s.handleRequestBodyError(ctx, resp, "failed to read request body", err) + return + } + reqContent := new(RollbackAgentRequest) + if err = proto.Unmarshal(buf, reqContent); err != nil { + s.writeError(ctx, resp, malformedRequestError("the protobuf request could not be decoded")) + return + } + + handler := s.CloudAgent.RollbackAgent + if s.interceptor != nil { + handler = func(ctx context.Context, req *RollbackAgentRequest) (*RollbackAgentResponse, error) { + resp, err := s.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*RollbackAgentRequest) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*RollbackAgentRequest) when calling interceptor") + } + return s.CloudAgent.RollbackAgent(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*RollbackAgentResponse) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*RollbackAgentResponse) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + + // Call service method + var respContent *RollbackAgentResponse + func() { + defer ensurePanicResponses(ctx, resp, s.hooks) + respContent, err = handler(ctx, reqContent) + }() + + if err != nil { + s.writeError(ctx, resp, err) + return + } + if respContent == nil { + s.writeError(ctx, resp, twirp.InternalError("received a nil *RollbackAgentResponse and nil error while calling RollbackAgent. nil responses are not supported")) + return + } + + ctx = callResponsePrepared(ctx, s.hooks) + + respBytes, err := proto.Marshal(respContent) + if err != nil { + s.writeError(ctx, resp, wrapInternal(err, "failed to marshal proto response")) + return + } + + ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK) + resp.Header().Set("Content-Type", "application/protobuf") + resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes))) + resp.WriteHeader(http.StatusOK) + if n, err := resp.Write(respBytes); err != nil { + msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error()) + twerr := twirp.NewError(twirp.Unknown, msg) + ctx = callError(ctx, s.hooks, twerr) + } + callResponseSent(ctx, s.hooks) +} + +func (s *cloudAgentServer) serveDeleteAgent(ctx context.Context, resp http.ResponseWriter, req *http.Request) { + header := req.Header.Get("Content-Type") + i := strings.Index(header, ";") + if i == -1 { + i = len(header) + } + switch strings.TrimSpace(strings.ToLower(header[:i])) { + case "application/json": + s.serveDeleteAgentJSON(ctx, resp, req) + case "application/protobuf": + s.serveDeleteAgentProtobuf(ctx, resp, req) + default: + msg := fmt.Sprintf("unexpected Content-Type: %q", req.Header.Get("Content-Type")) + twerr := badRouteError(msg, req.Method, req.URL.Path) + s.writeError(ctx, resp, twerr) + } +} + +func (s *cloudAgentServer) serveDeleteAgentJSON(ctx context.Context, resp http.ResponseWriter, req *http.Request) { + var err error + ctx = ctxsetters.WithMethodName(ctx, "DeleteAgent") + ctx, err = callRequestRouted(ctx, s.hooks) + if err != nil { + s.writeError(ctx, resp, err) + return + } + + d := json.NewDecoder(req.Body) + rawReqBody := json.RawMessage{} + if err := d.Decode(&rawReqBody); err != nil { + s.handleRequestBodyError(ctx, resp, "the json request could not be decoded", err) + return + } + reqContent := new(DeleteAgentRequest) + unmarshaler := protojson.UnmarshalOptions{DiscardUnknown: true} + if err = unmarshaler.Unmarshal(rawReqBody, reqContent); err != nil { + s.handleRequestBodyError(ctx, resp, "the json request could not be decoded", err) + return + } + + handler := s.CloudAgent.DeleteAgent + if s.interceptor != nil { + handler = func(ctx context.Context, req *DeleteAgentRequest) (*DeleteAgentResponse, error) { + resp, err := s.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*DeleteAgentRequest) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*DeleteAgentRequest) when calling interceptor") + } + return s.CloudAgent.DeleteAgent(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*DeleteAgentResponse) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*DeleteAgentResponse) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + + // Call service method + var respContent *DeleteAgentResponse + func() { + defer ensurePanicResponses(ctx, resp, s.hooks) + respContent, err = handler(ctx, reqContent) + }() + + if err != nil { + s.writeError(ctx, resp, err) + return + } + if respContent == nil { + s.writeError(ctx, resp, twirp.InternalError("received a nil *DeleteAgentResponse and nil error while calling DeleteAgent. nil responses are not supported")) + return + } + + ctx = callResponsePrepared(ctx, s.hooks) + + marshaler := &protojson.MarshalOptions{UseProtoNames: !s.jsonCamelCase, EmitUnpopulated: !s.jsonSkipDefaults} + respBytes, err := marshaler.Marshal(respContent) + if err != nil { + s.writeError(ctx, resp, wrapInternal(err, "failed to marshal json response")) + return + } + + ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK) + resp.Header().Set("Content-Type", "application/json") + resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes))) + resp.WriteHeader(http.StatusOK) + + if n, err := resp.Write(respBytes); err != nil { + msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error()) + twerr := twirp.NewError(twirp.Unknown, msg) + ctx = callError(ctx, s.hooks, twerr) + } + callResponseSent(ctx, s.hooks) +} + +func (s *cloudAgentServer) serveDeleteAgentProtobuf(ctx context.Context, resp http.ResponseWriter, req *http.Request) { + var err error + ctx = ctxsetters.WithMethodName(ctx, "DeleteAgent") + ctx, err = callRequestRouted(ctx, s.hooks) + if err != nil { + s.writeError(ctx, resp, err) + return + } + + buf, err := io.ReadAll(req.Body) + if err != nil { + s.handleRequestBodyError(ctx, resp, "failed to read request body", err) + return + } + reqContent := new(DeleteAgentRequest) + if err = proto.Unmarshal(buf, reqContent); err != nil { + s.writeError(ctx, resp, malformedRequestError("the protobuf request could not be decoded")) + return + } + + handler := s.CloudAgent.DeleteAgent + if s.interceptor != nil { + handler = func(ctx context.Context, req *DeleteAgentRequest) (*DeleteAgentResponse, error) { + resp, err := s.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*DeleteAgentRequest) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*DeleteAgentRequest) when calling interceptor") + } + return s.CloudAgent.DeleteAgent(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*DeleteAgentResponse) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*DeleteAgentResponse) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + + // Call service method + var respContent *DeleteAgentResponse + func() { + defer ensurePanicResponses(ctx, resp, s.hooks) + respContent, err = handler(ctx, reqContent) + }() + + if err != nil { + s.writeError(ctx, resp, err) + return + } + if respContent == nil { + s.writeError(ctx, resp, twirp.InternalError("received a nil *DeleteAgentResponse and nil error while calling DeleteAgent. nil responses are not supported")) + return + } + + ctx = callResponsePrepared(ctx, s.hooks) + + respBytes, err := proto.Marshal(respContent) + if err != nil { + s.writeError(ctx, resp, wrapInternal(err, "failed to marshal proto response")) + return + } + + ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK) + resp.Header().Set("Content-Type", "application/protobuf") + resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes))) + resp.WriteHeader(http.StatusOK) + if n, err := resp.Write(respBytes); err != nil { + msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error()) + twerr := twirp.NewError(twirp.Unknown, msg) + ctx = callError(ctx, s.hooks, twerr) + } + callResponseSent(ctx, s.hooks) +} + +func (s *cloudAgentServer) serveGetClientSettings(ctx context.Context, resp http.ResponseWriter, req *http.Request) { + header := req.Header.Get("Content-Type") + i := strings.Index(header, ";") + if i == -1 { + i = len(header) + } + switch strings.TrimSpace(strings.ToLower(header[:i])) { + case "application/json": + s.serveGetClientSettingsJSON(ctx, resp, req) + case "application/protobuf": + s.serveGetClientSettingsProtobuf(ctx, resp, req) + default: + msg := fmt.Sprintf("unexpected Content-Type: %q", req.Header.Get("Content-Type")) + twerr := badRouteError(msg, req.Method, req.URL.Path) + s.writeError(ctx, resp, twerr) + } +} + +func (s *cloudAgentServer) serveGetClientSettingsJSON(ctx context.Context, resp http.ResponseWriter, req *http.Request) { + var err error + ctx = ctxsetters.WithMethodName(ctx, "GetClientSettings") + ctx, err = callRequestRouted(ctx, s.hooks) + if err != nil { + s.writeError(ctx, resp, err) + return + } + + d := json.NewDecoder(req.Body) + rawReqBody := json.RawMessage{} + if err := d.Decode(&rawReqBody); err != nil { + s.handleRequestBodyError(ctx, resp, "the json request could not be decoded", err) + return + } + reqContent := new(ClientSettingsRequest) + unmarshaler := protojson.UnmarshalOptions{DiscardUnknown: true} + if err = unmarshaler.Unmarshal(rawReqBody, reqContent); err != nil { + s.handleRequestBodyError(ctx, resp, "the json request could not be decoded", err) + return + } + + handler := s.CloudAgent.GetClientSettings + if s.interceptor != nil { + handler = func(ctx context.Context, req *ClientSettingsRequest) (*ClientSettingsResponse, error) { + resp, err := s.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*ClientSettingsRequest) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*ClientSettingsRequest) when calling interceptor") + } + return s.CloudAgent.GetClientSettings(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*ClientSettingsResponse) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*ClientSettingsResponse) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + + // Call service method + var respContent *ClientSettingsResponse + func() { + defer ensurePanicResponses(ctx, resp, s.hooks) + respContent, err = handler(ctx, reqContent) + }() + + if err != nil { + s.writeError(ctx, resp, err) + return + } + if respContent == nil { + s.writeError(ctx, resp, twirp.InternalError("received a nil *ClientSettingsResponse and nil error while calling GetClientSettings. nil responses are not supported")) + return + } + + ctx = callResponsePrepared(ctx, s.hooks) + + marshaler := &protojson.MarshalOptions{UseProtoNames: !s.jsonCamelCase, EmitUnpopulated: !s.jsonSkipDefaults} + respBytes, err := marshaler.Marshal(respContent) + if err != nil { + s.writeError(ctx, resp, wrapInternal(err, "failed to marshal json response")) + return + } + + ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK) + resp.Header().Set("Content-Type", "application/json") + resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes))) + resp.WriteHeader(http.StatusOK) + + if n, err := resp.Write(respBytes); err != nil { + msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error()) + twerr := twirp.NewError(twirp.Unknown, msg) + ctx = callError(ctx, s.hooks, twerr) + } + callResponseSent(ctx, s.hooks) +} + +func (s *cloudAgentServer) serveGetClientSettingsProtobuf(ctx context.Context, resp http.ResponseWriter, req *http.Request) { + var err error + ctx = ctxsetters.WithMethodName(ctx, "GetClientSettings") + ctx, err = callRequestRouted(ctx, s.hooks) + if err != nil { + s.writeError(ctx, resp, err) + return + } + + buf, err := io.ReadAll(req.Body) + if err != nil { + s.handleRequestBodyError(ctx, resp, "failed to read request body", err) + return + } + reqContent := new(ClientSettingsRequest) + if err = proto.Unmarshal(buf, reqContent); err != nil { + s.writeError(ctx, resp, malformedRequestError("the protobuf request could not be decoded")) + return + } + + handler := s.CloudAgent.GetClientSettings + if s.interceptor != nil { + handler = func(ctx context.Context, req *ClientSettingsRequest) (*ClientSettingsResponse, error) { + resp, err := s.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*ClientSettingsRequest) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*ClientSettingsRequest) when calling interceptor") + } + return s.CloudAgent.GetClientSettings(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*ClientSettingsResponse) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*ClientSettingsResponse) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + + // Call service method + var respContent *ClientSettingsResponse + func() { + defer ensurePanicResponses(ctx, resp, s.hooks) + respContent, err = handler(ctx, reqContent) + }() + + if err != nil { + s.writeError(ctx, resp, err) + return + } + if respContent == nil { + s.writeError(ctx, resp, twirp.InternalError("received a nil *ClientSettingsResponse and nil error while calling GetClientSettings. nil responses are not supported")) + return + } + + ctx = callResponsePrepared(ctx, s.hooks) + + respBytes, err := proto.Marshal(respContent) + if err != nil { + s.writeError(ctx, resp, wrapInternal(err, "failed to marshal proto response")) + return + } + + ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK) + resp.Header().Set("Content-Type", "application/protobuf") + resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes))) + resp.WriteHeader(http.StatusOK) + if n, err := resp.Write(respBytes); err != nil { + msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error()) + twerr := twirp.NewError(twirp.Unknown, msg) + ctx = callError(ctx, s.hooks, twerr) + } + callResponseSent(ctx, s.hooks) +} + +func (s *cloudAgentServer) serveCreatePrivateLink(ctx context.Context, resp http.ResponseWriter, req *http.Request) { + header := req.Header.Get("Content-Type") + i := strings.Index(header, ";") + if i == -1 { + i = len(header) + } + switch strings.TrimSpace(strings.ToLower(header[:i])) { + case "application/json": + s.serveCreatePrivateLinkJSON(ctx, resp, req) + case "application/protobuf": + s.serveCreatePrivateLinkProtobuf(ctx, resp, req) + default: + msg := fmt.Sprintf("unexpected Content-Type: %q", req.Header.Get("Content-Type")) + twerr := badRouteError(msg, req.Method, req.URL.Path) + s.writeError(ctx, resp, twerr) + } +} + +func (s *cloudAgentServer) serveCreatePrivateLinkJSON(ctx context.Context, resp http.ResponseWriter, req *http.Request) { + var err error + ctx = ctxsetters.WithMethodName(ctx, "CreatePrivateLink") + ctx, err = callRequestRouted(ctx, s.hooks) + if err != nil { + s.writeError(ctx, resp, err) + return + } + + d := json.NewDecoder(req.Body) + rawReqBody := json.RawMessage{} + if err := d.Decode(&rawReqBody); err != nil { + s.handleRequestBodyError(ctx, resp, "the json request could not be decoded", err) + return + } + reqContent := new(CreatePrivateLinkRequest) + unmarshaler := protojson.UnmarshalOptions{DiscardUnknown: true} + if err = unmarshaler.Unmarshal(rawReqBody, reqContent); err != nil { + s.handleRequestBodyError(ctx, resp, "the json request could not be decoded", err) + return + } + + handler := s.CloudAgent.CreatePrivateLink + if s.interceptor != nil { + handler = func(ctx context.Context, req *CreatePrivateLinkRequest) (*CreatePrivateLinkResponse, error) { + resp, err := s.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*CreatePrivateLinkRequest) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*CreatePrivateLinkRequest) when calling interceptor") + } + return s.CloudAgent.CreatePrivateLink(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*CreatePrivateLinkResponse) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*CreatePrivateLinkResponse) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + + // Call service method + var respContent *CreatePrivateLinkResponse + func() { + defer ensurePanicResponses(ctx, resp, s.hooks) + respContent, err = handler(ctx, reqContent) + }() + + if err != nil { + s.writeError(ctx, resp, err) + return + } + if respContent == nil { + s.writeError(ctx, resp, twirp.InternalError("received a nil *CreatePrivateLinkResponse and nil error while calling CreatePrivateLink. nil responses are not supported")) + return + } + + ctx = callResponsePrepared(ctx, s.hooks) + + marshaler := &protojson.MarshalOptions{UseProtoNames: !s.jsonCamelCase, EmitUnpopulated: !s.jsonSkipDefaults} + respBytes, err := marshaler.Marshal(respContent) + if err != nil { + s.writeError(ctx, resp, wrapInternal(err, "failed to marshal json response")) + return + } + + ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK) + resp.Header().Set("Content-Type", "application/json") + resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes))) + resp.WriteHeader(http.StatusOK) + + if n, err := resp.Write(respBytes); err != nil { + msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error()) + twerr := twirp.NewError(twirp.Unknown, msg) + ctx = callError(ctx, s.hooks, twerr) + } + callResponseSent(ctx, s.hooks) +} + +func (s *cloudAgentServer) serveCreatePrivateLinkProtobuf(ctx context.Context, resp http.ResponseWriter, req *http.Request) { + var err error + ctx = ctxsetters.WithMethodName(ctx, "CreatePrivateLink") + ctx, err = callRequestRouted(ctx, s.hooks) + if err != nil { + s.writeError(ctx, resp, err) + return + } + + buf, err := io.ReadAll(req.Body) + if err != nil { + s.handleRequestBodyError(ctx, resp, "failed to read request body", err) + return + } + reqContent := new(CreatePrivateLinkRequest) + if err = proto.Unmarshal(buf, reqContent); err != nil { + s.writeError(ctx, resp, malformedRequestError("the protobuf request could not be decoded")) + return + } + + handler := s.CloudAgent.CreatePrivateLink + if s.interceptor != nil { + handler = func(ctx context.Context, req *CreatePrivateLinkRequest) (*CreatePrivateLinkResponse, error) { + resp, err := s.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*CreatePrivateLinkRequest) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*CreatePrivateLinkRequest) when calling interceptor") + } + return s.CloudAgent.CreatePrivateLink(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*CreatePrivateLinkResponse) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*CreatePrivateLinkResponse) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + + // Call service method + var respContent *CreatePrivateLinkResponse + func() { + defer ensurePanicResponses(ctx, resp, s.hooks) + respContent, err = handler(ctx, reqContent) + }() + + if err != nil { + s.writeError(ctx, resp, err) + return + } + if respContent == nil { + s.writeError(ctx, resp, twirp.InternalError("received a nil *CreatePrivateLinkResponse and nil error while calling CreatePrivateLink. nil responses are not supported")) + return + } + + ctx = callResponsePrepared(ctx, s.hooks) + + respBytes, err := proto.Marshal(respContent) + if err != nil { + s.writeError(ctx, resp, wrapInternal(err, "failed to marshal proto response")) + return + } + + ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK) + resp.Header().Set("Content-Type", "application/protobuf") + resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes))) + resp.WriteHeader(http.StatusOK) + if n, err := resp.Write(respBytes); err != nil { + msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error()) + twerr := twirp.NewError(twirp.Unknown, msg) + ctx = callError(ctx, s.hooks, twerr) + } + callResponseSent(ctx, s.hooks) +} + +func (s *cloudAgentServer) serveDestroyPrivateLink(ctx context.Context, resp http.ResponseWriter, req *http.Request) { + header := req.Header.Get("Content-Type") + i := strings.Index(header, ";") + if i == -1 { + i = len(header) + } + switch strings.TrimSpace(strings.ToLower(header[:i])) { + case "application/json": + s.serveDestroyPrivateLinkJSON(ctx, resp, req) + case "application/protobuf": + s.serveDestroyPrivateLinkProtobuf(ctx, resp, req) + default: + msg := fmt.Sprintf("unexpected Content-Type: %q", req.Header.Get("Content-Type")) + twerr := badRouteError(msg, req.Method, req.URL.Path) + s.writeError(ctx, resp, twerr) + } +} + +func (s *cloudAgentServer) serveDestroyPrivateLinkJSON(ctx context.Context, resp http.ResponseWriter, req *http.Request) { + var err error + ctx = ctxsetters.WithMethodName(ctx, "DestroyPrivateLink") + ctx, err = callRequestRouted(ctx, s.hooks) + if err != nil { + s.writeError(ctx, resp, err) + return + } + + d := json.NewDecoder(req.Body) + rawReqBody := json.RawMessage{} + if err := d.Decode(&rawReqBody); err != nil { + s.handleRequestBodyError(ctx, resp, "the json request could not be decoded", err) + return + } + reqContent := new(DestroyPrivateLinkRequest) + unmarshaler := protojson.UnmarshalOptions{DiscardUnknown: true} + if err = unmarshaler.Unmarshal(rawReqBody, reqContent); err != nil { + s.handleRequestBodyError(ctx, resp, "the json request could not be decoded", err) + return + } + + handler := s.CloudAgent.DestroyPrivateLink + if s.interceptor != nil { + handler = func(ctx context.Context, req *DestroyPrivateLinkRequest) (*DestroyPrivateLinkResponse, error) { + resp, err := s.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*DestroyPrivateLinkRequest) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*DestroyPrivateLinkRequest) when calling interceptor") + } + return s.CloudAgent.DestroyPrivateLink(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*DestroyPrivateLinkResponse) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*DestroyPrivateLinkResponse) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + + // Call service method + var respContent *DestroyPrivateLinkResponse + func() { + defer ensurePanicResponses(ctx, resp, s.hooks) + respContent, err = handler(ctx, reqContent) + }() + + if err != nil { + s.writeError(ctx, resp, err) + return + } + if respContent == nil { + s.writeError(ctx, resp, twirp.InternalError("received a nil *DestroyPrivateLinkResponse and nil error while calling DestroyPrivateLink. nil responses are not supported")) + return + } + + ctx = callResponsePrepared(ctx, s.hooks) + + marshaler := &protojson.MarshalOptions{UseProtoNames: !s.jsonCamelCase, EmitUnpopulated: !s.jsonSkipDefaults} + respBytes, err := marshaler.Marshal(respContent) + if err != nil { + s.writeError(ctx, resp, wrapInternal(err, "failed to marshal json response")) + return + } + + ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK) + resp.Header().Set("Content-Type", "application/json") + resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes))) + resp.WriteHeader(http.StatusOK) + + if n, err := resp.Write(respBytes); err != nil { + msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error()) + twerr := twirp.NewError(twirp.Unknown, msg) + ctx = callError(ctx, s.hooks, twerr) + } + callResponseSent(ctx, s.hooks) +} + +func (s *cloudAgentServer) serveDestroyPrivateLinkProtobuf(ctx context.Context, resp http.ResponseWriter, req *http.Request) { + var err error + ctx = ctxsetters.WithMethodName(ctx, "DestroyPrivateLink") + ctx, err = callRequestRouted(ctx, s.hooks) + if err != nil { + s.writeError(ctx, resp, err) + return + } + + buf, err := io.ReadAll(req.Body) + if err != nil { + s.handleRequestBodyError(ctx, resp, "failed to read request body", err) + return + } + reqContent := new(DestroyPrivateLinkRequest) + if err = proto.Unmarshal(buf, reqContent); err != nil { + s.writeError(ctx, resp, malformedRequestError("the protobuf request could not be decoded")) + return + } + + handler := s.CloudAgent.DestroyPrivateLink + if s.interceptor != nil { + handler = func(ctx context.Context, req *DestroyPrivateLinkRequest) (*DestroyPrivateLinkResponse, error) { + resp, err := s.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*DestroyPrivateLinkRequest) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*DestroyPrivateLinkRequest) when calling interceptor") + } + return s.CloudAgent.DestroyPrivateLink(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*DestroyPrivateLinkResponse) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*DestroyPrivateLinkResponse) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + + // Call service method + var respContent *DestroyPrivateLinkResponse + func() { + defer ensurePanicResponses(ctx, resp, s.hooks) + respContent, err = handler(ctx, reqContent) + }() + + if err != nil { + s.writeError(ctx, resp, err) + return + } + if respContent == nil { + s.writeError(ctx, resp, twirp.InternalError("received a nil *DestroyPrivateLinkResponse and nil error while calling DestroyPrivateLink. nil responses are not supported")) + return + } + + ctx = callResponsePrepared(ctx, s.hooks) + + respBytes, err := proto.Marshal(respContent) + if err != nil { + s.writeError(ctx, resp, wrapInternal(err, "failed to marshal proto response")) + return + } + + ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK) + resp.Header().Set("Content-Type", "application/protobuf") + resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes))) + resp.WriteHeader(http.StatusOK) + if n, err := resp.Write(respBytes); err != nil { + msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error()) + twerr := twirp.NewError(twirp.Unknown, msg) + ctx = callError(ctx, s.hooks, twerr) + } + callResponseSent(ctx, s.hooks) +} + +func (s *cloudAgentServer) serveListPrivateLinks(ctx context.Context, resp http.ResponseWriter, req *http.Request) { + header := req.Header.Get("Content-Type") + i := strings.Index(header, ";") + if i == -1 { + i = len(header) + } + switch strings.TrimSpace(strings.ToLower(header[:i])) { + case "application/json": + s.serveListPrivateLinksJSON(ctx, resp, req) + case "application/protobuf": + s.serveListPrivateLinksProtobuf(ctx, resp, req) + default: + msg := fmt.Sprintf("unexpected Content-Type: %q", req.Header.Get("Content-Type")) + twerr := badRouteError(msg, req.Method, req.URL.Path) + s.writeError(ctx, resp, twerr) + } +} + +func (s *cloudAgentServer) serveListPrivateLinksJSON(ctx context.Context, resp http.ResponseWriter, req *http.Request) { + var err error + ctx = ctxsetters.WithMethodName(ctx, "ListPrivateLinks") + ctx, err = callRequestRouted(ctx, s.hooks) + if err != nil { + s.writeError(ctx, resp, err) + return + } + + d := json.NewDecoder(req.Body) + rawReqBody := json.RawMessage{} + if err := d.Decode(&rawReqBody); err != nil { + s.handleRequestBodyError(ctx, resp, "the json request could not be decoded", err) + return + } + reqContent := new(ListPrivateLinksRequest) + unmarshaler := protojson.UnmarshalOptions{DiscardUnknown: true} + if err = unmarshaler.Unmarshal(rawReqBody, reqContent); err != nil { + s.handleRequestBodyError(ctx, resp, "the json request could not be decoded", err) + return + } + + handler := s.CloudAgent.ListPrivateLinks + if s.interceptor != nil { + handler = func(ctx context.Context, req *ListPrivateLinksRequest) (*ListPrivateLinksResponse, error) { + resp, err := s.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*ListPrivateLinksRequest) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*ListPrivateLinksRequest) when calling interceptor") + } + return s.CloudAgent.ListPrivateLinks(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*ListPrivateLinksResponse) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*ListPrivateLinksResponse) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + + // Call service method + var respContent *ListPrivateLinksResponse + func() { + defer ensurePanicResponses(ctx, resp, s.hooks) + respContent, err = handler(ctx, reqContent) + }() + + if err != nil { + s.writeError(ctx, resp, err) + return + } + if respContent == nil { + s.writeError(ctx, resp, twirp.InternalError("received a nil *ListPrivateLinksResponse and nil error while calling ListPrivateLinks. nil responses are not supported")) + return + } + + ctx = callResponsePrepared(ctx, s.hooks) + + marshaler := &protojson.MarshalOptions{UseProtoNames: !s.jsonCamelCase, EmitUnpopulated: !s.jsonSkipDefaults} + respBytes, err := marshaler.Marshal(respContent) + if err != nil { + s.writeError(ctx, resp, wrapInternal(err, "failed to marshal json response")) + return + } + + ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK) + resp.Header().Set("Content-Type", "application/json") + resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes))) + resp.WriteHeader(http.StatusOK) + + if n, err := resp.Write(respBytes); err != nil { + msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error()) + twerr := twirp.NewError(twirp.Unknown, msg) + ctx = callError(ctx, s.hooks, twerr) + } + callResponseSent(ctx, s.hooks) +} + +func (s *cloudAgentServer) serveListPrivateLinksProtobuf(ctx context.Context, resp http.ResponseWriter, req *http.Request) { + var err error + ctx = ctxsetters.WithMethodName(ctx, "ListPrivateLinks") + ctx, err = callRequestRouted(ctx, s.hooks) + if err != nil { + s.writeError(ctx, resp, err) + return + } + + buf, err := io.ReadAll(req.Body) + if err != nil { + s.handleRequestBodyError(ctx, resp, "failed to read request body", err) + return + } + reqContent := new(ListPrivateLinksRequest) + if err = proto.Unmarshal(buf, reqContent); err != nil { + s.writeError(ctx, resp, malformedRequestError("the protobuf request could not be decoded")) + return + } + + handler := s.CloudAgent.ListPrivateLinks + if s.interceptor != nil { + handler = func(ctx context.Context, req *ListPrivateLinksRequest) (*ListPrivateLinksResponse, error) { + resp, err := s.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*ListPrivateLinksRequest) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*ListPrivateLinksRequest) when calling interceptor") + } + return s.CloudAgent.ListPrivateLinks(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*ListPrivateLinksResponse) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*ListPrivateLinksResponse) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + + // Call service method + var respContent *ListPrivateLinksResponse + func() { + defer ensurePanicResponses(ctx, resp, s.hooks) + respContent, err = handler(ctx, reqContent) + }() + + if err != nil { + s.writeError(ctx, resp, err) + return + } + if respContent == nil { + s.writeError(ctx, resp, twirp.InternalError("received a nil *ListPrivateLinksResponse and nil error while calling ListPrivateLinks. nil responses are not supported")) + return + } + + ctx = callResponsePrepared(ctx, s.hooks) + + respBytes, err := proto.Marshal(respContent) + if err != nil { + s.writeError(ctx, resp, wrapInternal(err, "failed to marshal proto response")) + return + } + + ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK) + resp.Header().Set("Content-Type", "application/protobuf") + resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes))) + resp.WriteHeader(http.StatusOK) + if n, err := resp.Write(respBytes); err != nil { + msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error()) + twerr := twirp.NewError(twirp.Unknown, msg) + ctx = callError(ctx, s.hooks, twerr) + } + callResponseSent(ctx, s.hooks) +} + +func (s *cloudAgentServer) serveGetPrivateLinkStatus(ctx context.Context, resp http.ResponseWriter, req *http.Request) { + header := req.Header.Get("Content-Type") + i := strings.Index(header, ";") + if i == -1 { + i = len(header) + } + switch strings.TrimSpace(strings.ToLower(header[:i])) { + case "application/json": + s.serveGetPrivateLinkStatusJSON(ctx, resp, req) + case "application/protobuf": + s.serveGetPrivateLinkStatusProtobuf(ctx, resp, req) + default: + msg := fmt.Sprintf("unexpected Content-Type: %q", req.Header.Get("Content-Type")) + twerr := badRouteError(msg, req.Method, req.URL.Path) + s.writeError(ctx, resp, twerr) + } +} + +func (s *cloudAgentServer) serveGetPrivateLinkStatusJSON(ctx context.Context, resp http.ResponseWriter, req *http.Request) { + var err error + ctx = ctxsetters.WithMethodName(ctx, "GetPrivateLinkStatus") + ctx, err = callRequestRouted(ctx, s.hooks) + if err != nil { + s.writeError(ctx, resp, err) + return + } + + d := json.NewDecoder(req.Body) + rawReqBody := json.RawMessage{} + if err := d.Decode(&rawReqBody); err != nil { + s.handleRequestBodyError(ctx, resp, "the json request could not be decoded", err) + return + } + reqContent := new(GetPrivateLinkStatusRequest) + unmarshaler := protojson.UnmarshalOptions{DiscardUnknown: true} + if err = unmarshaler.Unmarshal(rawReqBody, reqContent); err != nil { + s.handleRequestBodyError(ctx, resp, "the json request could not be decoded", err) + return + } + + handler := s.CloudAgent.GetPrivateLinkStatus + if s.interceptor != nil { + handler = func(ctx context.Context, req *GetPrivateLinkStatusRequest) (*GetPrivateLinkStatusResponse, error) { + resp, err := s.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*GetPrivateLinkStatusRequest) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*GetPrivateLinkStatusRequest) when calling interceptor") + } + return s.CloudAgent.GetPrivateLinkStatus(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*GetPrivateLinkStatusResponse) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*GetPrivateLinkStatusResponse) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + + // Call service method + var respContent *GetPrivateLinkStatusResponse + func() { + defer ensurePanicResponses(ctx, resp, s.hooks) + respContent, err = handler(ctx, reqContent) + }() + + if err != nil { + s.writeError(ctx, resp, err) + return + } + if respContent == nil { + s.writeError(ctx, resp, twirp.InternalError("received a nil *GetPrivateLinkStatusResponse and nil error while calling GetPrivateLinkStatus. nil responses are not supported")) + return + } + + ctx = callResponsePrepared(ctx, s.hooks) + + marshaler := &protojson.MarshalOptions{UseProtoNames: !s.jsonCamelCase, EmitUnpopulated: !s.jsonSkipDefaults} + respBytes, err := marshaler.Marshal(respContent) + if err != nil { + s.writeError(ctx, resp, wrapInternal(err, "failed to marshal json response")) + return + } + + ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK) + resp.Header().Set("Content-Type", "application/json") + resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes))) + resp.WriteHeader(http.StatusOK) + + if n, err := resp.Write(respBytes); err != nil { + msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error()) + twerr := twirp.NewError(twirp.Unknown, msg) + ctx = callError(ctx, s.hooks, twerr) + } + callResponseSent(ctx, s.hooks) +} + +func (s *cloudAgentServer) serveGetPrivateLinkStatusProtobuf(ctx context.Context, resp http.ResponseWriter, req *http.Request) { + var err error + ctx = ctxsetters.WithMethodName(ctx, "GetPrivateLinkStatus") + ctx, err = callRequestRouted(ctx, s.hooks) + if err != nil { + s.writeError(ctx, resp, err) + return + } + + buf, err := io.ReadAll(req.Body) + if err != nil { + s.handleRequestBodyError(ctx, resp, "failed to read request body", err) + return + } + reqContent := new(GetPrivateLinkStatusRequest) + if err = proto.Unmarshal(buf, reqContent); err != nil { + s.writeError(ctx, resp, malformedRequestError("the protobuf request could not be decoded")) + return + } + + handler := s.CloudAgent.GetPrivateLinkStatus + if s.interceptor != nil { + handler = func(ctx context.Context, req *GetPrivateLinkStatusRequest) (*GetPrivateLinkStatusResponse, error) { + resp, err := s.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*GetPrivateLinkStatusRequest) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*GetPrivateLinkStatusRequest) when calling interceptor") + } + return s.CloudAgent.GetPrivateLinkStatus(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*GetPrivateLinkStatusResponse) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*GetPrivateLinkStatusResponse) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + + // Call service method + var respContent *GetPrivateLinkStatusResponse + func() { + defer ensurePanicResponses(ctx, resp, s.hooks) + respContent, err = handler(ctx, reqContent) + }() + + if err != nil { + s.writeError(ctx, resp, err) + return + } + if respContent == nil { + s.writeError(ctx, resp, twirp.InternalError("received a nil *GetPrivateLinkStatusResponse and nil error while calling GetPrivateLinkStatus. nil responses are not supported")) + return + } + + ctx = callResponsePrepared(ctx, s.hooks) + + respBytes, err := proto.Marshal(respContent) + if err != nil { + s.writeError(ctx, resp, wrapInternal(err, "failed to marshal proto response")) + return + } + + ctx = ctxsetters.WithStatusCode(ctx, http.StatusOK) + resp.Header().Set("Content-Type", "application/protobuf") + resp.Header().Set("Content-Length", strconv.Itoa(len(respBytes))) + resp.WriteHeader(http.StatusOK) + if n, err := resp.Write(respBytes); err != nil { + msg := fmt.Sprintf("failed to write response, %d of %d bytes written: %s", n, len(respBytes), err.Error()) + twerr := twirp.NewError(twirp.Unknown, msg) + ctx = callError(ctx, s.hooks, twerr) + } + callResponseSent(ctx, s.hooks) +} + +func (s *cloudAgentServer) ServiceDescriptor() ([]byte, int) { + return twirpFileDescriptor6, 0 +} + +func (s *cloudAgentServer) ProtocGenTwirpVersion() string { + return "v8.1.3" +} + +// PathPrefix returns the base service path, in the form: "//./" +// that is everything in a Twirp route except for the . This can be used for routing, +// for example to identify the requests that are targeted to this service in a mux. +func (s *cloudAgentServer) PathPrefix() string { + return baseServicePath(s.pathPrefix, "livekit", "CloudAgent") +} + +var twirpFileDescriptor6 = []byte{ + // 2416 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0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x43, 0x7f, 0xe3, 0xaf, 0xe2, 0xc2, 0xbe, 0x3a, 0x26, 0x7b, + 0xb4, 0x6e, 0x1a, 0x8e, 0xf1, 0x8d, 0x78, 0xcd, 0x5b, 0x3f, 0x7f, 0x4e, 0x37, 0x8e, 0xf3, 0xf4, + 0xc8, 0xf7, 0xff, 0x1f, 0x00, 0x00, 0xff, 0xff, 0xbe, 0x05, 0xd7, 0x7a, 0x46, 0x22, 0x00, 0x00, +} From dac2a402e4a766bbc26ea6a5200698800bf95341 Mon Sep 17 00:00:00 2001 From: Steve Yoon Date: Wed, 22 Apr 2026 18:36:05 -0400 Subject: [PATCH 7/8] update agent protocol --- protobufs/livekit_cloud_agent.proto | 2 ++ 1 file changed, 2 insertions(+) diff --git a/protobufs/livekit_cloud_agent.proto b/protobufs/livekit_cloud_agent.proto index 34b95b5ad..e5b6962d5 100644 --- a/protobufs/livekit_cloud_agent.proto +++ b/protobufs/livekit_cloud_agent.proto @@ -103,6 +103,7 @@ message AgentDeployment { repeated AgentEvent events = 14; string environment = 15; string version = 16; + string agent_name = 17; } message AgentInfo { @@ -132,6 +133,7 @@ message AgentVersion { string status = 6; string owner = 7; bool draining = 8; + bool active = 9; } message ListAgentVersionsRequest { From d6bd628ac4a5a59fa3693d34e1d1e9ffeabb2487 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 22 Apr 2026 22:38:31 +0000 Subject: [PATCH 8/8] generated protobuf --- livekit/livekit_cloud_agent.pb.go | 40 +++- livekit/livekit_cloud_agent.twirp.go | 306 ++++++++++++++------------- 2 files changed, 188 insertions(+), 158 deletions(-) diff --git a/livekit/livekit_cloud_agent.pb.go b/livekit/livekit_cloud_agent.pb.go index 71cdc6227..7060acc86 100644 --- a/livekit/livekit_cloud_agent.pb.go +++ b/livekit/livekit_cloud_agent.pb.go @@ -714,6 +714,7 @@ type AgentDeployment struct { Events []*AgentEvent `protobuf:"bytes,14,rep,name=events,proto3" json:"events,omitempty"` Environment string `protobuf:"bytes,15,opt,name=environment,proto3" json:"environment,omitempty"` Version string `protobuf:"bytes,16,opt,name=version,proto3" json:"version,omitempty"` + AgentName string `protobuf:"bytes,17,opt,name=agent_name,json=agentName,proto3" json:"agent_name,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -860,6 +861,13 @@ func (x *AgentDeployment) GetVersion() string { return "" } +func (x *AgentDeployment) GetAgentName() string { + if x != nil { + return x.AgentName + } + return "" +} + type AgentInfo struct { state protoimpl.MessageState `protogen:"open.v1"` AgentId string `protobuf:"bytes,1,opt,name=agent_id,json=agentId,proto3" json:"agent_id,omitempty"` @@ -1050,6 +1058,7 @@ type AgentVersion struct { Status string `protobuf:"bytes,6,opt,name=status,proto3" json:"status,omitempty"` Owner string `protobuf:"bytes,7,opt,name=owner,proto3" json:"owner,omitempty"` Draining bool `protobuf:"varint,8,opt,name=draining,proto3" json:"draining,omitempty"` + Active bool `protobuf:"varint,9,opt,name=active,proto3" json:"active,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -1140,6 +1149,13 @@ func (x *AgentVersion) GetDraining() bool { return false } +func (x *AgentVersion) GetActive() bool { + if x != nil { + return x.Active + } + return false +} + type ListAgentVersionsRequest struct { state protoimpl.MessageState `protogen:"open.v1"` AgentId string `protobuf:"bytes,1,opt,name=agent_id,json=agentId,proto3" json:"agent_id,omitempty"` @@ -2410,6 +2426,7 @@ type PrivateLink struct { Port uint32 `protobuf:"varint,5,opt,name=port,proto3" json:"port,omitempty"` Endpoint string `protobuf:"bytes,6,opt,name=endpoint,proto3" json:"endpoint,omitempty"` ConnectionEndpoint string `protobuf:"bytes,7,opt,name=connection_endpoint,json=connectionEndpoint,proto3" json:"connection_endpoint,omitempty"` + CloudRegion string `protobuf:"bytes,8,opt,name=cloud_region,json=cloudRegion,proto3" json:"cloud_region,omitempty"` // Types that are valid to be assigned to Config: // // *PrivateLink_Aws @@ -2490,6 +2507,13 @@ func (x *PrivateLink) GetConnectionEndpoint() string { return "" } +func (x *PrivateLink) GetCloudRegion() string { + if x != nil { + return x.CloudRegion + } + return "" +} + func (x *PrivateLink) GetConfig() isPrivateLink_Config { if x != nil { return x.Config @@ -3121,7 +3145,7 @@ const file_livekit_cloud_agent_proto_rawDesc = "" + "\x06values\x18\x02 \x03(\v2).livekit.PresignedPostRequest.ValuesEntryR\x06values\x1a9\n" + "\vValuesEntry\x12\x10\n" + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\xf6\x03\n" + + "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\x95\x04\n" + "\x0fAgentDeployment\x12\x16\n" + "\x06region\x18\x01 \x01(\tR\x06region\x12%\n" + "\bagent_id\x18\x02 \x01(\tB\n" + @@ -3140,7 +3164,9 @@ const file_livekit_cloud_agent_proto_rawDesc = "" + "\rserver_region\x18\r \x01(\tR\fserverRegion\x12+\n" + "\x06events\x18\x0e \x03(\v2\x13.livekit.AgentEventR\x06events\x12 \n" + "\venvironment\x18\x0f \x01(\tR\venvironment\x12\x18\n" + - "\aversion\x18\x10 \x01(\tR\aversion\"\x9f\x02\n" + + "\aversion\x18\x10 \x01(\tR\aversion\x12\x1d\n" + + "\n" + + "agent_name\x18\x11 \x01(\tR\tagentName\"\x9f\x02\n" + "\tAgentInfo\x12%\n" + "\bagent_id\x18\x01 \x01(\tB\n" + "\xbaP\aagentIDR\aagentId\x12\x1d\n" + @@ -3157,7 +3183,7 @@ const file_livekit_cloud_agent_proto_rawDesc = "" + "\bagent_id\x18\x02 \x01(\tB\n" + "\xbaP\aagentIDR\aagentId\"@\n" + "\x12ListAgentsResponse\x12*\n" + - "\x06agents\x18\x01 \x03(\v2\x12.livekit.AgentInfoR\x06agents\"\x8a\x03\n" + + "\x06agents\x18\x01 \x03(\v2\x12.livekit.AgentInfoR\x06agents\"\xa2\x03\n" + "\fAgentVersion\x12\x18\n" + "\aversion\x18\x01 \x01(\tR\aversion\x12\x18\n" + "\acurrent\x18\x02 \x01(\bR\acurrent\x129\n" + @@ -3170,7 +3196,8 @@ const file_livekit_cloud_agent_proto_rawDesc = "" + "attributes\x12\x16\n" + "\x06status\x18\x06 \x01(\tR\x06status\x12\x14\n" + "\x05owner\x18\a \x01(\tR\x05owner\x12\x1a\n" + - "\bdraining\x18\b \x01(\bR\bdraining\x1a=\n" + + "\bdraining\x18\b \x01(\bR\bdraining\x12\x16\n" + + "\x06active\x18\t \x01(\bR\x06active\x1a=\n" + "\x0fAttributesEntry\x12\x10\n" + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"`\n" + @@ -3273,14 +3300,15 @@ const file_livekit_cloud_agent_proto_rawDesc = "" + "\x05value\x18\x02 \x01(\tR\x05value\"H\n" + "\x16ClientSettingsResponse\x12.\n" + "\x06params\x18\x01 \x03(\v2\x16.livekit.SettingsParamR\x06params\"\x17\n" + - "\x15ClientSettingsRequest\"\xc3\x02\n" + + "\x15ClientSettingsRequest\"\xe6\x02\n" + "\vPrivateLink\x128\n" + "\x0fprivate_link_id\x18\x01 \x01(\tB\x10\xbaP\rprivateLinkIDR\rprivateLinkId\x12\x12\n" + "\x04name\x18\x02 \x01(\tR\x04name\x12\x16\n" + "\x06region\x18\x04 \x01(\tR\x06region\x12\x12\n" + "\x04port\x18\x05 \x01(\rR\x04port\x12\x1a\n" + "\bendpoint\x18\x06 \x01(\tR\bendpoint\x12/\n" + - "\x13connection_endpoint\x18\a \x01(\tR\x12connectionEndpoint\x126\n" + + "\x13connection_endpoint\x18\a \x01(\tR\x12connectionEndpoint\x12!\n" + + "\fcloud_region\x18\b \x01(\tR\vcloudRegion\x126\n" + "\x03aws\x18\x03 \x01(\v2\x1e.livekit.PrivateLink.AWSConfigB\x02\x18\x01H\x00R\x03aws\x1a+\n" + "\tAWSConfig\x12\x1e\n" + "\bendpoint\x18\x01 \x01(\tB\x02\x18\x01R\bendpointB\b\n" + diff --git a/livekit/livekit_cloud_agent.twirp.go b/livekit/livekit_cloud_agent.twirp.go index 8d6a99a48..ee910054e 100644 --- a/livekit/livekit_cloud_agent.twirp.go +++ b/livekit/livekit_cloud_agent.twirp.go @@ -4981,156 +4981,158 @@ func (s *cloudAgentServer) PathPrefix() string { } var twirpFileDescriptor6 = []byte{ - // 2416 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x1a, 0x4d, 0x6f, 0x1b, 0x5b, - 0x35, 0x33, 0xfe, 0x48, 0x7c, 0x9c, 0x34, 0xee, 0x8d, 0xdb, 0x3a, 0x4e, 0xd2, 0x26, 0xd3, 0x16, - 0x42, 0xfb, 0xe4, 0xbe, 0x16, 0x09, 0xda, 0x02, 0x12, 0x6e, 0x32, 0x4d, 0xdc, 0xa4, 0x8e, 0x75, - 0xed, 0xa4, 0x2a, 0x42, 0x9a, 0xe7, 0xd8, 0xb7, 0x66, 0x14, 0xcf, 0x47, 0x67, 0xc6, 0xee, 0x8b, - 0x04, 0x2b, 0x36, 0x80, 0x90, 0xd8, 0xb0, 0x47, 0x62, 0xc1, 0x82, 0x3f, 0x80, 0x54, 0x09, 0x09, - 0x89, 0x05, 0x3f, 0x83, 0x15, 0x9b, 0xf7, 0x03, 0xd8, 0x82, 0xe6, 0xde, 0xf9, 0xb8, 0xf3, 0xe1, - 0xc4, 0x49, 0x5a, 0xbd, 0x4d, 0x3b, 0xf7, 0x9e, 0x73, 0xcf, 0x3d, 0xdf, 0xe7, 0xdc, 0xe3, 0xc0, - 0xf2, 0x50, 0x1d, 0x93, 0x13, 0xd5, 0x51, 0x7a, 0x43, 0x63, 0xd4, 0x57, 0xba, 0x03, 0xa2, 0x3b, - 0x35, 0xd3, 0x32, 0x1c, 0x03, 0xcd, 0x7a, 0xa0, 0xea, 0x9d, 0x81, 0x61, 0x0c, 0x86, 0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 0xdf, 0x42, 0x29, 0xde, 0x4a, 0xa1, 0xf5, 0xe4, 0xc9, 0x68, 0x1b, 0x57, 0xdd, 0x38, 0x03, - 0x23, 0x20, 0xfd, 0x0a, 0x8a, 0x5c, 0x9b, 0xcf, 0xd9, 0x27, 0x39, 0x64, 0xe2, 0xec, 0x93, 0x32, - 0x73, 0x91, 0x66, 0xd0, 0x6b, 0x98, 0xe7, 0x67, 0x20, 0x28, 0xc4, 0x4f, 0x19, 0xac, 0x54, 0xd7, - 0x26, 0x40, 0x79, 0xd6, 0xb8, 0x77, 0x23, 0xc7, 0x5a, 0x72, 0x36, 0xc2, 0xb1, 0x96, 0x32, 0x21, - 0x60, 0xae, 0x13, 0x79, 0x83, 0x72, 0xae, 0x93, 0xf6, 0x5a, 0xe6, 0x5c, 0x27, 0xf5, 0xe9, 0x2a, - 0xcd, 0x20, 0x25, 0x32, 0x87, 0xf3, 0xad, 0x22, 0xa5, 0xa9, 0x28, 0x66, 0x97, 0xbb, 0x67, 0xe2, - 0xf0, 0x2c, 0x47, 0x9e, 0x2d, 0x1c, 0xcb, 0x69, 0xcf, 0x28, 0x8e, 0xe5, 0xd4, 0xd7, 0x8e, 0xaf, - 0xd0, 0xe0, 0xf5, 0x10, 0x51, 0x68, 0xfc, 0x45, 0x13, 0x51, 0x68, 0xe2, 0xc1, 0x21, 0xcd, 0xa0, - 0x23, 0xb8, 0xbe, 0x43, 0x9c, 0x68, 0x3f, 0x8c, 0xb8, 0x80, 0x4b, 0x6b, 0x94, 0xab, 0x77, 0x26, - 0xc2, 0xf9, 0x40, 0x4a, 0x54, 0x51, 0x2e, 0x90, 0x26, 0x95, 0x79, 0x2e, 0x90, 0x26, 0x16, 0x61, - 0x66, 0xb4, 0x64, 0xd9, 0xe3, 0x8c, 0x36, 0xb1, 0xd4, 0x72, 0x46, 0x3b, 0xa3, 0x6e, 0x06, 0x91, - 0xca, 0x97, 0xc7, 0x58, 0xa4, 0xa6, 0x14, 0xd5, 0x58, 0xa4, 0xa6, 0xd5, 0x56, 0x69, 0x06, 0x11, - 0x28, 0xa7, 0x15, 0x36, 0x74, 0x2f, 0x38, 0x7c, 0x46, 0x41, 0xad, 0xde, 0x3f, 0x07, 0xcb, 0xbf, - 0xe6, 0xc5, 0xcb, 0x9f, 0xdd, 0x1d, 0xa8, 0xce, 0x2f, 0x46, 0xc7, 0xb5, 0x9e, 0xa1, 0x3d, 0xf2, - 0x0e, 0xb1, 0xbf, 0xef, 0xe8, 0x19, 0x43, 0x7f, 0xe3, 0xaf, 0xe2, 0xc2, 0xbe, 0x3a, 0x26, 0x7b, - 0xb4, 0x6e, 0x1a, 0x8e, 0xf1, 0x8d, 0x78, 0xcd, 0x5b, 0x3f, 0x7f, 0x4e, 0x37, 0x8e, 0xf3, 0xf4, - 0xc8, 0xf7, 0xff, 0x1f, 0x00, 0x00, 0xff, 0xff, 0xbe, 0x05, 0xd7, 0x7a, 0x46, 0x22, 0x00, 0x00, + // 2444 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x5a, 0x4b, 0x6f, 0xdb, 0xca, + 0xf5, 0x37, 0xa9, 0x87, 0xad, 0x23, 0x3b, 0x56, 0xc6, 0x4e, 0x22, 0xcb, 0xf6, 0x8d, 0xcd, 0x24, + 0xff, 0xbf, 0x9b, 0x5c, 0x28, 0x37, 0x29, 0xd0, 0x26, 0x69, 0x0b, 0x54, 0xb1, 0x19, 0x5b, 0xb1, + 0x23, 0x0b, 0x23, 0xd9, 0x41, 0x8a, 0x02, 0xbc, 0x8c, 0x34, 0x51, 0x09, 0x8b, 0x8f, 0x90, 0x94, + 0x72, 0x0d, 0xb4, 0xab, 0x6e, 0x5a, 0xa0, 0x40, 0x37, 0xed, 0xba, 0xc0, 0x5d, 0x74, 0xd1, 0x2f, + 0x50, 0x20, 0x40, 0x81, 0xee, 0xfa, 0x31, 0xba, 0x6a, 0x17, 0xf7, 0x4b,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