github.com/IBM-Cloud/bluemix-go@v0.0.0-20240423071914-9e96525baef4/api/usermanagement/usermanagementv2/models.go (about)

     1  package usermanagementv2
     2  
     3  import "github.com/IBM-Cloud/bluemix-go/api/iampap/iampapv1"
     4  
     5  // User ...
     6  type User struct {
     7  	Email       string `json:"email"`
     8  	AccountRole string `json:"account_role"`
     9  }
    10  
    11  // UserInfo contains user info
    12  type UserInfo struct {
    13  	ID             string `json:"id"`
    14  	IamID          string `json:"iam_id"`
    15  	Realm          string `json:"realm"`
    16  	UserID         string `json:"user_id"`
    17  	Firstname      string `json:"firstname"`
    18  	Lastname       string `json:"lastname"`
    19  	State          string `json:"state"`
    20  	Email          string `json:"email"`
    21  	Phonenumber    string `json:"phonenumber"`
    22  	Altphonenumber string `json:"altphonenumber"`
    23  	Photo          string `json:"photo"`
    24  	AccountID      string `json:"account_id"`
    25  }
    26  
    27  // UserSettings ...
    28  type UserSettingOptions struct {
    29  
    30  	//The console UI language
    31  	Language string `json:"language"`
    32  
    33  	//The language for email and phone notifications.
    34  	NotificationLanguage string `json:"notification_language"`
    35  
    36  	//The IP addresses listed here are the only ones from which this user can log in to IBM Cloud.
    37  	AllowedIPAddresses string `json:"allowed_ip_addresses"`
    38  
    39  	//Whether user-managed login is enabled.
    40  	SelfManage bool `json:"self_manage"`
    41  }
    42  
    43  // UserInvite ...
    44  type UserInvite struct {
    45  	Users               []User            `json:"users"`
    46  	IAMPolicy           []UserPolicy      `json:"iam_policy,omitempty"`
    47  	AccessGroup         []string          `json:"access_groups,omitempty"`
    48  	InfrastructureRoles *InfraPermissions `json:"infrastructure_roles,omitempty"`
    49  	OrganizationRoles   []OrgRole         `json:"organization_roles,omitempty"`
    50  }
    51  
    52  // UsersList to get list of users
    53  type UsersList struct {
    54  	TotalUsers int        `json:"total_results"`
    55  	Limit      int        `json:"limit"`
    56  	FistURL    string     `json:"fist_url"`
    57  	Resources  []UserInfo `json:"resources"`
    58  }
    59  
    60  // UserPolicy ...
    61  type UserPolicy struct {
    62  	Type      string              `json:"type"`
    63  	Roles     []iampapv1.Role     `json:"roles"`
    64  	Resources []iampapv1.Resource `json:"resources"`
    65  }
    66  
    67  //InfraPermissions ...
    68  type InfraPermissions struct {
    69  	Permissions []string `json:"permissions"`
    70  }
    71  
    72  //OrgRole ...
    73  type OrgRole struct {
    74  	Users           []string `json:"users"`
    75  	Region          string   `json:"region"`
    76  	Auditors        []string `json:"auditors,omitempty"`
    77  	Managers        []string `json:"managers,omitempty"`
    78  	BillingManagers []string `json:"billing_managers,omitempty"`
    79  	ID              string   `json:"id"`
    80  	Spaces          []Space  `json:"spaces"`
    81  }
    82  
    83  //Space ...
    84  type Space struct {
    85  	ID         string   `json:"id"`
    86  	Managers   []string `json:"managers,omitempty"`
    87  	Developers []string `json:"developers,omitempty"`
    88  	Auditors   []string `json:"auditors,omitempty" `
    89  }