Skip to content

Commit

Permalink
example: example for create server.
Browse files Browse the repository at this point in the history
  • Loading branch information
sanchitrk committed Dec 14, 2024
1 parent dcd593e commit 0947d16
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions examples/create_server.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package main

import (
"context"
"github.com/mrz1836/postmark"
"log"
)

func main() {

Check failure on line 9 in examples/create_server.go

View workflow job for this annotation

GitHub Actions / test (1.18.x, ubuntu-latest)

other declaration of main (typecheck)

Check failure on line 9 in examples/create_server.go

View workflow job for this annotation

GitHub Actions / test (1.19.x, ubuntu-latest)

other declaration of main (typecheck)
client := postmark.NewClient("[SERVER-TOKEN]", "[ACCOUNT-TOKEN]")

server := postmark.Server{
Name: "Edit Server Name",
Color: "Red",
}
server, err := client.CreateServer(context.TODO(), server)
if err != nil {
panic(err)
}

log.Println(server.ID)
log.Println(server.Name)
log.Println(server.Color)
}

0 comments on commit 0947d16

Please sign in to comment.