Documentation ¶
Index ¶
- func DeleteByID(client newclient.Client, id string) error
- func Get(client newclient.Client, spaceID string, usersQuery UsersQuery) (*resources.Resources[*User], error)
- func IsNil(i interface{}) bool
- type APIKey
- type APIKeyStruct
- type APIQuery
- type ApiKeyService
- type CreateAPIKey
- type ExternalUserSearchQuery
- type Identity
- type IdentityClaim
- type SignInQuery
- type User
- type UserAuthentication
- type UserQuery
- type UserService
- func (s *UserService) Add(user *User) (*User, error)deprecated
- func (s *UserService) Get(usersQuery UsersQuery) (*resources.Resources[*User], error)deprecated
- func (s *UserService) GetAPIKeyByID(user *User, apiKeyID string) (*APIKey, error)
- func (s *UserService) GetAPIKeys(user *User, apiQuery ...APIQuery) (*resources.Resources[*APIKey], error)
- func (s *UserService) GetAll() ([]*User, error)
- func (s *UserService) GetAuthentication() (*UserAuthentication, error)
- func (s *UserService) GetAuthenticationByUser(user *User) (*UserAuthentication, error)
- func (s *UserService) GetByID(id string) (*User, error)deprecated
- func (s *UserService) GetMe() (*User, error)
- func (s *UserService) GetPermissions(user *User, userQuery ...UserQuery) (*permissions.UserPermissionSet, error)
- func (s *UserService) GetPermissionsConfiguration(user *User, userQuery ...UserQuery) (*permissions.UserPermissionSet, error)
- func (s *UserService) GetSpaces(user *User) ([]*spaces.Space, error)
- func (s *UserService) GetTeams(user *User, userQuery ...UserQuery) (*[]permissions.ProjectedTeamReferenceDataItem, error)
- func (s *UserService) Update(user *User) (*User, error)deprecated
- type UsersQuery
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteByID ¶ added in v2.33.0
DeleteByID deletes the resource that matches the space ID and input ID.
func Get ¶ added in v2.33.0
func Get(client newclient.Client, spaceID string, usersQuery UsersQuery) (*resources.Resources[*User], error)
Get returns a collection of users based on the criteria defined by its input query parameter. If an error occurs, an empty collection is returned along with the associated error.
Types ¶
type APIKey ¶
type APIKey struct { APIKey *APIKeyStruct `json:"ApiKey,omitempty"` Created *time.Time `json:"Created,omitempty"` Purpose string `json:"Purpose,omitempty"` UserID string `json:"UserId,omitempty"` Expires *time.Time `json:"Expires,omitempty"` resources.Resource }
APIKey represents an API key returned from a GET request
type APIKeyStruct ¶ added in v2.34.0
type ApiKeyService ¶
ApiKeyService handles communication with API key-related methods of the Octopus API.
func NewAPIKeyService ¶
func NewAPIKeyService(sling *sling.Sling, uriTemplate string) *ApiKeyService
NewAPIKeyService returns an ApiKeyService with a preconfigured client.
func (*ApiKeyService) Create ¶
func (s *ApiKeyService) Create(apiKey *CreateAPIKey) (*CreateAPIKey, error)
Create generates a new API key for the specified user ID. The API key returned in the result must be saved by the caller, as it cannot be retrieved subsequently from the Octopus server.
func (*ApiKeyService) GetByID ¶
func (s *ApiKeyService) GetByID(userID string, apiKeyID string) (*APIKey, error)
GetByID the API key that belongs to the user by its ID.
func (*ApiKeyService) GetByUserID ¶
func (s *ApiKeyService) GetByUserID(userID string) ([]*APIKey, error)
GetByUserID lists all API keys for a user, returning the most recent results first.
type CreateAPIKey ¶ added in v2.34.0
type CreateAPIKey struct { APIKey string `json:"ApiKey,omitempty"` Created *time.Time `json:"Created,omitempty"` Purpose string `json:"Purpose,omitempty"` UserID string `json:"UserId,omitempty"` Expires *time.Time `json:"Expires,omitempty"` resources.Resource }
CreateAPIKey represents an API key when creating a new API key (POST)
func NewAPIKey ¶
func NewAPIKey(purpose string, userID string) *CreateAPIKey
NewAPIKey initializes an API key with a purpose.
type ExternalUserSearchQuery ¶
type ExternalUserSearchQuery struct {
PartialName string `uri:"partialName,omitempty" url:"partialName,omitempty"`
}
type Identity ¶
type Identity struct { Claims map[string]IdentityClaim `json:"Claims,omitempty"` IdentityProviderName string `json:"IdentityProviderName,omitempty"` }
type IdentityClaim ¶
type SignInQuery ¶
type SignInQuery struct {
ReturnURL string `uri:"returnUrl,omitempty" url:"returnUrl,omitempty"`
}
type User ¶
type User struct { CanPasswordBeEdited bool `json:"CanPasswordBeEdited"` DisplayName string `json:"DisplayName,omitempty"` EmailAddress string `json:"EmailAddress,omitempty"` Identities []Identity `json:"Identities,omitempty"` IsActive bool `json:"IsActive"` IsRequestor bool `json:"IsRequestor"` IsService bool `json:"IsService"` Password string `json:"Password,omitempty" validate:"max=20"` Username string `json:"Username,omitempty"` resources.Resource }
User represents a user in Octopus.
func GetByID ¶ added in v2.33.0
GetByID returns the user that matches the input ID. If one cannot be found, it returns nil and an error.
type UserAuthentication ¶
type UserAuthentication struct { AuthenticationProviders []authentication.AuthenticationProviderElement CanCurrentUserEditIdentitiesForUser bool Links map[string]string }
UserAuthentication represents enabled authentication providers and whether the current user can edit logins for the given user.
type UserService ¶
type UserService struct { services.CanDeleteService // contains filtered or unexported fields }
func NewUserService ¶
func NewUserService( sling *sling.Sling, uriTemplate string, apiKeysPath string, authenticateOctopusIDPath string, currentUserPath string, externalUserSearchPath string, registerPath string, signInPath string, signOutPath string, userAuthenticationPath string, userIdentityMetadataPath string) *UserService
func (*UserService) Add
deprecated
func (s *UserService) Add(user *User) (*User, error)
Add creates a new user.
Deprecated: Use users.Add
func (*UserService) Get
deprecated
func (s *UserService) Get(usersQuery UsersQuery) (*resources.Resources[*User], error)
Get returns a collection of users based on the criteria defined by its input query parameter. If an error occurs, an empty collection is returned along with the associated error.
Deprecated: Use users.Get
func (*UserService) GetAPIKeyByID ¶
func (s *UserService) GetAPIKeyByID(user *User, apiKeyID string) (*APIKey, error)
func (*UserService) GetAPIKeys ¶
func (*UserService) GetAll ¶
func (s *UserService) GetAll() ([]*User, error)
GetAll returns all users. If none can be found or an error occurs, it returns an empty collection.
func (*UserService) GetAuthentication ¶
func (s *UserService) GetAuthentication() (*UserAuthentication, error)
func (*UserService) GetAuthenticationByUser ¶
func (s *UserService) GetAuthenticationByUser(user *User) (*UserAuthentication, error)
func (*UserService) GetByID
deprecated
func (s *UserService) GetByID(id string) (*User, error)
GetByID returns the user that matches the input ID. If one cannot be found, it returns nil and an error.
Deprecated: Use users.GetByID
func (*UserService) GetMe ¶
func (s *UserService) GetMe() (*User, error)
GetMe returns the user associated with the key used to invoke this API.
func (*UserService) GetPermissions ¶
func (s *UserService) GetPermissions(user *User, userQuery ...UserQuery) (*permissions.UserPermissionSet, error)
func (*UserService) GetPermissionsConfiguration ¶
func (s *UserService) GetPermissionsConfiguration(user *User, userQuery ...UserQuery) (*permissions.UserPermissionSet, error)
func (*UserService) GetSpaces ¶
func (s *UserService) GetSpaces(user *User) ([]*spaces.Space, error)
func (*UserService) GetTeams ¶
func (s *UserService) GetTeams(user *User, userQuery ...UserQuery) (*[]permissions.ProjectedTeamReferenceDataItem, error)
func (*UserService) Update
deprecated
func (s *UserService) Update(user *User) (*User, error)
Update modifies a user based on the one provided as input.
Deprecated: Use users.Update