@@ -48,6 +48,8 @@ const (
4848 operationCallRegisterOrgRelay = "CallRegisterOrgRelay"
4949 operationCallGetOrgRelays = "CallGetOrgRelays"
5050 operationCallRegisterGateway = "CallRegisterGateway"
51+ operationCallConnectGateway = "CallConnectGateway"
52+ operationCallEnrollGateway = "CallEnrollGateway"
5153 operationCallPAMAccess = "CallPAMAccess"
5254 operationCallPAMAccessApprovalRequest = "CallPAMAccessApprovalRequest"
5355 operationCallPAMSessionCredentials = "CallPAMSessionCredentials"
@@ -895,6 +897,26 @@ func CallGetRelays(httpClient *resty.Client) (GetRelaysResponse, error) {
895897 return resBody , nil
896898}
897899
900+ func CallConnectGateway (httpClient * resty.Client , request ConnectGatewayRequest ) (RegisterGatewayResponse , error ) {
901+ var resBody RegisterGatewayResponse
902+ response , err := httpClient .
903+ R ().
904+ SetResult (& resBody ).
905+ SetHeader ("User-Agent" , USER_AGENT ).
906+ SetBody (request ).
907+ Post (fmt .Sprintf ("%v/v3/gateways/connect" , config .INFISICAL_URL ))
908+
909+ if err != nil {
910+ return RegisterGatewayResponse {}, NewGenericRequestError (operationCallConnectGateway , err )
911+ }
912+
913+ if response .IsError () {
914+ return RegisterGatewayResponse {}, NewAPIErrorWithResponse (operationCallConnectGateway , response , nil )
915+ }
916+
917+ return resBody , nil
918+ }
919+
898920func CallRegisterGateway (httpClient * resty.Client , request RegisterGatewayRequest ) (RegisterGatewayResponse , error ) {
899921 var resBody RegisterGatewayResponse
900922 response , err := httpClient .
@@ -915,6 +937,26 @@ func CallRegisterGateway(httpClient *resty.Client, request RegisterGatewayReques
915937 return resBody , nil
916938}
917939
940+ func CallEnrollGateway (httpClient * resty.Client , request EnrollGatewayRequest ) (EnrollGatewayResponse , error ) {
941+ var resBody EnrollGatewayResponse
942+ response , err := httpClient .
943+ R ().
944+ SetResult (& resBody ).
945+ SetHeader ("User-Agent" , USER_AGENT ).
946+ SetBody (request ).
947+ Post (fmt .Sprintf ("%v/v3/gateways/token-auth/enroll" , config .INFISICAL_URL ))
948+
949+ if err != nil {
950+ return EnrollGatewayResponse {}, NewGenericRequestError (operationCallEnrollGateway , err )
951+ }
952+
953+ if response .IsError () {
954+ return EnrollGatewayResponse {}, NewAPIErrorWithResponse (operationCallEnrollGateway , response , nil )
955+ }
956+
957+ return resBody , nil
958+ }
959+
918960func CallPAMAccess (httpClient * resty.Client , request PAMAccessRequest ) (PAMAccessResponse , error ) {
919961 var pamAccessResponse PAMAccessResponse
920962 response , err := httpClient .
0 commit comments