github.com/saucelabs/saucectl@v0.175.1/internal/iam/userservice.go (about)

     1  package iam
     2  
     3  import "context"
     4  
     5  // User represents user data structure
     6  type User struct {
     7  	ID           string       `json:"id"`
     8  	Groups       []Group      `json:"groups"`
     9  	Organization Organization `json:"organization"`
    10  }
    11  
    12  // Concurrency represents the concurrency for an account.
    13  type Concurrency struct {
    14  	Org OrgConcurrency `json:"organization"`
    15  }
    16  
    17  // OrgConcurrency represents the concurrency for an organization.
    18  type OrgConcurrency struct {
    19  	Allowed CloudConcurrency `json:"allowed"`
    20  }
    21  
    22  // CloudConcurrency represents a concurrency per cloud environment.
    23  type CloudConcurrency struct {
    24  	VDC int `json:"vms"`
    25  	RDC int `json:"rds"`
    26  }
    27  
    28  // Group represents the group that the user belongs to
    29  type Group struct {
    30  	ID string `json:"id"`
    31  }
    32  
    33  // Organization represents the organization that the user belongs to
    34  type Organization struct {
    35  	ID string `json:"id"`
    36  }
    37  
    38  type UserService interface {
    39  	User(context.Context) (User, error)
    40  	// Concurrency returns the concurrency settings for the current account.
    41  	Concurrency(context.Context) (Concurrency, error)
    42  }