Skip to content

Commit

Permalink
queryable fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Jmfwolf committed Aug 7, 2023
1 parent 06a4f46 commit b0ba4d5
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,37 @@ package main

import (
"fmt"
"os"

"github.com/onelogin/onelogin-go-sdk/v4/pkg/onelogin"
"github.com/onelogin/onelogin-go-sdk/v4/pkg/onelogin/models"
)

func main() {

// Set environment variables for OneLogin API credentials
os.Setenv("ONELOGIN_CLIENT_ID", "client_id")
os.Setenv("ONELOGIN_CLIENT_SECRET", "client_secret")
os.Setenv("ONELOGIN_SUBDOMAIN", "your-api-subdomain")

// Create a user object with the specified attributes
UserTwo := models.User{Firstname: "Mikhail", Lastname: "Beaverton", Email: "[email protected]"}

// Create a user query object with the specified email
UserQueryOne := models.UserQuery{Email: &UserTwo.Email}

// Create a new OneLogin SDK client
Client, err := onelogin.NewOneloginSDK()
if err != nil {
fmt.Println(err)
}

// Create a new user with the specified attributes
Client.CreateUser(models.User{Firstname: "Jane", Lastname: "Pukalava", Email: "[email protected]"})

// Create a new user with the specified attributes
Client.CreateUser(UserTwo)

// Get a list of users that match the specified query
Client.GetUsers(&UserQueryOne)
}

0 comments on commit b0ba4d5

Please sign in to comment.