Skip to content

Commit 54bde68

Browse files
committed
Added ProfileLibraryRef structs to result package
1 parent 8941e40 commit 54bde68

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

internal/cli/feedback/result/rpc.go

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1125,3 +1125,25 @@ func NewIndexUpdateReport_Status(r rpc.IndexUpdateReport_Status) IndexUpdateRepo
11251125
return IndexUpdateReport_StatusUnspecified
11261126
}
11271127
}
1128+
1129+
type ProfileLibraryReference_LocalLibraryResult struct {
1130+
Path string `json:"path,omitempty"`
1131+
}
1132+
1133+
func NewProfileLibraryReference_LocalLibraryResult(resp *rpc.ProfileLibraryReference_LocalLibrary) *ProfileLibraryReference_LocalLibraryResult {
1134+
return &ProfileLibraryReference_LocalLibraryResult{
1135+
Path: resp.GetPath(),
1136+
}
1137+
}
1138+
1139+
type ProfileLibraryReference_IndexLibraryResult struct {
1140+
Name string `json:"name,omitempty"`
1141+
Version string `json:"version,omitempty"`
1142+
}
1143+
1144+
func NewProfileLibraryReference_IndexLibraryResult(resp *rpc.ProfileLibraryReference_IndexLibrary) *ProfileLibraryReference_IndexLibraryResult {
1145+
return &ProfileLibraryReference_IndexLibraryResult{
1146+
Name: resp.GetName(),
1147+
Version: resp.GetVersion(),
1148+
}
1149+
}

internal/cli/feedback/result/rpc_test.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,14 @@ func TestAllFieldAreMapped(t *testing.T) {
233233
indexUpdateReportRpc := &rpc.IndexUpdateReport{}
234234
indexUpdateReportResult := result.NewIndexUpdateReportResult(indexUpdateReportRpc)
235235
mustContainsAllPropertyOfRpcStruct(t, indexUpdateReportRpc, indexUpdateReportResult)
236+
237+
profileLibraryReference_IndexLibraryRpc := &rpc.ProfileLibraryReference_IndexLibrary{}
238+
profileLibraryReference_IndexLibraryResult := result.NewProfileLibraryReference_IndexLibraryResult(profileLibraryReference_IndexLibraryRpc)
239+
mustContainsAllPropertyOfRpcStruct(t, profileLibraryReference_IndexLibraryRpc, profileLibraryReference_IndexLibraryResult)
240+
241+
profileLibraryReference_LocalLibraryRpc := &rpc.ProfileLibraryReference_LocalLibrary{}
242+
profileLibraryReference_LocalLibraryResult := result.NewProfileLibraryReference_LocalLibraryResult(profileLibraryReference_LocalLibraryRpc)
243+
mustContainsAllPropertyOfRpcStruct(t, profileLibraryReference_LocalLibraryRpc, profileLibraryReference_LocalLibraryResult)
236244
}
237245

238246
func TestEnumsMapsEveryRpcCounterpart(t *testing.T) {

0 commit comments

Comments
 (0)