2022-05-25 18:43:35 +00:00
|
|
|
// Code generated by mog. DO NOT EDIT.
|
|
|
|
|
|
|
|
package pbpeering
|
|
|
|
|
|
|
|
import "github.com/hashicorp/consul/api"
|
|
|
|
|
2022-06-10 16:10:46 +00:00
|
|
|
func EstablishRequestToAPI(s *EstablishRequest, t *api.PeeringEstablishRequest) {
|
2022-05-25 18:43:35 +00:00
|
|
|
if s == nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
t.PeerName = s.PeerName
|
2022-06-10 16:10:46 +00:00
|
|
|
t.PeeringToken = s.PeeringToken
|
2022-07-15 14:07:07 +00:00
|
|
|
t.Partition = s.Partition
|
2022-05-25 18:43:35 +00:00
|
|
|
t.Meta = s.Meta
|
|
|
|
}
|
2022-06-10 16:10:46 +00:00
|
|
|
func EstablishRequestFromAPI(t *api.PeeringEstablishRequest, s *EstablishRequest) {
|
2022-05-25 18:43:35 +00:00
|
|
|
if s == nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
s.PeerName = t.PeerName
|
2022-06-10 16:10:46 +00:00
|
|
|
s.PeeringToken = t.PeeringToken
|
2022-07-15 14:07:07 +00:00
|
|
|
s.Partition = t.Partition
|
2022-05-25 18:43:35 +00:00
|
|
|
s.Meta = t.Meta
|
|
|
|
}
|
2022-06-10 16:10:46 +00:00
|
|
|
func EstablishResponseToAPI(s *EstablishResponse, t *api.PeeringEstablishResponse) {
|
2022-05-25 18:43:35 +00:00
|
|
|
if s == nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
2022-06-10 16:10:46 +00:00
|
|
|
func EstablishResponseFromAPI(t *api.PeeringEstablishResponse, s *EstablishResponse) {
|
2022-05-25 18:43:35 +00:00
|
|
|
if s == nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
2022-06-10 16:10:46 +00:00
|
|
|
func GenerateTokenRequestToAPI(s *GenerateTokenRequest, t *api.PeeringGenerateTokenRequest) {
|
2022-05-25 18:43:35 +00:00
|
|
|
if s == nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
t.PeerName = s.PeerName
|
2022-06-10 16:10:46 +00:00
|
|
|
t.Partition = s.Partition
|
2022-05-25 18:43:35 +00:00
|
|
|
t.Meta = s.Meta
|
2022-07-21 21:56:11 +00:00
|
|
|
t.ServerExternalAddresses = s.ServerExternalAddresses
|
2022-05-25 18:43:35 +00:00
|
|
|
}
|
2022-06-10 16:10:46 +00:00
|
|
|
func GenerateTokenRequestFromAPI(t *api.PeeringGenerateTokenRequest, s *GenerateTokenRequest) {
|
2022-05-25 18:43:35 +00:00
|
|
|
if s == nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
s.PeerName = t.PeerName
|
2022-06-10 16:10:46 +00:00
|
|
|
s.Partition = t.Partition
|
2022-05-25 18:43:35 +00:00
|
|
|
s.Meta = t.Meta
|
2022-07-21 21:56:11 +00:00
|
|
|
s.ServerExternalAddresses = t.ServerExternalAddresses
|
2022-05-25 18:43:35 +00:00
|
|
|
}
|
2022-06-10 16:10:46 +00:00
|
|
|
func GenerateTokenResponseToAPI(s *GenerateTokenResponse, t *api.PeeringGenerateTokenResponse) {
|
2022-05-25 18:43:35 +00:00
|
|
|
if s == nil {
|
|
|
|
return
|
|
|
|
}
|
2022-06-10 16:10:46 +00:00
|
|
|
t.PeeringToken = s.PeeringToken
|
2022-05-25 18:43:35 +00:00
|
|
|
}
|
2022-06-10 16:10:46 +00:00
|
|
|
func GenerateTokenResponseFromAPI(t *api.PeeringGenerateTokenResponse, s *GenerateTokenResponse) {
|
2022-05-25 18:43:35 +00:00
|
|
|
if s == nil {
|
|
|
|
return
|
|
|
|
}
|
2022-06-10 16:10:46 +00:00
|
|
|
s.PeeringToken = t.PeeringToken
|
2022-05-25 18:43:35 +00:00
|
|
|
}
|
|
|
|
func PeeringToAPI(s *Peering, t *api.Peering) {
|
|
|
|
if s == nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
t.ID = s.ID
|
|
|
|
t.Name = s.Name
|
|
|
|
t.Partition = s.Partition
|
2022-06-08 22:53:32 +00:00
|
|
|
t.DeletedAt = TimePtrFromProto(s.DeletedAt)
|
2022-05-25 18:43:35 +00:00
|
|
|
t.Meta = s.Meta
|
|
|
|
t.State = PeeringStateToAPI(s.State)
|
|
|
|
t.PeerID = s.PeerID
|
|
|
|
t.PeerCAPems = s.PeerCAPems
|
|
|
|
t.PeerServerName = s.PeerServerName
|
|
|
|
t.PeerServerAddresses = s.PeerServerAddresses
|
2022-09-23 21:51:41 +00:00
|
|
|
t.StreamStatus = StreamStatusToAPI(s.StreamStatus)
|
2022-05-25 18:43:35 +00:00
|
|
|
t.CreateIndex = s.CreateIndex
|
|
|
|
t.ModifyIndex = s.ModifyIndex
|
2022-10-05 13:10:19 +00:00
|
|
|
if s.Remote != nil {
|
|
|
|
RemoteInfoToAPI(s.Remote, &t.Remote)
|
|
|
|
}
|
2022-05-25 18:43:35 +00:00
|
|
|
}
|
|
|
|
func PeeringFromAPI(t *api.Peering, s *Peering) {
|
|
|
|
if s == nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
s.ID = t.ID
|
|
|
|
s.Name = t.Name
|
|
|
|
s.Partition = t.Partition
|
2022-06-08 22:53:32 +00:00
|
|
|
s.DeletedAt = TimePtrToProto(t.DeletedAt)
|
2022-05-25 18:43:35 +00:00
|
|
|
s.Meta = t.Meta
|
|
|
|
s.State = PeeringStateFromAPI(t.State)
|
|
|
|
s.PeerID = t.PeerID
|
|
|
|
s.PeerCAPems = t.PeerCAPems
|
|
|
|
s.PeerServerName = t.PeerServerName
|
|
|
|
s.PeerServerAddresses = t.PeerServerAddresses
|
2022-09-23 21:51:41 +00:00
|
|
|
s.StreamStatus = StreamStatusFromAPI(t.StreamStatus)
|
2022-05-25 18:43:35 +00:00
|
|
|
s.CreateIndex = t.CreateIndex
|
|
|
|
s.ModifyIndex = t.ModifyIndex
|
2022-10-05 13:10:19 +00:00
|
|
|
{
|
|
|
|
var x RemoteInfo
|
|
|
|
RemoteInfoFromAPI(&t.Remote, &x)
|
|
|
|
s.Remote = &x
|
|
|
|
}
|
|
|
|
}
|
|
|
|
func RemoteInfoToAPI(s *RemoteInfo, t *api.PeeringRemoteInfo) {
|
|
|
|
if s == nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
t.Partition = s.Partition
|
|
|
|
t.Datacenter = s.Datacenter
|
|
|
|
}
|
|
|
|
func RemoteInfoFromAPI(t *api.PeeringRemoteInfo, s *RemoteInfo) {
|
|
|
|
if s == nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
s.Partition = t.Partition
|
|
|
|
s.Datacenter = t.Datacenter
|
2022-05-25 18:43:35 +00:00
|
|
|
}
|