All URIs are relative to http://localhost
Method | HTTP request | Description |
---|---|---|
CreateDomainPolicy | Post /api/v1/add/domain-policy | Create domain policy |
DeleteDomainPolicy | Post /api/v1/delete/domain-policy | Delete domain policy |
ListBlacklistDomainPolicy | Get /api/v1/get/policy_bl_domain/{domain} | List blacklist domain policy |
ListWhitelistDomainPolicy | Get /api/v1/get/policy_wl_domain/{domain} | List whitelist domain policy |
CreateAlias200Response CreateDomainPolicy(ctx).CreateDomainPolicyRequest(createDomainPolicyRequest).Execute()
Create domain policy
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/shoopea/mailcow-go"
)
func main() {
createDomainPolicyRequest := *openapiclient.NewCreateDomainPolicyRequest() // CreateDomainPolicyRequest | (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.DomainAntispamPoliciesApi.CreateDomainPolicy(context.Background()).CreateDomainPolicyRequest(createDomainPolicyRequest).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DomainAntispamPoliciesApi.CreateDomainPolicy``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `CreateDomainPolicy`: CreateAlias200Response
fmt.Fprintf(os.Stdout, "Response from `DomainAntispamPoliciesApi.CreateDomainPolicy`: %v\n", resp)
}
Other parameters are passed through a pointer to a apiCreateDomainPolicyRequest struct via the builder pattern
Name | Type | Description | Notes |
---|---|---|---|
createDomainPolicyRequest | CreateDomainPolicyRequest |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
CreateAlias200Response DeleteDomainPolicy(ctx).DeleteDomainPolicyRequest(deleteDomainPolicyRequest).Execute()
Delete domain policy
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/shoopea/mailcow-go"
)
func main() {
deleteDomainPolicyRequest := *openapiclient.NewDeleteDomainPolicyRequest() // DeleteDomainPolicyRequest | (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.DomainAntispamPoliciesApi.DeleteDomainPolicy(context.Background()).DeleteDomainPolicyRequest(deleteDomainPolicyRequest).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DomainAntispamPoliciesApi.DeleteDomainPolicy``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `DeleteDomainPolicy`: CreateAlias200Response
fmt.Fprintf(os.Stdout, "Response from `DomainAntispamPoliciesApi.DeleteDomainPolicy`: %v\n", resp)
}
Other parameters are passed through a pointer to a apiDeleteDomainPolicyRequest struct via the builder pattern
Name | Type | Description | Notes |
---|---|---|---|
deleteDomainPolicyRequest | DeleteDomainPolicyRequest |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ListBlacklistDomainPolicy(ctx, domain).XAPIKey(xAPIKey).Execute()
List blacklist domain policy
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/shoopea/mailcow-go"
)
func main() {
domain := "domain_example" // string | name of domain
xAPIKey := "api-key-string" // string | e.g. api-key-string (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
r, err := apiClient.DomainAntispamPoliciesApi.ListBlacklistDomainPolicy(context.Background(), domain).XAPIKey(xAPIKey).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DomainAntispamPoliciesApi.ListBlacklistDomainPolicy``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
domain | string | name of domain |
Other parameters are passed through a pointer to a apiListBlacklistDomainPolicyRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
xAPIKey | string | e.g. api-key-string |
(empty response body)
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ListWhitelistDomainPolicy(ctx, domain).XAPIKey(xAPIKey).Execute()
List whitelist domain policy
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/shoopea/mailcow-go"
)
func main() {
domain := "domain_example" // string | name of domain
xAPIKey := "api-key-string" // string | e.g. api-key-string (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
r, err := apiClient.DomainAntispamPoliciesApi.ListWhitelistDomainPolicy(context.Background(), domain).XAPIKey(xAPIKey).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DomainAntispamPoliciesApi.ListWhitelistDomainPolicy``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
domain | string | name of domain |
Other parameters are passed through a pointer to a apiListWhitelistDomainPolicyRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
xAPIKey | string | e.g. api-key-string |
(empty response body)
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]