@@ -126,80 +126,79 @@ func (c *Client) ListCertificateStoreTypes() (*[]CertificateStoreType, error) {
126126// - StorePath : string
127127// - Properties : []StringTuple *Note - Method converts this array of StringTuples to a JSON string if provided
128128// - AgentId : string
129- //
130- // func (c *Client) CreateStoreType(ca *CertificateStoreType) (*CertificateStoreType, error) {
131- // log.Println("[INFO] Creating new certificate store type with Keyfactor")
132- //
133- // // Validate that the required fields are present
134- // //err := validateCreateStoreTypeArgs(ca)
135- // //if err != nil {
136- // // return nil, err
137- // //}
138- //
139- // // Set Keyfactor-specific headers
140- // headers := &apiHeaders{
141- // Headers: []StringTuple{
142- // {"x-keyfactor-api-version", "1"},
143- // {"x-keyfactor-requested-with", "APIClient"},
144- // },
145- // }
146- //
147- // keyfactorAPIStruct := &request{
148- // Method: "POST",
149- // Endpoint: "CertificateStoreType",
150- // Headers: headers,
151- // Payload: &ca,
152- // }
153- //
154- // resp, err := c.sendRequest(keyfactorAPIStruct)
155- // if err != nil {
156- // return nil, err
157- // }
158- //
159- // jsonResp := &CertStoreTypeResponse{}
160- // err = json.NewDecoder(resp.Body).Decode(&jsonResp)
161- // if err != nil {
162- // return nil, err
163- // }
164- // return jsonResp, nil
165- // }
166- //
167- // func (c *Client) UpdateStoreType(ca *CertificateStoreType) (*CertificateStoreType, error) {
168- // log.Println("[INFO] Creating new certificate store type with Keyfactor")
169- //
170- // // Validate that the required fields are present
171- // //err := validateCreateStoreTypeArgs(ca)
172- // //if err != nil {
173- // // return nil, err
174- // //}
175- //
176- // // Set Keyfactor-specific headers
177- // headers := &apiHeaders{
178- // Headers: []StringTuple{
179- // {"x-keyfactor-api-version", "1"},
180- // {"x-keyfactor-requested-with", "APIClient"},
181- // },
182- // }
183- //
184- // keyfactorAPIStruct := &request{
185- // Method: "POST",
186- // Endpoint: "CertificateStoreType",
187- // Headers: headers,
188- // Payload: &ca,
189- // }
190- //
191- // resp, err := c.sendRequest(keyfactorAPIStruct)
192- // if err != nil {
193- // return nil, err
194- // }
195- //
196- // jsonResp := &CertStoreTypeResponse{}
197- // err = json.NewDecoder(resp.Body).Decode(&jsonResp)
198- // if err != nil {
199- // return nil, err
200- // }
201- // return jsonResp, nil
202- // }
129+ func (c * Client ) CreateStoreType (ca * CertificateStoreType ) (* CertificateStoreType , error ) {
130+ log .Println ("[INFO] Creating new certificate store type with Keyfactor" )
131+
132+ // Validate that the required fields are present
133+ //err := validateCreateStoreTypeArgs(ca)
134+ //if err != nil {
135+ // return nil, err
136+ //}
137+
138+ // Set Keyfactor-specific headers
139+ headers := & apiHeaders {
140+ Headers : []StringTuple {
141+ {"x-keyfactor-api-version" , "1" },
142+ {"x-keyfactor-requested-with" , "APIClient" },
143+ },
144+ }
145+
146+ keyfactorAPIStruct := & request {
147+ Method : "POST" ,
148+ Endpoint : "CertificateStoreTypes" ,
149+ Headers : headers ,
150+ Payload : & ca ,
151+ }
152+
153+ resp , err := c .sendRequest (keyfactorAPIStruct )
154+ if err != nil {
155+ return nil , err
156+ }
157+
158+ jsonResp := & CertificateStoreType {}
159+ err = json .NewDecoder (resp .Body ).Decode (& jsonResp )
160+ if err != nil {
161+ return nil , err
162+ }
163+ return jsonResp , nil
164+ }
165+
166+ func (c * Client ) UpdateStoreType (ca * CertificateStoreType ) (* CertificateStoreType , error ) {
167+ log .Println ("[INFO] Creating new certificate store type with Keyfactor" )
168+
169+ // Validate that the required fields are present
170+ //err := validateCreateStoreTypeArgs(ca)
171+ //if err != nil {
172+ // return nil, err
173+ //}
174+
175+ // Set Keyfactor-specific headers
176+ headers := & apiHeaders {
177+ Headers : []StringTuple {
178+ {"x-keyfactor-api-version" , "1" },
179+ {"x-keyfactor-requested-with" , "APIClient" },
180+ },
181+ }
182+
183+ keyfactorAPIStruct := & request {
184+ Method : "POST" ,
185+ Endpoint : "CertificateStoreType" ,
186+ Headers : headers ,
187+ Payload : & ca ,
188+ }
189+
190+ resp , err := c .sendRequest (keyfactorAPIStruct )
191+ if err != nil {
192+ return nil , err
193+ }
194+
195+ jsonResp := & CertificateStoreType {}
196+ err = json .NewDecoder (resp .Body ).Decode (& jsonResp )
197+ if err != nil {
198+ return nil , err
199+ }
200+ return jsonResp , nil
201+ }
203202func (c * Client ) DeleteCertificateStoreType (id int ) (* DeleteStoreType , error ) {
204203 log .Printf ("[INFO] Attempting to delete certificate store type %d" , id )
205204
0 commit comments