-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* initial edits. Needs testing * queryable fix
- Loading branch information
Showing
3 changed files
with
104 additions
and
42 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
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) | ||
} |
This file contains 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
This file contains 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