Skip to content

Latest commit

 

History

History
263 lines (168 loc) · 6.37 KB

DomainMappingAPI.md

File metadata and controls

263 lines (168 loc) · 6.37 KB

\DomainMappingAPI

All URIs are relative to http://localhost

Method HTTP request Description
AddDomainMapping Put /domainMappings Add a domain mapping
ListDestinationDomains Get /domainMappings/{fromDomain} List all destination domains for a source domain
ListDomainMappings Get /domainMappings List all domain mappings
RemoveDomainMapping Delete /domainMappings Remove a domain mapping

AddDomainMapping

AddDomainMapping(ctx).Body(body).Execute()

Add a domain mapping

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "go.opscenter.dev/james-go-client"
)

func main() {
    body := "body_example" // string | 

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    r, err := apiClient.DomainMappingAPI.AddDomainMapping(context.Background()).Body(body).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `DomainMappingAPI.AddDomainMapping``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
}

Path Parameters

Other Parameters

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

Name Type Description Notes
body string

Return type

(empty response body)

Authorization

No authorization required

HTTP request headers

  • Content-Type: text/plain
  • Accept: Not defined

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

ListDestinationDomains

[]string ListDestinationDomains(ctx, fromDomain).Execute()

List all destination domains for a source domain

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "go.opscenter.dev/james-go-client"
)

func main() {
    fromDomain := "sourceDomain.tld" // string | Source domain name

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.DomainMappingAPI.ListDestinationDomains(context.Background(), fromDomain).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `DomainMappingAPI.ListDestinationDomains``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `ListDestinationDomains`: []string
    fmt.Fprintf(os.Stdout, "Response from `DomainMappingAPI.ListDestinationDomains`: %v\n", resp)
}

Path Parameters

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

Other Parameters

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

Name Type Description Notes

Return type

[]string

Authorization

No authorization required

HTTP request headers

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

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

ListDomainMappings

map[string][]string ListDomainMappings(ctx).Execute()

List all domain mappings

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "go.opscenter.dev/james-go-client"
)

func main() {

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.DomainMappingAPI.ListDomainMappings(context.Background()).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `DomainMappingAPI.ListDomainMappings``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `ListDomainMappings`: map[string][]string
    fmt.Fprintf(os.Stdout, "Response from `DomainMappingAPI.ListDomainMappings`: %v\n", resp)
}

Path Parameters

This endpoint does not need any parameter.

Other Parameters

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

Return type

map[string][]string

Authorization

No authorization required

HTTP request headers

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

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

RemoveDomainMapping

RemoveDomainMapping(ctx).Body(body).Execute()

Remove a domain mapping

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "go.opscenter.dev/james-go-client"
)

func main() {
    body := "body_example" // string | 

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    r, err := apiClient.DomainMappingAPI.RemoveDomainMapping(context.Background()).Body(body).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `DomainMappingAPI.RemoveDomainMapping``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
}

Path Parameters

Other Parameters

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

Name Type Description Notes
body string

Return type

(empty response body)

Authorization

No authorization required

HTTP request headers

  • Content-Type: text/plain
  • Accept: Not defined

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