All URIs are relative to http://localhost
Method | HTTP request | Description |
---|---|---|
AddDestination | Put /address/forwards/{userAddress} | Add a new destination to a forward |
DeleteDestination | Delete /address/forwards/{userAddress} | Remove a destination from a forward |
ListDestinations | Get /address/forwards/{userAddress} | List destinations in a forward |
ListForwards | Get /address/forwards | List address forwards |
AddDestination(ctx, userAddress).DestinationAddress(destinationAddress).Execute()
Add a new destination to a forward
package main
import (
"context"
"fmt"
"os"
openapiclient "go.opscenter.dev/james-go-client"
)
func main() {
userAddress := "[email protected]" // string | User mail address
destinationAddress := "[email protected]" // string | Destination mail address
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
r, err := apiClient.AddressForwardAPI.AddDestination(context.Background(), userAddress).DestinationAddress(destinationAddress).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `AddressForwardAPI.AddDestination``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
userAddress | string | User mail address |
Other parameters are passed through a pointer to a apiAddDestinationRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
destinationAddress | string | Destination mail address |
(empty response body)
No authorization required
- Content-Type: Not defined
- Accept: Not defined
[Back to top] [Back to API list] [Back to Model list] [Back to README]
DeleteDestination(ctx, userAddress).DestinationAddress(destinationAddress).Execute()
Remove a destination from a forward
package main
import (
"context"
"fmt"
"os"
openapiclient "go.opscenter.dev/james-go-client"
)
func main() {
userAddress := "[email protected]" // string | User mail address
destinationAddress := "[email protected]" // string | Destination mail address
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
r, err := apiClient.AddressForwardAPI.DeleteDestination(context.Background(), userAddress).DestinationAddress(destinationAddress).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `AddressForwardAPI.DeleteDestination``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
userAddress | string | User mail address |
Other parameters are passed through a pointer to a apiDeleteDestinationRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
destinationAddress | string | Destination mail address |
(empty response body)
No authorization required
- Content-Type: Not defined
- Accept: Not defined
[Back to top] [Back to API list] [Back to Model list] [Back to README]
[]ListDestinations200ResponseInner ListDestinations(ctx, userAddress).Execute()
List destinations in a forward
package main
import (
"context"
"fmt"
"os"
openapiclient "go.opscenter.dev/james-go-client"
)
func main() {
userAddress := "[email protected]" // string | User mail address
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.AddressForwardAPI.ListDestinations(context.Background(), userAddress).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `AddressForwardAPI.ListDestinations``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `ListDestinations`: []ListDestinations200ResponseInner
fmt.Fprintf(os.Stdout, "Response from `AddressForwardAPI.ListDestinations`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
userAddress | string | User mail address |
Other parameters are passed through a pointer to a apiListDestinationsRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
[]ListDestinations200ResponseInner
No authorization required
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
[]string ListForwards(ctx).Execute()
List address forwards
package main
import (
"context"
"fmt"
"os"
openapiclient "go.opscenter.dev/james-go-client"
)
func main() {
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.AddressForwardAPI.ListForwards(context.Background()).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `AddressForwardAPI.ListForwards``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `ListForwards`: []string
fmt.Fprintf(os.Stdout, "Response from `AddressForwardAPI.ListForwards`: %v\n", resp)
}
This endpoint does not need any parameter.
Other parameters are passed through a pointer to a apiListForwardsRequest struct via the builder pattern
[]string
No authorization required
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]