admin

package
v1.4.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 18, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const ApiEndpoint = "https://api.atlassian.com/"

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthenticationService

type AuthenticationService struct {
	// contains filtered or unexported fields
}

func (*AuthenticationService) SetBearerToken

func (a *AuthenticationService) SetBearerToken(token string)

func (*AuthenticationService) SetUserAgent

func (a *AuthenticationService) SetUserAgent(agent string)

type Client

type Client struct {
	HTTP         *http.Client
	Site         *url.URL
	Auth         *AuthenticationService
	Organization *OrganizationService
	User         *UserService
	SCIM         *SCIMService
}

func New

func New(httpClient *http.Client) (client *Client, err error)

type OrganizationPolicyService

type OrganizationPolicyService struct {
	// contains filtered or unexported fields
}

func (*OrganizationPolicyService) Create

func (o *OrganizationPolicyService) Create(ctx context.Context, organizationID string, payload *model.OrganizationPolicyData) (
	result *model.OrganizationPolicyScheme, response *ResponseScheme, err error)

Create a policy for an org Docs: https://docs.go-atlassian.io/atlassian-admin-cloud/organization/policy#create-a-policy

func (*OrganizationPolicyService) Delete

func (o *OrganizationPolicyService) Delete(ctx context.Context, organizationID, policyID string) (
	response *ResponseScheme, err error)

Delete a policy for an org Docs: https://docs.go-atlassian.io/atlassian-admin-cloud/organization/policy#delete-a-policy

func (*OrganizationPolicyService) Get

func (o *OrganizationPolicyService) Get(ctx context.Context, organizationID, policyID string) (
	result *model.OrganizationPolicyScheme, response *ResponseScheme, err error)

Get information about a single policy by ID Docs: https://docs.go-atlassian.io/atlassian-admin-cloud/organization/policy#get-a-policy-by-id

func (*OrganizationPolicyService) Gets

func (o *OrganizationPolicyService) Gets(ctx context.Context, organizationID, policyType, cursor string) (
	result *model.OrganizationPolicyPageScheme, response *ResponseScheme, err error)

Gets returns information about org policies Docs: https://docs.go-atlassian.io/atlassian-admin-cloud/organization/policy#get-list-of-policies

func (*OrganizationPolicyService) Update

func (o *OrganizationPolicyService) Update(ctx context.Context, organizationID, policyID string,
	payload *model.OrganizationPolicyData) (result *model.OrganizationPolicyScheme, response *ResponseScheme, err error)

Update a policy for an org Docs: https://docs.go-atlassian.io/atlassian-admin-cloud/organization/policy#update-a-policy

type OrganizationService

type OrganizationService struct {
	Policy *OrganizationPolicyService
	// contains filtered or unexported fields
}

func (*OrganizationService) Actions

func (o *OrganizationService) Actions(ctx context.Context, organizationID string) (result *model.OrganizationEventActionScheme,
	response *ResponseScheme, err error)

Actions returns information localized event actions Docs: https://docs.go-atlassian.io/atlassian-admin-cloud/organization#get-list-of-event-actions

func (*OrganizationService) Domain

func (o *OrganizationService) Domain(ctx context.Context, organizationID, domainID string) (result *model.OrganizationDomainScheme,
	response *ResponseScheme, err error)

Domain returns information about a single verified domain by ID Docs: https://docs.go-atlassian.io/atlassian-admin-cloud/organization#get-domain-by-id

func (*OrganizationService) Domains

func (o *OrganizationService) Domains(ctx context.Context, organizationID, cursor string) (result *model.OrganizationDomainPageScheme,
	response *ResponseScheme, err error)

Domains returns a list of domains in an organization one page at a time Docs: https://docs.go-atlassian.io/atlassian-admin-cloud/organization#get-domains-in-an-organization

func (*OrganizationService) Event

func (o *OrganizationService) Event(ctx context.Context, organizationID, eventID string) (result *model.OrganizationEventScheme,
	response *ResponseScheme, err error)

Event returns information about a single event by ID. Docs: https://docs.go-atlassian.io/atlassian-admin-cloud/organization#get-an-event-by-id

func (*OrganizationService) Events

func (o *OrganizationService) Events(ctx context.Context, organizationID string, options *model.OrganizationEventOptScheme,
	cursor string) (result *model.OrganizationEventPageScheme, response *ResponseScheme, err error)

Events returns an audit log of events from an organization one page at a time Docs: https://docs.go-atlassian.io/atlassian-admin-cloud/organization#get-an-audit-log-of-events

func (*OrganizationService) Get

func (o *OrganizationService) Get(ctx context.Context, organizationID string) (result *model.AdminOrganizationScheme,
	response *ResponseScheme, err error)

Get returns information about a single organization by ID Docs: https://docs.go-atlassian.io/atlassian-admin-cloud/organization#get-an-organization-by-id

func (*OrganizationService) Gets

func (o *OrganizationService) Gets(ctx context.Context, cursor string) (result *model.AdminOrganizationPageScheme,
	response *ResponseScheme, err error)

Gets returns a list of your organizations Docs: https://docs.go-atlassian.io/atlassian-admin-cloud/organization#get-organizations

func (*OrganizationService) Users

func (o *OrganizationService) Users(ctx context.Context, organizationID, cursor string) (result *model.OrganizationUserPageScheme,
	response *ResponseScheme, err error)

Users returns a list of users in an organization Docs: https://docs.go-atlassian.io/atlassian-admin-cloud/organization#get-users-in-an-organization

type ResponseScheme added in v1.3.0

type ResponseScheme struct {
	Code     int
	Endpoint string
	Method   string
	Bytes    bytes.Buffer
	Headers  map[string][]string
}

type SCIMGroupService

type SCIMGroupService struct {
	// contains filtered or unexported fields
}

func (*SCIMGroupService) Create added in v1.1.5

func (g *SCIMGroupService) Create(ctx context.Context, directoryID, groupName string) (result *model.ScimGroupScheme,
	response *ResponseScheme, err error)

Create a group in a directory. An attempt to create a group with an existing name fails with a 409 (Conflict) error. Docs: https://docs.go-atlassian.io/atlassian-admin-cloud/scim/groups#create-a-group

func (*SCIMGroupService) Delete added in v1.1.5

func (g *SCIMGroupService) Delete(ctx context.Context, directoryID, groupID string) (response *ResponseScheme, err error)

Delete a group from a directory. An attempt to delete a non-existent group fails with a 404 (Resource Not found) error. Docs: https://docs.go-atlassian.io/atlassian-admin-cloud/scim/groups#delete-a-group-by-id

func (*SCIMGroupService) Get added in v1.1.5

func (g *SCIMGroupService) Get(ctx context.Context, directoryID, groupID string) (result *model.ScimGroupScheme,
	response *ResponseScheme, err error)

Get a group from a directory by group ID. Docs: https://docs.go-atlassian.io/atlassian-admin-cloud/scim/groups#get-a-group-by-id

func (*SCIMGroupService) Gets added in v1.1.5

func (g *SCIMGroupService) Gets(ctx context.Context, directoryID, filter string, startAt, maxResults int) (
	result *model.ScimGroupPageScheme, response *ResponseScheme, err error)

Gets gets groups from a directory. Filtering is supported with a single exact match (eq) against the displayName attribute. Pagination is supported. Sorting is not supported. Docs: https://docs.go-atlassian.io/atlassian-admin-cloud/scim/groups#get-groups

func (*SCIMGroupService) Path added in v1.1.5

func (g *SCIMGroupService) Path(ctx context.Context, directoryID, groupID string, payload *model.SCIMGroupPathScheme) (
	result *model.ScimGroupScheme, response *ResponseScheme, err error)

Path update a group's information in a directory by groupId via PATCH. You can use this API to manage group membership. Docs: https://docs.go-atlassian.io/atlassian-admin-cloud/scim/groups#update-a-group-by-id-patch

func (*SCIMGroupService) Update added in v1.1.5

func (g *SCIMGroupService) Update(ctx context.Context, directoryID, groupID string, newGroupName string) (result *model.ScimGroupScheme,
	response *ResponseScheme, err error)

Update a group in a directory by group ID. Docs: https://docs.go-atlassian.io/atlassian-admin-cloud/scim/groups#update-a-group-by-id

type SCIMSchemeService

type SCIMSchemeService struct {
	// contains filtered or unexported fields
}

func (*SCIMSchemeService) Enterprise

func (s *SCIMSchemeService) Enterprise(ctx context.Context, directoryID string) (result *model.SCIMSchemaScheme,
	response *ResponseScheme, err error)

Enterprise get the user enterprise extension schemas from the SCIM provider. Filtering, pagination and sorting are not supported. Docs: https://docs.go-atlassian.io/atlassian-admin-cloud/scim/schemes#get-user-enterprise-extension-schemas

func (*SCIMSchemeService) Feature

func (s *SCIMSchemeService) Feature(ctx context.Context, directoryID string) (result *model.ServiceProviderConfigScheme,
	response *ResponseScheme, err error)

Feature get metadata about the supported SCIM features. This is a service provider configuration endpoint providing supported SCIM features. Filtering, pagination and sorting are not supported. Docs: https://docs.go-atlassian.io/atlassian-admin-cloud/scim/schemes#get-feature-metadata

func (*SCIMSchemeService) Gets

func (s *SCIMSchemeService) Gets(ctx context.Context, directoryID string) (result *model.SCIMSchemasScheme,
	response *ResponseScheme, err error)

Gets all SCIM features metadata. Filtering, pagination and sorting are not supported. Docs: https://docs.go-atlassian.io/atlassian-admin-cloud/scim/schemes#get-all-schemas

func (*SCIMSchemeService) Group

func (s *SCIMSchemeService) Group(ctx context.Context, directoryID string) (result *model.SCIMSchemaScheme,
	response *ResponseScheme, err error)

Group get the group schemas from the SCIM provider. Filtering, pagination and sorting are not supported. Docs: https://docs.go-atlassian.io/atlassian-admin-cloud/scim/schemes#get-group-schemas

func (*SCIMSchemeService) User

func (s *SCIMSchemeService) User(ctx context.Context, directoryID string) (result *model.SCIMSchemaScheme,
	response *ResponseScheme, err error)

User get the user schemas from the SCIM provider. Filtering, pagination and sorting are not supported. Docs: https://docs.go-atlassian.io/atlassian-admin-cloud/scim/schemes#get-user-schemas

type SCIMService

type SCIMService struct {
	User   *SCIMUserService
	Group  *SCIMGroupService
	Scheme *SCIMSchemeService
	// contains filtered or unexported fields
}

type SCIMUserService

type SCIMUserService struct {
	// contains filtered or unexported fields
}

func (*SCIMUserService) Create

func (s *SCIMUserService) Create(ctx context.Context, directoryID string, payload *model.SCIMUserScheme, attributes,
	excludedAttributes []string) (result *model.SCIMUserScheme, response *ResponseScheme, err error)

Create a user in a directory. An attempt to create an existing user fails with a 409 (Conflict) error. A user account can only be created if it has an email address on a verified domain. If a managed Atlassian account already exists on the Atlassian platform for the specified email address, the user in your identity provider is linked to the user in your Atlassian organization. Docs: https://docs.go-atlassian.io/atlassian-admin-cloud/scim/users#create-a-user

func (*SCIMUserService) Deactivate

func (s *SCIMUserService) Deactivate(ctx context.Context, directoryID, userID string) (response *ResponseScheme, err error)

Deactivate a user by userId. The user is not available for future requests until activated again. Any future operation for the deactivated user returns the 404 (resource not found) error. Docs: https://docs.go-atlassian.io/atlassian-admin-cloud/scim/users#deactivate-a-user

func (*SCIMUserService) Get

func (s *SCIMUserService) Get(ctx context.Context, directoryID, userID string, attributes, excludedAttributes []string) (
	result *model.SCIMUserScheme, response *ResponseScheme, err error)

Get a user from a directory by userId. Docs: https://docs.go-atlassian.io/atlassian-admin-cloud/scim/users#get-a-user-by-id

func (*SCIMUserService) Gets

func (s *SCIMUserService) Gets(ctx context.Context, directoryID string, opts *model.SCIMUserGetsOptionsScheme, startIndex,
	count int) (result *model.SCIMUserPageScheme, response *ResponseScheme, err error)

Gets get users from the specified directory Docs: https://docs.go-atlassian.io/atlassian-admin-cloud/scim/users#get-users

func (*SCIMUserService) Path added in v1.1.5

func (s *SCIMUserService) Path(ctx context.Context, directoryID, userID string, payload *model.SCIMUserToPathScheme, attributes,
	excludedAttributes []string) (result *model.SCIMUserScheme, response *ResponseScheme, err error)

Path updates a user's information in a directory by userId via PATCH. Refer to GET /ServiceProviderConfig for details on the supported operations. Docs: https://docs.go-atlassian.io/atlassian-admin-cloud/scim/users#update-user-by-id-patch

func (*SCIMUserService) Update

func (s *SCIMUserService) Update(ctx context.Context, directoryID, userID string, payload *model.SCIMUserScheme, attributes,
	excludedAttributes []string) (result *model.SCIMUserScheme, response *ResponseScheme, err error)

Update updates a user's information in a directory by userId via user attributes. User information is replaced attribute-by-attribute, with the exception of immutable and read-only attributes. Existing values of unspecified attributes are cleaned. Docs: https://docs.go-atlassian.io/atlassian-admin-cloud/scim/users#update-user-via-user-attributes

type UserService

type UserService struct {
	Token *UserTokenService
	// contains filtered or unexported fields
}

func (*UserService) Disable

func (u *UserService) Disable(ctx context.Context, accountID, message string) (response *ResponseScheme, err error)

Disable disables the specified user account. The permission to make use of this resource is exposed by the lifecycle.enablement privilege You can optionally set a message associated with the block that will be shown to the user on attempted authentication. If none is supplied, a default message will be used. Example: https://docs.go-atlassian.io/atlassian-admin-cloud/user#disable-a-user

func (*UserService) Enable

func (u *UserService) Enable(ctx context.Context, accountID string) (response *ResponseScheme, err error)

Enable enables the specified user account. The permission to make use of this resource is exposed by the lifecycle.enablement privilege. This func needs the following parameters: Example: https://docs.go-atlassian.io/atlassian-admin-cloud/user#enable-a-user

func (*UserService) Get

func (u *UserService) Get(ctx context.Context, accountID string) (result *model.AdminUserScheme, response *ResponseScheme, err error)

Get returns information about a single Atlassian account by ID, this func needs the following parameters: Example: https://docs.go-atlassian.io/atlassian-admin-cloud/user#get-profile

func (*UserService) Permissions

func (u *UserService) Permissions(ctx context.Context, accountID string, privileges []string) (result *model.AdminUserPermissionScheme,
	response *ResponseScheme, err error)

Permissions returns the set of permissions you have for managing the specified Atlassian account, this func needs the following parameters: Example: https://docs.go-atlassian.io/atlassian-admin-cloud/user#get-user-management-permissions

func (*UserService) Update

func (u *UserService) Update(ctx context.Context, accountID string, payload map[string]interface{}) (
	result *model.AdminUserScheme, response *ResponseScheme, err error)

Update updates fields in a user account. The profile.write privilege details which fields you can change Example: https://docs.go-atlassian.io/atlassian-admin-cloud/user#update-profile

type UserTokenService

type UserTokenService struct {
	// contains filtered or unexported fields
}

func (*UserTokenService) Delete

func (u *UserTokenService) Delete(ctx context.Context, accountID, tokenID string) (response *ResponseScheme, err error)

Delete deletes a specified API token by ID, this func needs the following parameters: Docs: https://docs.go-atlassian.io/atlassian-admin-cloud/user/token#delete-api-token

func (*UserTokenService) Gets

func (u *UserTokenService) Gets(ctx context.Context, accountID string) (result *model.UserTokensScheme,
	response *ResponseScheme, err error)

Gets the API tokens owned by the specified user, this func needs the following parameters: Docs: https://docs.go-atlassian.io/atlassian-admin-cloud/user/token#get-api-tokens

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL