Skip to content

Latest commit

 

History

History
284 lines (178 loc) · 7.86 KB

DomainAntispamPoliciesApi.md

File metadata and controls

284 lines (178 loc) · 7.86 KB

\DomainAntispamPoliciesApi

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

CreateDomainPolicy

CreateAlias200Response CreateDomainPolicy(ctx).CreateDomainPolicyRequest(createDomainPolicyRequest).Execute()

Create domain policy

Example

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)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiCreateDomainPolicyRequest struct via the builder pattern

Name Type Description Notes
createDomainPolicyRequest CreateDomainPolicyRequest

Return type

CreateAlias200Response

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

DeleteDomainPolicy

CreateAlias200Response DeleteDomainPolicy(ctx).DeleteDomainPolicyRequest(deleteDomainPolicyRequest).Execute()

Delete domain policy

Example

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)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiDeleteDomainPolicyRequest struct via the builder pattern

Name Type Description Notes
deleteDomainPolicyRequest DeleteDomainPolicyRequest

Return type

CreateAlias200Response

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

ListBlacklistDomainPolicy

ListBlacklistDomainPolicy(ctx, domain).XAPIKey(xAPIKey).Execute()

List blacklist domain policy

Example

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)
    }
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
domain string name of domain

Other Parameters

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 |

Return type

(empty response body)

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

ListWhitelistDomainPolicy

ListWhitelistDomainPolicy(ctx, domain).XAPIKey(xAPIKey).Execute()

List whitelist domain policy

Example

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)
    }
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
domain string name of domain

Other Parameters

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 |

Return type

(empty response body)

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]