@@ -3,8 +3,7 @@ package main
33import (
44 "github.com/spf13/cobra"
55
6- "github.com/klev-dev/klev-api-go/egress_webhooks"
7- "github.com/klev-dev/klev-api-go/logs"
6+ "github.com/klev-dev/klev-api-go"
87)
98
109func egressWebhooksRoot () * cobra.Command {
@@ -50,7 +49,7 @@ func egressWebhooksCreate() *cobra.Command {
5049 Short : "create new egress webhook" ,
5150 }
5251
53- var in egress_webhooks. CreateParams
52+ var in klev. EgressWebhookCreateParams
5453
5554 logID := cmd .Flags ().String ("log-id" , "" , "log id that will store webhook data" )
5655 cmd .Flags ().StringVar (& in .Metadata , "metadata" , "" , "machine readable metadata" )
@@ -61,7 +60,7 @@ func egressWebhooksCreate() *cobra.Command {
6160 cmd .MarkFlagRequired ("destination" )
6261
6362 cmd .RunE = func (cmd * cobra.Command , args []string ) error {
64- in .LogID = logs .LogID (* logID )
63+ in .LogID = klev .LogID (* logID )
6564
6665 out , err := klient .EgressWebhooks .Create (cmd .Context (), in )
6766 return output (out , err )
@@ -76,7 +75,8 @@ func egressWebhooksGet() *cobra.Command {
7675 Short : "get an egress webhook" ,
7776 Args : cobra .ExactArgs (1 ),
7877 RunE : func (cmd * cobra.Command , args []string ) error {
79- out , err := klient .EgressWebhooks .Get (cmd .Context (), egress_webhooks .EgressWebhookID (args [0 ]))
78+ id := klev .EgressWebhookID (args [0 ])
79+ out , err := klient .EgressWebhooks .Get (cmd .Context (), id )
8080 return output (out , err )
8181 },
8282 }
@@ -89,12 +89,13 @@ func egressWebhooksRotate() *cobra.Command {
8989 Args : cobra .ExactArgs (1 ),
9090 }
9191
92- var in egress_webhooks. RotateParams
92+ var in klev. EgressWebhookRotateParams
9393
9494 cmd .Flags ().Int64Var (& in .ExpireSeconds , "expire-seconds" , 0 , "for how long the old secret is valid" )
9595
9696 cmd .RunE = func (cmd * cobra.Command , args []string ) error {
97- out , err := klient .EgressWebhooks .RotateRaw (cmd .Context (), egress_webhooks .EgressWebhookID (args [0 ]), in )
97+ id := klev .EgressWebhookID (args [0 ])
98+ out , err := klient .EgressWebhooks .RotateRaw (cmd .Context (), id , in )
9899 return output (out , err )
99100 }
100101
@@ -107,7 +108,8 @@ func egressWebhooksStatus() *cobra.Command {
107108 Short : "status an egress webhook" ,
108109 Args : cobra .ExactArgs (1 ),
109110 RunE : func (cmd * cobra.Command , args []string ) error {
110- out , err := klient .EgressWebhooks .Status (cmd .Context (), egress_webhooks .EgressWebhookID (args [0 ]))
111+ id := klev .EgressWebhookID (args [0 ])
112+ out , err := klient .EgressWebhooks .Status (cmd .Context (), id )
111113 return output (out , err )
112114 },
113115 }
@@ -119,7 +121,8 @@ func egressWebhooksDelete() *cobra.Command {
119121 Short : "delete an egress webhook" ,
120122 Args : cobra .ExactArgs (1 ),
121123 RunE : func (cmd * cobra.Command , args []string ) error {
122- out , err := klient .EgressWebhooks .Delete (cmd .Context (), egress_webhooks .EgressWebhookID (args [0 ]))
124+ id := klev .EgressWebhookID (args [0 ])
125+ out , err := klient .EgressWebhooks .Delete (cmd .Context (), id )
123126 return output (out , err )
124127 },
125128 }
0 commit comments