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)
}
Output:
Index ¶
- Constants
- type APIError
- type Address
- type AddressName
- type Alias
- type AliasDest
- type Allowed
- type ApiVersion
- type AppPassword
- type AppPasswordType
- type Authentication
- type CheckContext
- type CheckContexts
- type CheckedContext
- type CheckedContexts
- type Client
- func (c *Client) ChangePassword(ctx context.Context) (string, error)
- func (c *Client) CheckDomain(ctx context.Context, domainName string) (*Domain, error)
- func (c *Client) CheckPassword(ctx context.Context, domainName string, userName string, body *MailboxPassword) (bool, error)
- func (c *Client) CurrentToken() string
- func (c *Client) DeleteAlias(ctx context.Context, domainName string, userName string, destination string) error
- func (c *Client) DeleteAllow(ctx context.Context, domainName string, userName string) error
- func (c *Client) DeleteAppPassword(ctx context.Context, domainName string, userName string, uuid string) error
- func (c *Client) DeleteCrashLog(ctx context.Context, crashName string) error
- func (c *Client) DeleteDomain(ctx context.Context, domainName string) error
- func (c *Client) DeleteForward(ctx context.Context, domainName string, userName string) error
- func (c *Client) DeleteIdentities(ctx context.Context, proconnect string, email string) error
- func (c *Client) DeleteMailbox(ctx context.Context, domainName string, userName string) error
- func (c *Client) DeleteMaster(ctx context.Context, domainName string, userName string, secondaryEmail string) error
- func (c *Client) DeletePublicAlias(ctx context.Context, userName string, domainName string, destination string) error
- func (c *Client) DeleteRateLimit(ctx context.Context, name string) error
- func (c *Client) DeleteUser(ctx context.Context, userName string) error
- func (c *Client) FixDomain(ctx context.Context, domainName string) (*Domain, error)
- func (c *Client) ForcePassword(ctx context.Context, domainName string, userName string, ...) (*NewMailbox, error)
- func (c *Client) GetAddress(ctx context.Context, domainName string, userName string) (*Address, error)
- func (c *Client) GetAlias(ctx context.Context, domainName string, userName *string, destination *string) ([]Alias, error)
- func (c *Client) GetAllow(ctx context.Context, username *string, domain *string) ([]Allowed, error)
- func (c *Client) GetAppPassword(ctx context.Context, domainName string, userName string, uuid string) (*AppPassword, error)
- func (c *Client) GetAppPasswords(ctx context.Context, domainName string, userName string) ([]AppPassword, error)
- func (c *Client) GetCode(ctx context.Context, codeString string) (*MailboxCode, error)
- func (c *Client) GetCrashLog(ctx context.Context, crashName string) (*ServerLogs, error)
- func (c *Client) GetCrashLogs(ctx context.Context) ([]CrashInfo, error)
- func (c *Client) GetDomain(ctx context.Context, domainName string) (*Domain, error)
- func (c *Client) GetDomainSpecs(ctx context.Context, domainName string) ([]DomainSpec, error)
- func (c *Client) GetDomains(ctx context.Context) ([]Domain, error)
- func (c *Client) GetForward(ctx context.Context, domainName string, userName string) (*Forward, error)
- func (c *Client) GetForwards(ctx context.Context, domainName string) ([]Forward, error)
- func (c *Client) GetIdentities(ctx context.Context, identity *string) ([]string, error)
- func (c *Client) GetMailbox(ctx context.Context, domainName string, userName string) (*Mailbox, error)
- func (c *Client) GetMailboxIdentities(ctx context.Context, domainName string, userName string) ([]string, error)
- func (c *Client) GetMailboxV2(ctx context.Context, domainName string, userName string, withExtras *bool) (*Mailbox2, error)
- func (c *Client) GetMailboxes(ctx context.Context, domainName string) ([]Mailbox, error)
- func (c *Client) GetMailboxesV2(ctx context.Context, domainName string, withExtras *bool) ([]Mailbox2, error)
- func (c *Client) GetMaster(ctx context.Context, domainName string, userName string, secondaryEmail string) (*Secondary, error)
- func (c *Client) GetMastereds(ctx context.Context, domainName string, userName string) ([]Secondary, error)
- func (c *Client) GetMasters(ctx context.Context, domainName string, userName string) ([]Secondary, error)
- func (c *Client) GetMyAliases(ctx context.Context) ([]string, error)
- func (c *Client) GetMyDomains(ctx context.Context) ([]string, error)
- func (c *Client) GetMyMailboxes(ctx context.Context) ([]string, error)
- func (c *Client) GetMyResources(ctx context.Context) (*VisibleResources, error)
- func (c *Client) GetPublicAliasDomains(ctx context.Context, destination *string) ([]string, error)
- func (c *Client) GetPublicAliases(ctx context.Context, destination *string) ([]PubAlias, error)
- func (c *Client) GetRateLimit(ctx context.Context, name string) (*RateLimit, error)
- func (c *Client) GetRateLimits(ctx context.Context) ([]RateLimit, error)
- func (c *Client) GetServerLogs(ctx context.Context) (*ServerLogs, error)
- func (c *Client) GetTechDomain(ctx context.Context) (*TechDomain, error)
- func (c *Client) GetToken(ctx context.Context, username *string) (*Token, error)
- func (c *Client) GetUser(ctx context.Context, userName string) (*User, error)
- func (c *Client) GetUserByProconnectIdentity(ctx context.Context, proconnect string) (*User, error)
- func (c *Client) GetUsers(ctx context.Context) ([]User, error)
- func (c *Client) GetVersion(ctx context.Context) (*ApiVersion, error)
- func (c *Client) HealthCheck(ctx context.Context) (*ServerStatus, error)
- func (c *Client) InternalCheckContexts(ctx context.Context, body *CheckContexts) (*CheckedContexts, error)
- func (c *Client) InternalDisconnectUser(ctx context.Context, domainName string, userName string) (*json.RawMessage, error)
- func (c *Client) InternalGetMailqueue(ctx context.Context, domainName string, userName string) ([]string, error)
- func (c *Client) InternalGetStoreInfo(ctx context.Context, storeName string) (*StoreInfo, error)
- func (c *Client) InternalGetStoresInfo(ctx context.Context) ([]StoreInfo, error)
- func (c *Client) InternalImportDomain(ctx context.Context, domainName string, body *ImportDomain) (*json.RawMessage, error)
- func (c *Client) InternalMailboxInfo(ctx context.Context, domainName string, userName string) (*MailboxInfo, error)
- func (c *Client) InternalMailboxesInfo(ctx context.Context, domainName string) ([]MailboxInfo, error)
- func (c *Client) InternalMoveMailbox(ctx context.Context, domainName string, userName string) (*json.RawMessage, error)
- func (c *Client) InternalPatchDatabase(ctx context.Context, dbName string, body *UpdateDatabase) (*json.RawMessage, error)
- func (c *Client) InternalPostDatabase(ctx context.Context, dbName string, schemaName string) (*SchemaName, error)
- func (c *Client) InternalShutdown(ctx context.Context) (*json.RawMessage, error)
- func (c *Client) Login(ctx context.Context) (*Token, error)
- func (c *Client) PatchAlias(ctx context.Context, domainName string, userName string, destination string, ...) (*Alias, error)
- func (c *Client) PatchDomain(ctx context.Context, domainName string, body *UpdateDomain) (*Domain, error)
- func (c *Client) PatchForward(ctx context.Context, domainName string, userName string, body *UpdateForward) (*Forward, error)
- func (c *Client) PatchMailbox(ctx context.Context, domainName string, userName string, body *UpdateMailbox) (*Mailbox, error)
- func (c *Client) PatchMailboxV2(ctx context.Context, domainName string, userName string, body *UpdateMailbox2) (*Mailbox2, error)
- func (c *Client) PatchPublicAlias(ctx context.Context, userName string, domainName string, destination string, ...) (*PubAlias, error)
- func (c *Client) PatchRateLimit(ctx context.Context, name string, body *RateLimit) (*RateLimit, error)
- func (c *Client) PatchUser(ctx context.Context, user string, body *UpdateUser) (*User, error)
- func (c *Client) PostAliasDomainsDomainNameAliasesPost(ctx context.Context, domainName string, body *CreateAlias) (*Alias, error)
- func (c *Client) PostAllow(ctx context.Context, body *Allowed) (*Allowed, error)
- func (c *Client) PostAppPassword(ctx context.Context, domainName string, userName string, ...) (*NewAppPassword, error)
- func (c *Client) PostDomain(ctx context.Context, noCheck *string, body *CreateDomain) (*Domain, error)
- func (c *Client) PostForward(ctx context.Context, domainName string, userName string, body *CreateForward) (*Forward, error)
- func (c *Client) PostIdentity(ctx context.Context, body *CreateIdentity) (*json.RawMessage, error)
- func (c *Client) PostMailbox(ctx context.Context, domainName string, userName string, body *CreateMailbox) (*NewMailbox, error)
- func (c *Client) PostMailboxCode(ctx context.Context, domainName string, userName string, ...) (*MailboxCode, error)
- func (c *Client) PostMailboxIdentity(ctx context.Context, domainName string, userName string, identity string) (*json.RawMessage, error)
- func (c *Client) PostMailboxV2(ctx context.Context, domainName string, userName string, body *CreateMailbox2) (*NewMailbox, error)
- func (c *Client) PostMaster(ctx context.Context, domainName string, userName string, secondaryEmail string, ...) (*Secondary, error)
- func (c *Client) PostPublicAlias(ctx context.Context, body *CreatePubAlias) (*PubAlias, error)
- func (c *Client) PostRateLimit(ctx context.Context, name string, body *RateLimit) (*RateLimit, error)
- func (c *Client) PostUser(ctx context.Context, body *CreateUser) (*User, error)
- func (c *Client) ResetPassword(ctx context.Context, domainName string, userName string) (*NewMailbox, error)
- func (c *Client) SetToken(token string)
- func (c *Client) UnauthGetDomain(ctx context.Context, domainName string) (*json.RawMessage, error)
- type Conflict
- type ContextStatus
- type CrashInfo
- type CreateAlias
- type CreateAppPassword
- type CreateDomain
- type CreateForward
- type CreateIdentity
- type CreateMailbox
- type CreateMailbox2
- type CreateMailboxCode
- type CreatePubAlias
- type CreateSecondary
- type CreateUser
- type Delivery
- type Domain
- type DomainFeature
- type DomainName
- type DomainSpec
- type FailedMove
- type Forward
- type HTTPValidationError
- type ImportDomain
- type Limit
- type MXName
- type Mailbox
- type Mailbox2
- type MailboxActive
- type MailboxCode
- type MailboxExtra
- type MailboxExtraOx
- type MailboxExtraSchedule
- type MailboxFeature
- type MailboxForcePassword
- type MailboxInfo
- type MailboxPassword
- type MailboxStatus
- type MailboxStorage
- type MailboxType
- type ModuleStatus
- type Moving
- type MovingAlias
- type MovingDkim
- type MovingMailbox
- type MovingSender
- type NewAppPassword
- type NewMailbox
- type NextHop
- type NotFound
- type Option
- type OptionalDomainName
- type OptionalMXName
- type OptionalQuotaValue
- type OptionalTransport
- type PermissionDenied
- type PreconditionFailed
- type PubAlias
- type QuotaValue
- type RateLimit
- type SchemaName
- type Secondary
- type ServerLogs
- type ServerStatus
- type StoreInfo
- type TechDomain
- type TestErr
- type TestResult
- type Token
- type Transport
- type UpdateAlias
- type UpdateDatabase
- type UpdateDomain
- type UpdateForward
- type UpdateMailbox
- type UpdateMailbox2
- type UpdateMailboxExtra
- type UpdateMailboxExtraOx
- type UpdateMailboxExtraSchedule
- type UpdatePubAlias
- type UpdateUser
- type User
- type UserName
- type ValidationError
- type VisibleResources
Examples ¶
Constants ¶
const DefaultBaseURL = "https://api.osprod.dimail1.numerique.gouv.fr"
DefaultBaseURL is the production Dimail API endpoint.
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")
}
}
Output:
func (*APIError) Unauthorized ¶
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 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 ApiVersion ¶
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 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 (*Client) ChangePassword ¶
ChangePassword issues POST /webhook/changepassword: Change Password.
func (*Client) CheckDomain ¶
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 ¶
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 ¶
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 ¶
DeleteCrashLog issues DELETE /logs/crashes/{crash_name}: Del Crash.
func (*Client) DeleteDomain ¶
DeleteDomain issues DELETE /domains/{domain_name}: Delete a domain.
func (*Client) DeleteForward ¶
DeleteForward issues DELETE /domains/{domain_name}/forwards/{user_name}: Delete Forward.
func (*Client) DeleteIdentities ¶
DeleteIdentities issues DELETE /identities/{proconnect}/{email}: Delete Identities.
func (*Client) DeleteMailbox ¶
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 ¶
DeleteRateLimit issues DELETE /system/rate_limits/{name}: Delete Rate Limit.
func (*Client) DeleteUser ¶
DeleteUser issues DELETE /users/{user_name}: Delete User.
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) 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) GetCrashLog ¶
GetCrashLog issues GET /logs/crashes/{crash_name}: Get Crash.
func (*Client) GetCrashLogs ¶
GetCrashLogs issues GET /logs/crashes: Get Crashes.
func (*Client) GetDomainSpecs ¶
GetDomainSpecs issues GET /domains/{domain_name}/spec: Spec Domain.
func (*Client) GetDomains ¶
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 ¶
GetForwards issues GET /domains/{domain_name}/forwards/: Get Forwards.
func (*Client) GetIdentities ¶
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 ¶
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 ¶
GetMyAliases issues GET /my/aliases: Get My Aliases.
func (*Client) GetMyDomains ¶
GetMyDomains issues GET /my/domains: Get My Domains.
func (*Client) GetMyMailboxes ¶
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 ¶
GetPublicAliasDomains issues GET /aliases/domains: Get Domains.
func (*Client) GetPublicAliases ¶
GetPublicAliases issues GET /aliases: Get Aliases.
func (*Client) GetRateLimit ¶
GetRateLimit issues GET /system/rate_limits/{name}: Get Rate Limit.
func (*Client) GetRateLimits ¶
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) GetUserByProconnectIdentity ¶
GetUserByProconnectIdentity issues GET /users/identity/{proconnect}: Get User By Identity.
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 ¶
InternalGetStoreInfo issues GET /system/store_info/{store_name}: Get Store Info.
func (*Client) InternalGetStoresInfo ¶
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 ¶
InternalShutdown issues GET /system/shutdown: Get Shutdown.
func (*Client) Login ¶
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) 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) 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 ¶
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) 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) UnauthGetDomain ¶
UnauthGetDomain issues GET /public/domains/{domain_name}: Checks if a domain is managed by our platform.
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 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 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 DomainSpec ¶
type DomainSpec struct {
Target string `json:"target"`
Type string `json:"type"`
Value string `json:"value"`
}
DomainSpec
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 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 MovingAlias ¶
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 ¶
MovingSender
type NewAppPassword ¶
NewAppPassword
type NewMailbox ¶
NewMailbox pydantic model that represents a mailbox newly created.
type Option ¶
type Option func(*Client)
Option configures a Client in NewClient.
func WithBaseURL ¶
WithBaseURL overrides the API root (any trailing slash is trimmed).
func WithBasicAuth ¶
WithBasicAuth sets the HTTP Basic credentials used to obtain a token.
func WithHTTPClient ¶
WithHTTPClient sets the underlying *http.Client.
func WithUserAgent ¶
WithUserAgent overrides the User-Agent header.
type PermissionDenied ¶
type PermissionDenied struct {
Detail string `json:"detail"`
}
PermissionDenied
type PreconditionFailed ¶
type PreconditionFailed struct {
Detail string `json:"detail"`
}
PreconditionFailed
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 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 ¶
TechDomain techDomain model.
type TestResult ¶
type TestResult struct {
Errors []TestErr `json:"errors,omitempty"`
Internal *bool `json:"internal,omitempty"`
OK *bool `json:"ok,omitempty"`
}
TestResult
type UpdateAlias ¶
type UpdateAlias struct {
AllowToSend *bool `json:"allow_to_send,omitempty"`
Description *string `json:"description,omitempty"`
}
UpdateAlias
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 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 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). |
