Created
August 29, 2019 10:37
-
-
Save williammartin/cb79f9ada3bcd9b619c0bba2c3537d59 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "context" | |
| "fmt" | |
| mailslurp "github.com/mailslurp/mailslurp-client-go" | |
| ) | |
| func main() { | |
| cfg := mailslurp.NewConfiguration() | |
| client := mailslurp.NewAPIClient(cfg) | |
| auth := context.WithValue(context.Background(), mailslurp.ContextAPIKey, mailslurp.APIKey{ | |
| Key: "<MY API KEY HERE>", | |
| Prefix: "Bearer", // Omit if not necessary. | |
| }) | |
| inbox, _, err := client.ExtraOperationsApi.CreateInbox(auth) | |
| mustNot(err) | |
| fmt.Println(inbox.EmailAddress) | |
| } | |
| func mustNot(err error) { | |
| if err != nil { | |
| panic(err) | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment