mirror of
https://github.com/usual2970/certimate.git
synced 2025-06-11 23:19:52 +00:00
58 lines
1.6 KiB
Go
58 lines
1.6 KiB
Go
package gnamesdk
|
|
|
|
import (
|
|
"encoding/json"
|
|
)
|
|
|
|
func (c *Client) AddDomainResolution(req *AddDomainResolutionRequest) (*AddDomainResolutionResponse, error) {
|
|
params := make(map[string]any)
|
|
jsonData, _ := json.Marshal(req)
|
|
json.Unmarshal(jsonData, ¶ms)
|
|
|
|
result := AddDomainResolutionResponse{}
|
|
err := c.sendRequestWithResult("/api/resolution/add", params, &result)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return &result, nil
|
|
}
|
|
|
|
func (c *Client) ModifyDomainResolution(req *ModifyDomainResolutionRequest) (*ModifyDomainResolutionResponse, error) {
|
|
params := make(map[string]any)
|
|
jsonData, _ := json.Marshal(req)
|
|
json.Unmarshal(jsonData, ¶ms)
|
|
|
|
result := ModifyDomainResolutionResponse{}
|
|
err := c.sendRequestWithResult("/api/resolution/edit", params, &result)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return &result, nil
|
|
}
|
|
|
|
func (c *Client) DeleteDomainResolution(req *DeleteDomainResolutionRequest) (*DeleteDomainResolutionResponse, error) {
|
|
params := make(map[string]any)
|
|
jsonData, _ := json.Marshal(req)
|
|
json.Unmarshal(jsonData, ¶ms)
|
|
|
|
result := DeleteDomainResolutionResponse{}
|
|
err := c.sendRequestWithResult("/api/resolution/delete", params, &result)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return &result, nil
|
|
}
|
|
|
|
func (c *Client) ListDomainResolution(req *ListDomainResolutionRequest) (*ListDomainResolutionResponse, error) {
|
|
params := make(map[string]any)
|
|
jsonData, _ := json.Marshal(req)
|
|
json.Unmarshal(jsonData, ¶ms)
|
|
|
|
result := ListDomainResolutionResponse{}
|
|
err := c.sendRequestWithResult("/api/resolution/list", params, &result)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return &result, nil
|
|
}
|