@@ -2,7 +2,6 @@ package types
2
2
3
3
import (
4
4
"fmt"
5
- "github.com/turbot/go-kit/helpers"
6
5
7
6
"github.com/logrusorgru/aurora"
8
7
flowpipeapiclient "github.com/turbot/flowpipe-sdk-go"
@@ -20,16 +19,14 @@ type ListIntegrationResponse struct {
20
19
}
21
20
22
21
type FpIntegration struct {
23
- Name string `json:"name"`
24
- Type string `json:"type"`
25
- Description * string `json:"description,omitempty"`
26
- Title * string `json:"title,omitempty"`
27
- Documentation * string `json:"documentation,omitempty"`
28
- Tags map [string ]string `json:"tags,omitempty"`
29
- FileName string `json:"file_name,omitempty"`
30
- StartLineNumber int `json:"start_line_number,omitempty"`
31
- EndLineNumber int `json:"end_line_number,omitempty"`
32
- Url * string `json:"url,omitempty"`
22
+ Name string `json:"name"`
23
+ Type string `json:"type"`
24
+ Description * string `json:"description,omitempty"`
25
+ Title * string `json:"title,omitempty"`
26
+ FileName string `json:"file_name,omitempty"`
27
+ StartLineNumber int `json:"start_line_number,omitempty"`
28
+ EndLineNumber int `json:"end_line_number,omitempty"`
29
+ Url * string `json:"url,omitempty"`
33
30
}
34
31
35
32
func (f FpIntegration ) String (_ * sanitize.Sanitizer , opts sanitize.RenderOptions ) string {
@@ -39,7 +36,7 @@ func (f FpIntegration) String(_ *sanitize.Sanitizer, opts sanitize.RenderOptions
39
36
// left := au.BrightBlack("[")
40
37
// right := au.BrightBlack("]")
41
38
keyWidth := 10
42
- if f .Description != nil {
39
+ if f .Description != nil || f . Url != nil {
43
40
keyWidth = 13
44
41
}
45
42
@@ -52,13 +49,7 @@ func (f FpIntegration) String(_ *sanitize.Sanitizer, opts sanitize.RenderOptions
52
49
output += fmt .Sprintf ("%-*s%s\n " , keyWidth , au .Blue ("Description:" ), * f .Description )
53
50
}
54
51
if f .Url != nil {
55
- output += fmt .Sprintf ("%-*s%s\n " , keyWidth , au .Blue ("URL:" ), * f .Url )
56
- }
57
- if len (f .Tags ) > 0 {
58
- output += fmt .Sprintf ("%s\n " , au .Blue ("Tags:" ))
59
- for k , v := range f .Tags {
60
- output += fmt .Sprintf (" %s %s\n " , au .Cyan (k + ":" ), v )
61
- }
52
+ output += fmt .Sprintf ("%-*s%s\n " , keyWidth , au .Blue ("Request URL:" ), * f .Url )
62
53
}
63
54
64
55
return output
@@ -81,16 +72,10 @@ func ListIntegrationResponseFromAPI(apiResp *flowpipeapiclient.ListIntegrationRe
81
72
82
73
func FpIntegrationFromAPI (apiIntegration flowpipeapiclient.FpIntegration ) FpIntegration {
83
74
res := FpIntegration {
84
- Name : typehelpers .SafeString (apiIntegration .Name ),
85
- Type : typehelpers .SafeString (apiIntegration .Type ),
86
- Description : apiIntegration .Description ,
87
- Title : apiIntegration .Title ,
88
- Documentation : apiIntegration .Documentation ,
89
- }
90
- if ! helpers .IsNil (apiIntegration .Tags ) {
91
- res .Tags = * apiIntegration .Tags
92
- } else {
93
- res .Tags = make (map [string ]string )
75
+ Name : typehelpers .SafeString (apiIntegration .Name ),
76
+ Type : typehelpers .SafeString (apiIntegration .Type ),
77
+ Description : apiIntegration .Description ,
78
+ Title : apiIntegration .Title ,
94
79
}
95
80
return res
96
81
}
@@ -101,7 +86,6 @@ func FpIntegrationFromModIntegration(integration modconfig.Integration) (*FpInte
101
86
Type : integration .GetIntegrationType (),
102
87
Url : integration .GetIntegrationImpl ().Url ,
103
88
Description : integration .GetHclResourceImpl ().Description ,
104
- Tags : integration .GetTags (),
105
89
}
106
90
107
91
resp .FileName = integration .GetIntegrationImpl ().FileName
@@ -156,5 +140,5 @@ func (p PrintableIntegration) GetTable() (*printers.Table, error) {
156
140
}
157
141
158
142
func (PrintableIntegration ) getColumns () (columns []string ) {
159
- return []string {"NAME" , "TYPE" , "DESCRIPTION" , "URL" }
143
+ return []string {"NAME" , "TYPE" , "DESCRIPTION" , "REQUEST URL" }
160
144
}
0 commit comments