Help us shape the future of Go! Take the 2026 Go Developer Survey

dimail

package module
v0.0.0-...-34b6a54 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 10, 2026 License: BSD-3-Clause Imports: 10 Imported by: 0

README

go-dimail

go-dimail

ci Go Reference

A pure-Go (CGO-free) client for the Dimail API — the mail-hosting management API of the French government's La Suite numérique platform (https://api.osprod.dimail1.numerique.gouv.fr).

The typed models and the request methods are generated from the API's own OpenAPI document (openapi.json, committed at the repository root) by the generator in internal/gen. Everything the API exposes — 91 operations across users, domains, mailboxes (v1 and v2), aliases, forwards, allows, identities, app-passwords, the /my self-service views, and the /system and /logs administration surface — is available with concrete Go types. Regenerate after refreshing the spec with:

go generate ./...
  • CGO-free — the same test binary runs identically on all six supported 64-bit targets (amd64, arm64, riscv64, loong64, ppc64le, s390x).
  • 100 % test coverage, race-clean, enforced in CI.
  • Reproducible — the client is derived from source; the generator and the spec both live in the tree, and CI fails if the checked-in generated files drift from what the spec produces.

Install

go get github.com/go-dimail/dimail

Authentication

Dimail authenticates with HTTP Basic credentials to mint a bearer token, then expects that token on every other call. A Client sends a bearer token when one is set and otherwise falls back to the Basic credentials, so Login naturally reaches the token endpoint with Basic auth:

package main

import (
	"context"
	"fmt"
	"log"

	"github.com/go-dimail/dimail"
)

func main() {
	ctx := context.Background()

	c := dimail.NewClient(dimail.WithBasicAuth("apiuser", "apipass"))
	if _, err := c.Login(ctx); err != nil { // fetches and stores a bearer token
		log.Fatal(err)
	}

	// List the domains this user administers.
	domains, err := c.GetDomains(ctx)
	if err != nil {
		log.Fatal(err)
	}
	for _, d := range domains {
		fmt.Printf("%s (state=%s)\n", d.Name, d.State)
	}

	// Create a mailbox (v2 API).
	mb, err := c.PostMailboxV2(ctx, "example.gouv.fr", "jean.dupont", &dimail.CreateMailbox2{
		Features: []dimail.MailboxFeature{dimail.MailboxFeatureOX},
	})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println("created:", mb.Email)
}

If you already hold a token, skip Login:

c := dimail.NewClient(dimail.WithToken(os.Getenv("DIMAIL_TOKEN")))

Errors

Every non-2xx response is returned as an *dimail.APIError, which carries the status code, the request that produced it, the raw body, and the FastAPI detail field when present. Convenience predicates cover the common cases:

_, err := c.GetDomain(ctx, "absent.example")
var apiErr *dimail.APIError
if errors.As(err, &apiErr) && apiErr.NotFound() {
	// handle 404
}

Unauthorized(), Forbidden() and Conflict() are also provided.

Configuration

NewClient accepts functional options:

Option Purpose
WithBaseURL(u) Override the API root (defaults to production).
WithHTTPClient(h) Supply your own *http.Client (timeouts, proxy, TLS).
WithBasicAuth(user, pass) Credentials used to obtain a token.
WithToken(token) Authenticate every request with a bearer token.
WithUserAgent(ua) Override the User-Agent header.

Layout

Path Contents
client.go Hand-written runtime: Client, auth, transport, generic decoders, APIError.
models_gen.go Generated typed models (96 types: structs, string enums, scalar aliases).
client_gen.go Generated request methods (one per OpenAPI operation).
client_gen_smoke_test.go Generated test exercising every method.
openapi.json The upstream OpenAPI 3.1 document (the source of truth).
internal/gen The OpenAPI → Go generator.

License

BSD-3-Clause. See LICENSE.

This is an independent client library; it is not affiliated with or endorsed by DINUM or the La Suite numérique team.

Documentation

Overview

Package dimail is a pure-Go (CGO-free) client for the Dimail API, the mail hosting management API of the French government's "La Suite numérique" platform (https://api.osprod.dimail1.numerique.gouv.fr).

The typed models in models_gen.go and the request methods in client_gen.go are generated from the committed OpenAPI document (openapi.json) by the generator in internal/gen; run "go generate ./..." to refresh them. This file holds the hand-written runtime: the Client, authentication, the HTTP transport, the generic response decoders that every generated method funnels through, and the typed error surface.

Authentication

Dimail authenticates with HTTP Basic credentials to mint a bearer token, then expects that token on every other call. The typical flow is:

c := dimail.NewClient(dimail.WithBasicAuth("user", "pass"))
if _, err := c.Login(ctx); err != nil { // fetches and stores a token
	return err
}
dom, err := c.GetDomain(ctx, "example.com")

A Client sends a bearer token when one is set (via WithToken, SetToken or a prior Login) and otherwise falls back to the Basic credentials. Login relies on that precedence: it runs before a token exists, so the token request is authenticated with Basic.

Example

This example mirrors the README. It is compiled (guaranteeing the documented API stays valid) but not run, since it would contact the live service.

package main

import (
	"context"
	"fmt"
	"log"

	"github.com/go-dimail/dimail"
)

func main() {
	ctx := context.Background()

	c := dimail.NewClient(dimail.WithBasicAuth("apiuser", "apipass"))
	if _, err := c.Login(ctx); err != nil { // fetches and stores a bearer token
		log.Fatal(err)
	}

	domains, err := c.GetDomains(ctx)
	if err != nil {
		log.Fatal(err)
	}
	for _, d := range domains {
		fmt.Printf("%s (state=%s)\n", d.Name, d.State)
	}

	mb, err := c.PostMailboxV2(ctx, "example.gouv.fr", "jean.dupont", &dimail.CreateMailbox2{
		Features: []dimail.MailboxFeature{dimail.MailboxFeatureOX},
	})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println("created:", mb.Email)
}

Index

Examples

Constants

View Source
const DefaultBaseURL = "https://api.osprod.dimail1.numerique.gouv.fr"

DefaultBaseURL is the production Dimail API endpoint.

View Source
const Version = "0.1.0"

Version is the client library version, reported in the default User-Agent.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIError

type APIError struct {
	StatusCode int
	Status     string
	Method     string
	URL        string
	Detail     json.RawMessage
	Body       []byte
}

APIError is returned for any non-2xx response. It carries the status, the request that produced it, and the raw body; Detail holds the FastAPI "detail" field when the body is the usual error envelope.

Example (NotFound)

ExampleAPIError_NotFound shows the typed-error surface.

package main

import (
	"context"
	"errors"
	"fmt"
	"os"

	"github.com/go-dimail/dimail"
)

func main() {
	c := dimail.NewClient(dimail.WithToken(os.Getenv("DIMAIL_TOKEN")))

	_, err := c.GetDomain(context.Background(), "absent.example")
	var apiErr *dimail.APIError
	if errors.As(err, &apiErr) && apiErr.NotFound() {
		fmt.Println("no such domain")
	}
}

func (*APIError) Conflict

func (e *APIError) Conflict() bool

Conflict reports whether the status was 409.

func (*APIError) Error

func (e *APIError) Error() string

Error implements error.

func (*APIError) Forbidden

func (e *APIError) Forbidden() bool

Forbidden reports whether the status was 403.

func (*APIError) NotFound

func (e *APIError) NotFound() bool

NotFound reports whether the status was 404.

func (*APIError) Unauthorized

func (e *APIError) Unauthorized() bool

Unauthorized reports whether the status was 401.

type Address

type Address struct {
	DomainName     DomainName `json:"domain_name"`
	IsAlias        *bool      `json:"is_alias,omitempty"`
	IsForward      *bool      `json:"is_forward,omitempty"`
	IsMailbox      *bool      `json:"is_mailbox,omitempty"`
	IsOX           *bool      `json:"is_ox,omitempty"`
	OXPrimaryEmail *string    `json:"ox_primary_email,omitempty"`
	OXSenders      []string   `json:"ox_senders,omitempty"`
	UserName       UserName   `json:"user_name"`
}

Address

type AddressName

type AddressName = string

AddressName

type Alias

type Alias struct {
	AllowToSend *bool  `json:"allow_to_send,omitempty"`
	Destination string `json:"destination"`
	Domain      string `json:"domain"`
	Username    string `json:"username"`
}

Alias

type AliasDest

type AliasDest = string

AliasDest

type Allowed

type Allowed struct {
	Domain string `json:"domain"`
	User   string `json:"user"`
}

Allowed allowed model.

type ApiVersion

type ApiVersion struct {
	Changelog []string `json:"changelog"`
	Version   string   `json:"version"`
}

ApiVersion

type AppPassword

type AppPassword struct {
	Client    *string         `json:"client,omitempty"`
	IPAddress *string         `json:"ip_address,omitempty"`
	LastUse   *string         `json:"last_use,omitempty"`
	Login     string          `json:"login"`
	Name      string          `json:"name"`
	Type      AppPasswordType `json:"type"`
	UserAgent *string         `json:"user_agent,omitempty"`
	UUID      string          `json:"uuid"`
}

AppPassword

type AppPasswordType

type AppPasswordType string

AppPasswordType

const (
	AppPasswordTypeAPI        AppPasswordType = "api"
	AppPasswordTypeIMAP       AppPasswordType = "imap"
	AppPasswordTypeCaldav     AppPasswordType = "caldav"
	AppPasswordTypeCarddav    AppPasswordType = "carddav"
	AppPasswordTypeCalcarddav AppPasswordType = "calcarddav"
)

type Authentication

type Authentication struct {
	Detail string `json:"detail"`
}

Authentication

type CheckContext

type CheckContext struct {
	Cid        int      `json:"cid"`
	Domains    []string `json:"domains"`
	Name       string   `json:"name"`
	SchemaName string   `json:"schema_name"`
}

CheckContext

type CheckContexts

type CheckContexts struct {
	Contexts []CheckContext `json:"contexts"`
}

CheckContexts

type CheckedContext

type CheckedContext struct {
	Cid        int           `json:"cid"`
	Comment    []string      `json:"comment"`
	Domains    []string      `json:"domains"`
	Name       string        `json:"name"`
	SchemaName string        `json:"schema_name"`
	Status     ContextStatus `json:"status"`
}

CheckedContext

type CheckedContexts

type CheckedContexts struct {
	Contexts []CheckedContext `json:"contexts"`
	Schemas  map[string]any   `json:"schemas"`
}

CheckedContexts

type Client

type Client struct {
	// BaseURL is the API root, without a trailing slash.
	BaseURL string
	// HTTPClient performs requests. When nil, http.DefaultClient is used.
	HTTPClient *http.Client
	// UserAgent is sent with every request when non-empty.
	UserAgent string
	// contains filtered or unexported fields
}

Client is a Dimail API client. It is safe for concurrent use once configured; SetToken mutates the stored token and should be sequenced by the caller if shared across goroutines during login.

func NewClient

func NewClient(opts ...Option) *Client

NewClient builds a Client pointed at the production API by default.

func (*Client) ChangePassword

func (c *Client) ChangePassword(ctx context.Context) (string, error)

ChangePassword issues POST /webhook/changepassword: Change Password.

func (*Client) CheckDomain

func (c *Client) CheckDomain(ctx context.Context, domainName string) (*Domain, error)

CheckDomain issues GET /domains/{domain_name}/check: Check Domain.

func (*Client) CheckPassword

func (c *Client) CheckPassword(ctx context.Context, domainName string, userName string, body *MailboxPassword) (bool, error)

CheckPassword issues POST /domains/{domain_name}/mailboxes/{user_name}/check_password: Check Password.

func (*Client) CurrentToken

func (c *Client) CurrentToken() string

CurrentToken returns the bearer token currently in use, if any.

func (*Client) DeleteAlias

func (c *Client) DeleteAlias(ctx context.Context, domainName string, userName string, destination string) error

DeleteAlias issues DELETE /domains/{domain_name}/aliases/{user_name}/{destination}: Delete Alias.

func (*Client) DeleteAllow

func (c *Client) DeleteAllow(ctx context.Context, domainName string, userName string) error

DeleteAllow issues DELETE /allows/{domain_name}/{user_name}: Delete Allow.

func (*Client) DeleteAppPassword

func (c *Client) DeleteAppPassword(ctx context.Context, domainName string, userName string, uuid string) error

DeleteAppPassword issues DELETE /domains/{domain_name}/mailboxes/{user_name}/app_passwords/{uuid}: Delete App Password.

func (*Client) DeleteCrashLog

func (c *Client) DeleteCrashLog(ctx context.Context, crashName string) error

DeleteCrashLog issues DELETE /logs/crashes/{crash_name}: Del Crash.

func (*Client) DeleteDomain

func (c *Client) DeleteDomain(ctx context.Context, domainName string) error

DeleteDomain issues DELETE /domains/{domain_name}: Delete a domain.

func (*Client) DeleteForward

func (c *Client) DeleteForward(ctx context.Context, domainName string, userName string) error

DeleteForward issues DELETE /domains/{domain_name}/forwards/{user_name}: Delete Forward.

func (*Client) DeleteIdentities

func (c *Client) DeleteIdentities(ctx context.Context, proconnect string, email string) error

DeleteIdentities issues DELETE /identities/{proconnect}/{email}: Delete Identities.

func (*Client) DeleteMailbox

func (c *Client) DeleteMailbox(ctx context.Context, domainName string, userName string) error

DeleteMailbox issues DELETE /domains/{domain_name}/mailboxes/{user_name}: Delete Mailbox.

func (*Client) DeleteMaster

func (c *Client) DeleteMaster(ctx context.Context, domainName string, userName string, secondaryEmail string) error

DeleteMaster issues DELETE /domains/{domain_name}/mailboxes/{user_name}/master_of/{secondary_email}: Delete Master.

func (*Client) DeletePublicAlias

func (c *Client) DeletePublicAlias(ctx context.Context, userName string, domainName string, destination string) error

DeletePublicAlias issues DELETE /aliases/{user_name}@{domain_name}/{destination}: Delete Alias.

func (*Client) DeleteRateLimit

func (c *Client) DeleteRateLimit(ctx context.Context, name string) error

DeleteRateLimit issues DELETE /system/rate_limits/{name}: Delete Rate Limit.

func (*Client) DeleteUser

func (c *Client) DeleteUser(ctx context.Context, userName string) error

DeleteUser issues DELETE /users/{user_name}: Delete User.

func (*Client) FixDomain

func (c *Client) FixDomain(ctx context.Context, domainName string) (*Domain, error)

FixDomain issues GET /domains/{domain_name}/fix: Fix Domain.

func (*Client) ForcePassword

func (c *Client) ForcePassword(ctx context.Context, domainName string, userName string, body *MailboxForcePassword) (*NewMailbox, error)

ForcePassword issues POST /domains/{domain_name}/mailboxes/{user_name}/force_password: Force the password of a mailbox.

func (*Client) GetAddress

func (c *Client) GetAddress(ctx context.Context, domainName string, userName string) (*Address, error)

GetAddress issues GET /domains/{domain_name}/address/{user_name}: Get Address.

func (*Client) GetAlias

func (c *Client) GetAlias(ctx context.Context, domainName string, userName *string, destination *string) ([]Alias, error)

GetAlias issues GET /domains/{domain_name}/aliases/: Get Alias.

func (*Client) GetAllow

func (c *Client) GetAllow(ctx context.Context, username *string, domain *string) ([]Allowed, error)

GetAllow issues GET /allows/: Get Allows.

func (*Client) GetAppPassword

func (c *Client) GetAppPassword(ctx context.Context, domainName string, userName string, uuid string) (*AppPassword, error)

GetAppPassword issues GET /domains/{domain_name}/mailboxes/{user_name}/app_passwords/{uuid}: Get App Password.

func (*Client) GetAppPasswords

func (c *Client) GetAppPasswords(ctx context.Context, domainName string, userName string) ([]AppPassword, error)

GetAppPasswords issues GET /domains/{domain_name}/mailboxes/{user_name}/app_passwords: Get App Passwords.

func (*Client) GetCode

func (c *Client) GetCode(ctx context.Context, codeString string) (*MailboxCode, error)

GetCode issues GET /code/{code_string}: Get Code.

func (*Client) GetCrashLog

func (c *Client) GetCrashLog(ctx context.Context, crashName string) (*ServerLogs, error)

GetCrashLog issues GET /logs/crashes/{crash_name}: Get Crash.

func (*Client) GetCrashLogs

func (c *Client) GetCrashLogs(ctx context.Context) ([]CrashInfo, error)

GetCrashLogs issues GET /logs/crashes: Get Crashes.

func (*Client) GetDomain

func (c *Client) GetDomain(ctx context.Context, domainName string) (*Domain, error)

GetDomain issues GET /domains/{domain_name}: Get a domain.

func (*Client) GetDomainSpecs

func (c *Client) GetDomainSpecs(ctx context.Context, domainName string) ([]DomainSpec, error)

GetDomainSpecs issues GET /domains/{domain_name}/spec: Spec Domain.

func (*Client) GetDomains

func (c *Client) GetDomains(ctx context.Context) ([]Domain, error)

GetDomains issues GET /domains/: Get all domains.

func (*Client) GetForward

func (c *Client) GetForward(ctx context.Context, domainName string, userName string) (*Forward, error)

GetForward issues GET /domains/{domain_name}/forwards/{user_name}: Get Forward.

func (*Client) GetForwards

func (c *Client) GetForwards(ctx context.Context, domainName string) ([]Forward, error)

GetForwards issues GET /domains/{domain_name}/forwards/: Get Forwards.

func (*Client) GetIdentities

func (c *Client) GetIdentities(ctx context.Context, identity *string) ([]string, error)

GetIdentities issues GET /identities: Get Identities.

func (*Client) GetMailbox

func (c *Client) GetMailbox(ctx context.Context, domainName string, userName string) (*Mailbox, error)

GetMailbox issues GET /domains/{domain_name}/mailboxes/{user_name}: Get Mailbox.

func (*Client) GetMailboxIdentities

func (c *Client) GetMailboxIdentities(ctx context.Context, domainName string, userName string) ([]string, error)

GetMailboxIdentities issues GET /domains/{domain_name}/mailboxes/{user_name}/identities: Get Identities.

func (*Client) GetMailboxV2

func (c *Client) GetMailboxV2(ctx context.Context, domainName string, userName string, withExtras *bool) (*Mailbox2, error)

GetMailboxV2 issues GET /v2/domains/{domain_name}/mailboxes/{user_name}: Get Mailbox V2.

func (*Client) GetMailboxes

func (c *Client) GetMailboxes(ctx context.Context, domainName string) ([]Mailbox, error)

GetMailboxes issues GET /domains/{domain_name}/mailboxes/: Get Mailboxes.

func (*Client) GetMailboxesV2

func (c *Client) GetMailboxesV2(ctx context.Context, domainName string, withExtras *bool) ([]Mailbox2, error)

GetMailboxesV2 issues GET /v2/domains/{domain_name}/mailboxes/: Get Mailboxes V2.

func (*Client) GetMaster

func (c *Client) GetMaster(ctx context.Context, domainName string, userName string, secondaryEmail string) (*Secondary, error)

GetMaster issues GET /domains/{domain_name}/mailboxes/{user_name}/master_of/{secondary_email}: Get Master.

func (*Client) GetMastereds

func (c *Client) GetMastereds(ctx context.Context, domainName string, userName string) ([]Secondary, error)

GetMastereds issues GET /domains/{domain_name}/mailboxes/{user_name}/mastered_by: Get Mastereds.

func (*Client) GetMasters

func (c *Client) GetMasters(ctx context.Context, domainName string, userName string) ([]Secondary, error)

GetMasters issues GET /domains/{domain_name}/mailboxes/{user_name}/master_of: Get Masters.

func (*Client) GetMyAliases

func (c *Client) GetMyAliases(ctx context.Context) ([]string, error)

GetMyAliases issues GET /my/aliases: Get My Aliases.

func (*Client) GetMyDomains

func (c *Client) GetMyDomains(ctx context.Context) ([]string, error)

GetMyDomains issues GET /my/domains: Get My Domains.

func (*Client) GetMyMailboxes

func (c *Client) GetMyMailboxes(ctx context.Context) ([]string, error)

GetMyMailboxes issues GET /my/mailboxes: Get My Mailboxes.

func (*Client) GetMyResources

func (c *Client) GetMyResources(ctx context.Context) (*VisibleResources, error)

GetMyResources issues GET /my/resources: Get My Resources.

func (*Client) GetPublicAliasDomains

func (c *Client) GetPublicAliasDomains(ctx context.Context, destination *string) ([]string, error)

GetPublicAliasDomains issues GET /aliases/domains: Get Domains.

func (*Client) GetPublicAliases

func (c *Client) GetPublicAliases(ctx context.Context, destination *string) ([]PubAlias, error)

GetPublicAliases issues GET /aliases: Get Aliases.

func (*Client) GetRateLimit

func (c *Client) GetRateLimit(ctx context.Context, name string) (*RateLimit, error)

GetRateLimit issues GET /system/rate_limits/{name}: Get Rate Limit.

func (*Client) GetRateLimits

func (c *Client) GetRateLimits(ctx context.Context) ([]RateLimit, error)

GetRateLimits issues GET /system/rate_limits: Get Rate Limits.

func (*Client) GetServerLogs

func (c *Client) GetServerLogs(ctx context.Context) (*ServerLogs, error)

GetServerLogs issues GET /logs/: Get Logs.

func (*Client) GetTechDomain

func (c *Client) GetTechDomain(ctx context.Context) (*TechDomain, error)

GetTechDomain issues GET /system/tech_domain: Get Tech Domain.

func (*Client) GetToken

func (c *Client) GetToken(ctx context.Context, username *string) (*Token, error)

GetToken issues GET /token/: Get a token for a user.

func (*Client) GetUser

func (c *Client) GetUser(ctx context.Context, userName string) (*User, error)

GetUser issues GET /users/{user_name}: Get User.

func (*Client) GetUserByProconnectIdentity

func (c *Client) GetUserByProconnectIdentity(ctx context.Context, proconnect string) (*User, error)

GetUserByProconnectIdentity issues GET /users/identity/{proconnect}: Get User By Identity.

func (*Client) GetUsers

func (c *Client) GetUsers(ctx context.Context) ([]User, error)

GetUsers issues GET /users/: Get Users.

func (*Client) GetVersion

func (c *Client) GetVersion(ctx context.Context) (*ApiVersion, error)

GetVersion issues GET /system/version: Get Version.

func (*Client) HealthCheck

func (c *Client) HealthCheck(ctx context.Context) (*ServerStatus, error)

HealthCheck issues GET /system/health_check: Get Health Check.

func (*Client) InternalCheckContexts

func (c *Client) InternalCheckContexts(ctx context.Context, body *CheckContexts) (*CheckedContexts, error)

InternalCheckContexts issues POST /system/check_contexts: Check Contexts.

func (*Client) InternalDisconnectUser

func (c *Client) InternalDisconnectUser(ctx context.Context, domainName string, userName string) (*json.RawMessage, error)

InternalDisconnectUser issues GET /system/disconnect/{domain_name}/{user_name}: Get Disconnect.

func (*Client) InternalGetMailqueue

func (c *Client) InternalGetMailqueue(ctx context.Context, domainName string, userName string) ([]string, error)

InternalGetMailqueue issues GET /system/mailqueue/{domain_name}/{user_name}: Get Mailqueue.

func (*Client) InternalGetStoreInfo

func (c *Client) InternalGetStoreInfo(ctx context.Context, storeName string) (*StoreInfo, error)

InternalGetStoreInfo issues GET /system/store_info/{store_name}: Get Store Info.

func (*Client) InternalGetStoresInfo

func (c *Client) InternalGetStoresInfo(ctx context.Context) ([]StoreInfo, error)

InternalGetStoresInfo issues GET /system/stores_info: Get Stores Info.

func (*Client) InternalImportDomain

func (c *Client) InternalImportDomain(ctx context.Context, domainName string, body *ImportDomain) (*json.RawMessage, error)

InternalImportDomain issues PATCH /system/import_domain/{domain_name}: Import Domain.

func (*Client) InternalMailboxInfo

func (c *Client) InternalMailboxInfo(ctx context.Context, domainName string, userName string) (*MailboxInfo, error)

InternalMailboxInfo issues GET /system/mailbox_info/{domain_name}/{user_name}: Get Mailbox Info.

func (*Client) InternalMailboxesInfo

func (c *Client) InternalMailboxesInfo(ctx context.Context, domainName string) ([]MailboxInfo, error)

InternalMailboxesInfo issues GET /system/mailboxes_info/{domain_name}: Get Mailboxes Info.

func (*Client) InternalMoveMailbox

func (c *Client) InternalMoveMailbox(ctx context.Context, domainName string, userName string) (*json.RawMessage, error)

InternalMoveMailbox issues GET /system/move_mailbox/{domain_name}/{user_name}: Get Move Mailbox.

func (*Client) InternalPatchDatabase

func (c *Client) InternalPatchDatabase(ctx context.Context, dbName string, body *UpdateDatabase) (*json.RawMessage, error)

InternalPatchDatabase issues PATCH /system/database/{db_name}: Patch Database.

func (*Client) InternalPostDatabase

func (c *Client) InternalPostDatabase(ctx context.Context, dbName string, schemaName string) (*SchemaName, error)

InternalPostDatabase issues POST /system/database/{db_name}/{schema_name}: Post Database.

func (*Client) InternalShutdown

func (c *Client) InternalShutdown(ctx context.Context) (*json.RawMessage, error)

InternalShutdown issues GET /system/shutdown: Get Shutdown.

func (*Client) Login

func (c *Client) Login(ctx context.Context) (*Token, error)

Login obtains a bearer token using the configured Basic credentials and stores it on the Client for subsequent calls.

func (*Client) PatchAlias

func (c *Client) PatchAlias(ctx context.Context, domainName string, userName string, destination string, body *UpdateAlias) (*Alias, error)

PatchAlias issues PATCH /domains/{domain_name}/aliases/{user_name}/{destination}: Patch Alias.

func (*Client) PatchDomain

func (c *Client) PatchDomain(ctx context.Context, domainName string, body *UpdateDomain) (*Domain, error)

PatchDomain issues PATCH /domains/{domain_name}: Update a domain.

func (*Client) PatchForward

func (c *Client) PatchForward(ctx context.Context, domainName string, userName string, body *UpdateForward) (*Forward, error)

PatchForward issues PATCH /domains/{domain_name}/forwards/{user_name}: Patch Forward.

func (*Client) PatchMailbox

func (c *Client) PatchMailbox(ctx context.Context, domainName string, userName string, body *UpdateMailbox) (*Mailbox, error)

PatchMailbox issues PATCH /domains/{domain_name}/mailboxes/{user_name}: Patch Mailbox.

func (*Client) PatchMailboxV2

func (c *Client) PatchMailboxV2(ctx context.Context, domainName string, userName string, body *UpdateMailbox2) (*Mailbox2, error)

PatchMailboxV2 issues PATCH /v2/domains/{domain_name}/mailboxes/{user_name}: Patch Mailbox V2.

func (*Client) PatchPublicAlias

func (c *Client) PatchPublicAlias(ctx context.Context, userName string, domainName string, destination string, body *UpdatePubAlias) (*PubAlias, error)

PatchPublicAlias issues PATCH /aliases/{user_name}@{domain_name}/{destination}: Patch Alias.

func (*Client) PatchRateLimit

func (c *Client) PatchRateLimit(ctx context.Context, name string, body *RateLimit) (*RateLimit, error)

PatchRateLimit issues PATCH /system/rate_limits/{name}: Patch Rate Limit.

func (*Client) PatchUser

func (c *Client) PatchUser(ctx context.Context, user string, body *UpdateUser) (*User, error)

PatchUser issues PATCH /users/{user}: Patch User.

func (*Client) PostAliasDomainsDomainNameAliasesPost

func (c *Client) PostAliasDomainsDomainNameAliasesPost(ctx context.Context, domainName string, body *CreateAlias) (*Alias, error)

PostAliasDomainsDomainNameAliasesPost issues POST /domains/{domain_name}/aliases/: Post Alias.

func (*Client) PostAllow

func (c *Client) PostAllow(ctx context.Context, body *Allowed) (*Allowed, error)

PostAllow issues POST /allows/: Post Allow.

func (*Client) PostAppPassword

func (c *Client) PostAppPassword(ctx context.Context, domainName string, userName string, body *CreateAppPassword) (*NewAppPassword, error)

PostAppPassword issues POST /domains/{domain_name}/mailboxes/{user_name}/app_passwords: Post App Password.

func (*Client) PostDomain

func (c *Client) PostDomain(ctx context.Context, noCheck *string, body *CreateDomain) (*Domain, error)

PostDomain issues POST /domains/: Create a domain.

func (*Client) PostForward

func (c *Client) PostForward(ctx context.Context, domainName string, userName string, body *CreateForward) (*Forward, error)

PostForward issues POST /domains/{domain_name}/forwards/{user_name}: Post Forward.

func (*Client) PostIdentity

func (c *Client) PostIdentity(ctx context.Context, body *CreateIdentity) (*json.RawMessage, error)

PostIdentity issues POST /identities: Post Identities.

func (*Client) PostMailbox

func (c *Client) PostMailbox(ctx context.Context, domainName string, userName string, body *CreateMailbox) (*NewMailbox, error)

PostMailbox issues POST /domains/{domain_name}/mailboxes/{user_name}: Post Mailbox.

func (*Client) PostMailboxCode

func (c *Client) PostMailboxCode(ctx context.Context, domainName string, userName string, body *CreateMailboxCode) (*MailboxCode, error)

PostMailboxCode issues POST /domains/{domain_name}/mailboxes/{user_name}/code: Post Mailbox Code.

func (*Client) PostMailboxIdentity

func (c *Client) PostMailboxIdentity(ctx context.Context, domainName string, userName string, identity string) (*json.RawMessage, error)

PostMailboxIdentity issues POST /domains/{domain_name}/mailboxes/{user_name}/identities/{identity}: Post Identities.

func (*Client) PostMailboxV2

func (c *Client) PostMailboxV2(ctx context.Context, domainName string, userName string, body *CreateMailbox2) (*NewMailbox, error)

PostMailboxV2 issues POST /v2/domains/{domain_name}/mailboxes/{user_name}: Post Mailbox V2.

func (*Client) PostMaster

func (c *Client) PostMaster(ctx context.Context, domainName string, userName string, secondaryEmail string, body *CreateSecondary) (*Secondary, error)

PostMaster issues POST /domains/{domain_name}/mailboxes/{user_name}/master_of/{secondary_email}: Post Master.

func (*Client) PostPublicAlias

func (c *Client) PostPublicAlias(ctx context.Context, body *CreatePubAlias) (*PubAlias, error)

PostPublicAlias issues POST /aliases: Post Alias.

func (*Client) PostRateLimit

func (c *Client) PostRateLimit(ctx context.Context, name string, body *RateLimit) (*RateLimit, error)

PostRateLimit issues POST /system/rate_limits/{name}: Post Rate Limit.

func (*Client) PostUser

func (c *Client) PostUser(ctx context.Context, body *CreateUser) (*User, error)

PostUser issues POST /users/: Post User.

func (*Client) ResetPassword

func (c *Client) ResetPassword(ctx context.Context, domainName string, userName string) (*NewMailbox, error)

ResetPassword issues POST /domains/{domain_name}/mailboxes/{user_name}/reset_password: Reset Password.

func (*Client) SetToken

func (c *Client) SetToken(token string)

SetToken stores a bearer token, which takes precedence over Basic auth.

func (*Client) UnauthGetDomain

func (c *Client) UnauthGetDomain(ctx context.Context, domainName string) (*json.RawMessage, error)

UnauthGetDomain issues GET /public/domains/{domain_name}: Checks if a domain is managed by our platform.

type Conflict

type Conflict struct {
	Detail string `json:"detail"`
}

Conflict

type ContextStatus

type ContextStatus string

ContextStatus

const (
	ContextStatusAvailable ContextStatus = "available"
	ContextStatusDiffer    ContextStatus = "differ"
	ContextStatusPartial   ContextStatus = "partial"
	ContextStatusSame      ContextStatus = "same"
)

type CrashInfo

type CrashInfo struct {
	Date string `json:"date"`
	Name string `json:"name"`
	Size int    `json:"size"`
}

CrashInfo

type CreateAlias

type CreateAlias struct {
	AllowToSend *bool     `json:"allow_to_send,omitempty"`
	Description *string   `json:"description,omitempty"`
	Destination AliasDest `json:"destination"`
	UserName    UserName  `json:"user_name"`
}

CreateAlias

type CreateAppPassword

type CreateAppPassword struct {
	Name string          `json:"name"`
	Type AppPasswordType `json:"type"`
}

CreateAppPassword

type CreateDomain

type CreateDomain struct {
	ContextID        *int            `json:"context_id,omitempty"`
	ContextName      *string         `json:"context_name,omitempty"`
	Delivery         *Delivery       `json:"delivery,omitempty"`
	Features         []DomainFeature `json:"features"`
	IMAPDomain       *string         `json:"imap_domain,omitempty"`
	MXName           *MXName         `json:"mx_name,omitempty"`
	Name             DomainName      `json:"name"`
	PublicAlias      *bool           `json:"public_alias,omitempty"`
	PublicAliasRules []string        `json:"public_alias_rules,omitempty"`
	SchemaName       *string         `json:"schema_name,omitempty"`
	SMTPDomain       *string         `json:"smtp_domain,omitempty"`
	StoreName        *string         `json:"store_name,omitempty"`
	Transport        *Transport      `json:"transport,omitempty"`
	Webmail          *string         `json:"webmail,omitempty"`
	WebmailDomain    *string         `json:"webmail_domain,omitempty"`
}

CreateDomain domain creation request model. Quite the same as a Domain, but without the.

type CreateForward

type CreateForward struct {
	Nexthop NextHop `json:"nexthop"`
}

CreateForward

type CreateIdentity

type CreateIdentity struct {
	Email      AddressName `json:"email"`
	Password   string      `json:"password"`
	Proconnect string      `json:"proconnect"`
}

CreateIdentity

type CreateMailbox

type CreateMailbox struct {
	AdditionalSenders []string `json:"additionalSenders,omitempty"`
	DisplayName       *string  `json:"displayName,omitempty"`
	GivenName         *string  `json:"givenName,omitempty"`
	RateLimit         *string  `json:"rate_limit,omitempty"`
	Store             *string  `json:"store,omitempty"`
	SurName           *string  `json:"surName,omitempty"`
}

CreateMailbox request to create a mailbox.

type CreateMailbox2

type CreateMailbox2 struct {
	AdditionalSenders []string         `json:"additionalSenders,omitempty"`
	Extras            *MailboxExtra    `json:"extras,omitempty"`
	Features          []MailboxFeature `json:"features"`
	Quota             *QuotaValue      `json:"quota,omitempty"`
	RateLimit         *string          `json:"rate_limit,omitempty"`
	Store             *string          `json:"store,omitempty"`
}

CreateMailbox2

type CreateMailboxCode

type CreateMailboxCode struct {
	ExpiresIn *int `json:"expires_in,omitempty"`
	Maxuse    *int `json:"maxuse,omitempty"`
}

CreateMailboxCode request to get an access code for a mailbox.

type CreatePubAlias

type CreatePubAlias struct {
	Description string      `json:"description"`
	Destination AddressName `json:"destination"`
	Domain      DomainName  `json:"domain"`
}

CreatePubAlias

type CreateSecondary

type CreateSecondary struct {
	DisplayName *string `json:"displayName,omitempty"`
}

CreateSecondary

type CreateUser

type CreateUser struct {
	ACLS       []string `json:"acls,omitempty"`
	Identities []string `json:"identities,omitempty"`
	IsAdmin    bool     `json:"is_admin"`
	Name       string   `json:"name"`
	Password   string   `json:"password"`
	Perms      []string `json:"perms"`
}

CreateUser createUser model.

type Delivery

type Delivery string

Delivery

const (
	DeliveryVirtual Delivery = "virtual"
	DeliveryAlias   Delivery = "alias"
	DeliveryRelay   Delivery = "relay"
)

type Domain

type Domain struct {
	Active           *bool           `json:"active,omitempty"`
	Cert             *TestResult     `json:"cert,omitempty"`
	CnameIMAP        *TestResult     `json:"cname_imap,omitempty"`
	CnameSMTP        *TestResult     `json:"cname_smtp,omitempty"`
	CnameWebmail     *TestResult     `json:"cname_webmail,omitempty"`
	ContextName      *string         `json:"context_name,omitempty"`
	Delivery         json.RawMessage `json:"delivery"`
	DKIM             *TestResult     `json:"dkim,omitempty"`
	DomainExist      *TestResult     `json:"domain_exist,omitempty"`
	Features         []DomainFeature `json:"features"`
	IMAPDomain       *string         `json:"imap_domain,omitempty"`
	MX               *TestResult     `json:"mx,omitempty"`
	MXName           string          `json:"mx_name"`
	Name             string          `json:"name"`
	OX               *TestResult     `json:"ox,omitempty"`
	Postfix          *TestResult     `json:"postfix,omitempty"`
	PublicAlias      *bool           `json:"public_alias,omitempty"`
	PublicAliasRules []string        `json:"public_alias_rules,omitempty"`
	SMTPDomain       *string         `json:"smtp_domain,omitempty"`
	SPF              *TestResult     `json:"spf,omitempty"`
	State            string          `json:"state"`
	StoreName        *string         `json:"store_name,omitempty"`
	Transport        *string         `json:"transport,omitempty"`
	Valid            *bool           `json:"valid,omitempty"`
	Webmail          *string         `json:"webmail,omitempty"`
	WebmailDomain    *string         `json:"webmail_domain,omitempty"`
	WebmailOK        *TestResult     `json:"webmail_ok,omitempty"`
}

Domain domain model. Contains the results of the sanity checks that may have.

type DomainFeature

type DomainFeature string

DomainFeature domainFeature enumeration.

const (
	DomainFeatureWebmail DomainFeature = "webmail"
	DomainFeatureMailbox DomainFeature = "mailbox"
	DomainFeatureAlias   DomainFeature = "alias"
	DomainFeatureMX      DomainFeature = "mx"
	DomainFeatureRelay   DomainFeature = "relay"
)

type DomainName

type DomainName = string

DomainName

type DomainSpec

type DomainSpec struct {
	Target string `json:"target"`
	Type   string `json:"type"`
	Value  string `json:"value"`
}

DomainSpec

type FailedMove

type FailedMove struct {
	Detail string `json:"detail"`
}

FailedMove

type Forward

type Forward struct {
	Domain   DomainName `json:"domain"`
	Nexthop  string     `json:"nexthop"`
	Username UserName   `json:"username"`
}

Forward

type HTTPValidationError

type HTTPValidationError struct {
	Detail []ValidationError `json:"detail,omitempty"`
}

HTTPValidationError

type ImportDomain

type ImportDomain struct {
	MovingAliases   []MovingAlias   `json:"moving_aliases"`
	MovingDKIM      *MovingDkim     `json:"moving_dkim"`
	MovingFrom      string          `json:"moving_from"`
	MovingMailboxes []MovingMailbox `json:"moving_mailboxes"`
	MovingSenders   []MovingSender  `json:"moving_senders"`
}

ImportDomain

type Limit

type Limit struct {
	Emails  int `json:"emails"`
	Seconds int `json:"seconds"`
}

Limit

type MXName

type MXName = string

MXName

type Mailbox

type Mailbox struct {
	Active            MailboxActive `json:"active"`
	AdditionalSenders []string      `json:"additionalSenders"`
	DisplayName       *string       `json:"displayName,omitempty"`
	Email             string        `json:"email"`
	GivenName         *string       `json:"givenName,omitempty"`
	RateLimit         *string       `json:"rate_limit,omitempty"`
	Status            MailboxStatus `json:"status"`
	SurName           *string       `json:"surName,omitempty"`
	Type              MailboxType   `json:"type"`
}

Mailbox model for a mailbox, as an answer (typicaly to a GET), old version.

type Mailbox2

type Mailbox2 struct {
	AdditionalSenders []string         `json:"additionalSenders"`
	DirtyQuirks       map[string]any   `json:"dirty_quirks,omitempty"`
	Email             string           `json:"email"`
	Extras            *MailboxExtra    `json:"extras,omitempty"`
	Features          []MailboxFeature `json:"features,omitempty"`
	IMAPActive        MailboxActive    `json:"imap_active"`
	Quota             *QuotaValue      `json:"quota,omitempty"`
	RateLimit         *string          `json:"rate_limit,omitempty"`
	SMTPActive        MailboxActive    `json:"smtp_active"`
	Type              MailboxType      `json:"type"`
}

Mailbox2 model for a mailbox, as an answer (typicaly to a GET).

type MailboxActive

type MailboxActive string

MailboxActive mailbox status.

const (
	MailboxActiveYes     MailboxActive = "yes"
	MailboxActiveNo      MailboxActive = "no"
	MailboxActiveWait    MailboxActive = "wait"
	MailboxActiveUnknown MailboxActive = "unknown"
)

type MailboxCode

type MailboxCode struct {
	Code      string `json:"code"`
	Email     string `json:"email"`
	ExpiresAt *int   `json:"expires_at"`
	ExpiresIn *int   `json:"expires_in"`
	Maxuse    *int   `json:"maxuse"`
	Nbuse     int    `json:"nbuse"`
}

MailboxCode contains a generated code with its actual parameters.

type MailboxExtra

type MailboxExtra struct {
	OX       *MailboxExtraOx       `json:"ox,omitempty"`
	Schedule *MailboxExtraSchedule `json:"schedule,omitempty"`
}

MailboxExtra

type MailboxExtraOx

type MailboxExtraOx struct {
	DisplayName string `json:"display_name"`
	GivenName   string `json:"given_name"`
	SurName     string `json:"sur_name"`
}

MailboxExtraOx

type MailboxExtraSchedule

type MailboxExtraSchedule struct {
	Max *int `json:"max,omitempty"`
}

MailboxExtraSchedule

type MailboxFeature

type MailboxFeature string

MailboxFeature

const (
	MailboxFeatureOX       MailboxFeature = "ox"
	MailboxFeatureSchedule MailboxFeature = "schedule"
)

type MailboxForcePassword

type MailboxForcePassword struct {
	Password        *string `json:"password"`
	RestorePassword *bool   `json:"restore_password,omitempty"`
	SavePassword    *bool   `json:"save_password,omitempty"`
}

MailboxForcePassword contains a (clear text) password for forcing a mailbox's password.

type MailboxInfo

type MailboxInfo struct {
	Email      string          `json:"email"`
	IMAPDir    *bool           `json:"imap_dir,omitempty"`
	MovingAway *bool           `json:"moving_away,omitempty"`
	NeedMoving *bool           `json:"need_moving,omitempty"`
	SieveDir   *bool           `json:"sieve_dir,omitempty"`
	Storage    *MailboxStorage `json:"storage,omitempty"`
	Store      *string         `json:"store,omitempty"`
}

MailboxInfo technical informations about a mailbox, about its storage.

type MailboxPassword

type MailboxPassword struct {
	Password string `json:"password"`
}

MailboxPassword contains a password for checking purpose.

type MailboxStatus

type MailboxStatus string

MailboxStatus enum class that represents the status of the mailbox.

const (
	MailboxStatusOK      MailboxStatus = "ok"
	MailboxStatusBroken  MailboxStatus = "broken"
	MailboxStatusUnknown MailboxStatus = "unknown"
)

type MailboxStorage

type MailboxStorage string

MailboxStorage

const (
	MailboxStorageLocal   MailboxStorage = "local"
	MailboxStorageProxy   MailboxStorage = "proxy"
	MailboxStorageUnknown MailboxStorage = "unknown"
)

type MailboxType

type MailboxType string

MailboxType enum class that represents the type of the mailbox.

const (
	MailboxTypeAlias   MailboxType = "alias"
	MailboxTypeMailbox MailboxType = "mailbox"
)

type ModuleStatus

type ModuleStatus struct {
	Detail []string `json:"detail,omitempty"`
	Status *bool    `json:"status,omitempty"`
}

ModuleStatus

type Moving

type Moving struct {
	Detail string `json:"detail"`
}

Moving

type MovingAlias

type MovingAlias struct {
	Alias       string `json:"alias"`
	Destination string `json:"destination"`
}

MovingAlias

type MovingDkim

type MovingDkim struct {
	Private  *string `json:"private"`
	Public   *string `json:"public"`
	Selector *string `json:"selector"`
}

MovingDkim

type MovingMailbox

type MovingMailbox struct {
	Active     *string `json:"active,omitempty"`
	IMAPActive *string `json:"imap_active,omitempty"`
	Password   string  `json:"password"`
	RateLimit  *string `json:"rate_limit"`
	SMTPActive *string `json:"smtp_active,omitempty"`
	Username   string  `json:"username"`
}

MovingMailbox

type MovingSender

type MovingSender struct {
	Login  string `json:"login"`
	Sender string `json:"sender"`
}

MovingSender

type NewAppPassword

type NewAppPassword struct {
	Password string `json:"password"`
	UUID     string `json:"uuid"`
}

NewAppPassword

type NewMailbox

type NewMailbox struct {
	Email    string `json:"email"`
	Password string `json:"password"`
}

NewMailbox pydantic model that represents a mailbox newly created.

type NextHop

type NextHop = string

NextHop

type NotFound

type NotFound struct {
	Detail string `json:"detail"`
}

NotFound

type Option

type Option func(*Client)

Option configures a Client in NewClient.

func WithBaseURL

func WithBaseURL(u string) Option

WithBaseURL overrides the API root (any trailing slash is trimmed).

func WithBasicAuth

func WithBasicAuth(user, pass string) Option

WithBasicAuth sets the HTTP Basic credentials used to obtain a token.

func WithHTTPClient

func WithHTTPClient(h *http.Client) Option

WithHTTPClient sets the underlying *http.Client.

func WithToken

func WithToken(token string) Option

WithToken sets a bearer token to authenticate every request.

func WithUserAgent

func WithUserAgent(ua string) Option

WithUserAgent overrides the User-Agent header.

type OptionalDomainName

type OptionalDomainName = string

OptionalDomainName

type OptionalMXName

type OptionalMXName = string

OptionalMXName

type OptionalQuotaValue

type OptionalQuotaValue = string

OptionalQuotaValue

type OptionalTransport

type OptionalTransport = string

OptionalTransport

type PermissionDenied

type PermissionDenied struct {
	Detail string `json:"detail"`
}

PermissionDenied

type PreconditionFailed

type PreconditionFailed struct {
	Detail string `json:"detail"`
}

PreconditionFailed

type PubAlias

type PubAlias struct {
	Alias       string `json:"alias"`
	Description string `json:"description"`
}

PubAlias

type QuotaValue

type QuotaValue = string

QuotaValue

type RateLimit

type RateLimit struct {
	Limits []Limit `json:"limits"`
	Name   string  `json:"name"`
}

RateLimit

type SchemaName

type SchemaName struct {
	Name string `json:"name"`
}

SchemaName

type Secondary

type Secondary struct {
	DisplayName *string `json:"displayName,omitempty"`
	DomainName  string  `json:"domain_name"`
	MasterOf    string  `json:"master_of"`
	UserName    string  `json:"user_name"`
}

Secondary

type ServerLogs

type ServerLogs struct {
	Logs []string `json:"logs"`
}

ServerLogs

type ServerStatus

type ServerStatus struct {
	BusinessModule    ModuleStatus `json:"business_module"`
	CertbotModule     ModuleStatus `json:"certbot_module"`
	OpendkimModule    ModuleStatus `json:"opendkim_module"`
	OpenxchangeModule ModuleStatus `json:"openxchange_module"`
	RemoteModule      ModuleStatus `json:"remote_module"`
	SqlAPIModule      ModuleStatus `json:"sql_api_module"`
	SqlDKIMModule     ModuleStatus `json:"sql_dkim_module"`
	SqlIMAPModule     ModuleStatus `json:"sql_imap_module"`
	SqlPostfixModule  ModuleStatus `json:"sql_postfix_module"`
	Status            bool         `json:"status"`
}

ServerStatus

type StoreInfo

type StoreInfo struct {
	AvailableInodes *int   `json:"available_inodes,omitempty"`
	AvailableSpace  *int   `json:"available_space,omitempty"`
	Host            string `json:"host"`
	Name            string `json:"name"`
	NbMailboxes     *int   `json:"nb_mailboxes,omitempty"`
	TotalInodes     *int   `json:"total_inodes,omitempty"`
	TotalSpace      *int   `json:"total_space,omitempty"`
	Transport       string `json:"transport"`
	UsedInodes      *int   `json:"used_inodes,omitempty"`
	UsedSpace       *int   `json:"used_space,omitempty"`
}

StoreInfo

type TechDomain

type TechDomain struct {
	HostName string `json:"host_name"`
	TechName string `json:"tech_name"`
}

TechDomain techDomain model.

type TestErr

type TestErr struct {
	Code   string `json:"code"`
	Detail string `json:"detail"`
}

TestErr

type TestResult

type TestResult struct {
	Errors   []TestErr `json:"errors,omitempty"`
	Internal *bool     `json:"internal,omitempty"`
	OK       *bool     `json:"ok,omitempty"`
}

TestResult

type Token

type Token struct {
	AccessToken string `json:"access_token"`
	TokenType   string `json:"token_type"`
}

Token token model.

type Transport

type Transport = string

Transport

type UpdateAlias

type UpdateAlias struct {
	AllowToSend *bool   `json:"allow_to_send,omitempty"`
	Description *string `json:"description,omitempty"`
}

UpdateAlias

type UpdateDatabase

type UpdateDatabase struct {
	MoveTo string `json:"move_to"`
}

UpdateDatabase

type UpdateDomain

type UpdateDomain struct {
	Active           *bool               `json:"active,omitempty"`
	ContextName      *string             `json:"context_name,omitempty"`
	Delivery         *Delivery           `json:"delivery,omitempty"`
	Features         []string            `json:"features,omitempty"`
	IMAPDomain       *OptionalDomainName `json:"imap_domain,omitempty"`
	MXName           *OptionalMXName     `json:"mx_name,omitempty"`
	PublicAlias      *bool               `json:"public_alias,omitempty"`
	PublicAliasRules []string            `json:"public_alias_rules,omitempty"`
	SchemaName       *string             `json:"schema_name,omitempty"`
	SMTPDomain       *OptionalDomainName `json:"smtp_domain,omitempty"`
	StoreName        *string             `json:"store_name,omitempty"`
	Transport        *OptionalTransport  `json:"transport,omitempty"`
	Webmail          *string             `json:"webmail,omitempty"`
	WebmailDomain    *OptionalDomainName `json:"webmail_domain,omitempty"`
}

UpdateDomain

type UpdateForward

type UpdateForward struct {
	Nexthop NextHop `json:"nexthop"`
}

UpdateForward

type UpdateMailbox

type UpdateMailbox struct {
	Active            *MailboxActive `json:"active,omitempty"`
	AdditionalSenders []string       `json:"additionalSenders,omitempty"`
	DisplayName       *string        `json:"displayName,omitempty"`
	Domain            *DomainName    `json:"domain,omitempty"`
	GivenName         *string        `json:"givenName,omitempty"`
	RateLimit         *string        `json:"rate_limit,omitempty"`
	Store             *string        `json:"store,omitempty"`
	SurName           *string        `json:"surName,omitempty"`
	UserName          *UserName      `json:"user_name,omitempty"`
}

UpdateMailbox

type UpdateMailbox2

type UpdateMailbox2 struct {
	AdditionalSenders []string            `json:"additionalSenders,omitempty"`
	Domain            *DomainName         `json:"domain,omitempty"`
	Extras            *UpdateMailboxExtra `json:"extras,omitempty"`
	Features          []string            `json:"features,omitempty"`
	IMAPActive        *MailboxActive      `json:"imap_active,omitempty"`
	Quota             *OptionalQuotaValue `json:"quota,omitempty"`
	RateLimit         *string             `json:"rate_limit,omitempty"`
	SMTPActive        *MailboxActive      `json:"smtp_active,omitempty"`
	Store             *string             `json:"store,omitempty"`
	UserName          *UserName           `json:"user_name,omitempty"`
}

UpdateMailbox2 updates on a mailbox (v2).

type UpdateMailboxExtra

type UpdateMailboxExtra struct {
	OX       *UpdateMailboxExtraOx       `json:"ox,omitempty"`
	Schedule *UpdateMailboxExtraSchedule `json:"schedule,omitempty"`
}

UpdateMailboxExtra

type UpdateMailboxExtraOx

type UpdateMailboxExtraOx struct {
	DisplayName *string `json:"display_name,omitempty"`
	GivenName   *string `json:"given_name,omitempty"`
	SurName     *string `json:"sur_name,omitempty"`
}

UpdateMailboxExtraOx

type UpdateMailboxExtraSchedule

type UpdateMailboxExtraSchedule struct {
	Max *int `json:"max,omitempty"`
}

UpdateMailboxExtraSchedule

type UpdatePubAlias

type UpdatePubAlias struct {
	Description string `json:"description"`
}

UpdatePubAlias

type UpdateUser

type UpdateUser struct {
	ACLS       []string `json:"acls,omitempty"`
	Identities []string `json:"identities,omitempty"`
	IsAdmin    *bool    `json:"is_admin,omitempty"`
	Password   *string  `json:"password,omitempty"`
	Perms      []string `json:"perms,omitempty"`
}

UpdateUser updateUser model.

type User

type User struct {
	ACLS       []string `json:"acls"`
	Identities []string `json:"identities"`
	IsAdmin    bool     `json:"is_admin"`
	Name       string   `json:"name"`
	Perms      []string `json:"perms"`
	UUID       string   `json:"uuid"`
}

User user model.

type UserName

type UserName = string

UserName

type ValidationError

type ValidationError struct {
	Ctx   map[string]any    `json:"ctx,omitempty"`
	Input json.RawMessage   `json:"input,omitempty"`
	Loc   []json.RawMessage `json:"loc"`
	Msg   string            `json:"msg"`
	Type  string            `json:"type"`
}

ValidationError

type VisibleResources

type VisibleResources struct {
	Aliases   []string `json:"aliases"`
	Domains   []string `json:"domains"`
	Mailboxes []string `json:"mailboxes"`
}

VisibleResources

Directories

Path Synopsis
internal
gen command
Command gen reads the Dimail OpenAPI document and emits the typed models (models_gen.go), the request methods (client_gen.go) and a smoke test that exercises every generated method (client_gen_smoke_test.go).
Command gen reads the Dimail OpenAPI document and emits the typed models (models_gen.go), the request methods (client_gen.go) and a smoke test that exercises every generated method (client_gen_smoke_test.go).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL