This repository has been archived by the owner on Apr 11, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 21
/
models.go
79 lines (67 loc) · 2.36 KB
/
models.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
/*
Copyright SecureKey Technologies Inc. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package mediatorclient
import (
"encoding/json"
"github.com/hyperledger/aries-framework-go/pkg/client/outofband"
"github.com/hyperledger/aries-framework-go/pkg/didcomm/common/service"
"github.com/hyperledger/aries-framework-go/pkg/didcomm/protocol/outofbandv2"
)
// ConnectionRequest model
//
// This is used for connecting to given router.
//
type ConnectionRequest struct {
// Invitation is out-of-band (V1 or V2) invitation from mediator.
Invitation *service.DIDCommMsgMap `json:"invitation"`
// MyLabel is custom label to be used as receiver label of this invitation
// Optional: if missing, agent default label will be used.
MyLabel string `json:"mylabel,omitempty"`
// StateCompleteMessageType is optional did exchange completion notification message type from inviter.
// If provided, then agent will wait for notification of this message type from inviter before performing
// mediator registration.
// If not provided, then this agent will go ahead with mediator registration once did exchange state is
// completed at invitee.
StateCompleteMessageType string `json:"stateCompleteMessageType,omitempty"`
}
// ConnectionResponse contains response.
type ConnectionResponse struct {
ConnectionID string `json:"connectionID"`
}
// CreateInvitationRequest model
//
// This is used for creating an invitation using mediator.
//
type CreateInvitationRequest struct {
Label string `json:"label"`
Goal string `json:"goal"`
GoalCode string `json:"goal_code"`
Service []interface{} `json:"service"`
Protocols []string `json:"protocols"`
From string `json:"from"`
}
// CreateInvitationResponse model
//
// Response for creating invitation through mediator.
//
type CreateInvitationResponse struct {
// Invitation is out-of-band invitation from mediator.
Invitation *outofband.Invitation `json:"invitation"`
InvitationV2 *outofbandv2.Invitation `json:"invitation-v2"`
}
// CreateConnectionRequest model
//
// This is used for sending create connection request.
//
type CreateConnectionRequest struct {
DIDDocument json.RawMessage `json:"didDoc"`
}
// CreateConnectionResponse model
//
// This is used for getting create connection response.
//
type CreateConnectionResponse struct {
Payload json.RawMessage `json:"payload"`
}