This repository has been archived by the owner on May 17, 2024. It is now read-only.
generated from findy-network/findy-template-go
-
Notifications
You must be signed in to change notification settings - Fork 1
/
model_issue_credential_v2_send_proposal_request_data.go
52 lines (44 loc) · 2.05 KB
/
model_issue_credential_v2_send_proposal_request_data.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
/*
* Aries Agent Test Harness Backchannel API
*
* This page documents the backchannel API the test harness uses to communicate with agents under tests. For more information checkout the [Aries Interoperability Information](http://aries-interop.info) page.
*
* API version: 1.0.0
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
*/
package openapi
type IssueCredentialV2SendProposalRequestData struct {
ConnectionId string `json:"connection_id"`
CredentialPreview IssueCredentialV2SendProposalRequestDataCredentialPreview `json:"credential_preview,omitempty"`
Filter IssueCredentialV2CredentialProposalFilter `json:"filter"`
}
// AssertIssueCredentialV2SendProposalRequestDataRequired checks if the required fields are not zero-ed
func AssertIssueCredentialV2SendProposalRequestDataRequired(obj IssueCredentialV2SendProposalRequestData) error {
elements := map[string]interface{}{
"connection_id": obj.ConnectionId,
"filter": obj.Filter,
}
for name, el := range elements {
if isZero := IsZeroValue(el); isZero {
return &RequiredError{Field: name}
}
}
if err := AssertIssueCredentialV2SendProposalRequestDataCredentialPreviewRequired(obj.CredentialPreview); err != nil {
return err
}
if err := AssertIssueCredentialV2CredentialProposalFilterRequired(obj.Filter); err != nil {
return err
}
return nil
}
// AssertRecurseIssueCredentialV2SendProposalRequestDataRequired recursively checks if required fields are not zero-ed in a nested slice.
// Accepts only nested slice of IssueCredentialV2SendProposalRequestData (e.g. [][]IssueCredentialV2SendProposalRequestData), otherwise ErrTypeAssertionError is thrown.
func AssertRecurseIssueCredentialV2SendProposalRequestDataRequired(objSlice interface{}) error {
return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error {
aIssueCredentialV2SendProposalRequestData, ok := obj.(IssueCredentialV2SendProposalRequestData)
if !ok {
return ErrTypeAssertionError
}
return AssertIssueCredentialV2SendProposalRequestDataRequired(aIssueCredentialV2SendProposalRequestData)
})
}