iam

package
v9.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2024 License: Apache-2.0 Imports: 16 Imported by: 3

Documentation

Overview

Package iam provides access to the Akamai Property APIs

Index

Constants

View Source
const (
	// LostAccessUsers with a userType of lostAccess lose their access to the source group.
	LostAccessUsers = "lostAccess"
	// GainAccessUsers with a userType of gainAccess gain their access to the source group.
	GainAccessUsers = "gainAccess"
)
View Source
const (
	// TFAActionEnable is an action value to use to enable tfa.
	TFAActionEnable TFAActionType = "enable"
	// TFAActionDisable is an action value to use to disable tfa.
	TFAActionDisable TFAActionType = "disable"
	// TFAActionReset is an action value to use to reset tfa.
	TFAActionReset TFAActionType = "reset"
	// MFAAuthentication is authentication of type MFA.
	MFAAuthentication Authentication = "MFA"
	// TFAAuthentication is authentication of type TFA.
	TFAAuthentication Authentication = "TFA"
	// NoneAuthentication represents a state where no authentication method is configured.
	NoneAuthentication Authentication = "NONE"
)

Variables

View Source
var (
	// ErrLockAPIClient is returned when LockAPIClient fails.
	ErrLockAPIClient = errors.New("lock api client")
	// ErrUnlockAPIClient is returned when UnlockAPIClient fails.
	ErrUnlockAPIClient = errors.New("unlock api client")
	// ErrListAPIClients is returned when ListAPIClients fails.
	ErrListAPIClients = errors.New("list api clients")
	// ErrGetAPIClient is returned when GetAPIClient fails.
	ErrGetAPIClient = errors.New("get api client")
	// ErrCreateAPIClient is returned when CreateAPIClient fails.
	ErrCreateAPIClient = errors.New("create api client")
	// ErrUpdateAPIClient is returned when UpdateAPIClient fails.
	ErrUpdateAPIClient = errors.New("update api client")
	// ErrDeleteAPIClient is returned when DeleteAPIClient fails.
	ErrDeleteAPIClient = errors.New("delete api client")
)
View Source
var (
	// ErrCreateCredential is returned when CreateCredential fails.
	ErrCreateCredential = errors.New("create credential")
	// ErrListCredentials is returned when ListCredentials fails.
	ErrListCredentials = errors.New("list credentials")
	// ErrGetCredential is returned when GetCredential fails.
	ErrGetCredential = errors.New("get credential")
	// ErrUpdateCredential is returned when UpdateCredential fails.
	ErrUpdateCredential = errors.New("update credential")
	// ErrDeleteCredential is returned when DeleteCredential fails.
	ErrDeleteCredential = errors.New("delete credential")
	// ErrDeactivateCredential is returned when DeactivateCredential fails.
	ErrDeactivateCredential = errors.New("deactivate credential")
	// ErrDeactivateCredentials is returned when DeactivateCredentials fails.
	ErrDeactivateCredentials = errors.New("deactivate credentials")
)
View Source
var (
	// ErrListBlockedProperties is returned when ListBlockedPropertiesRequest fails.
	ErrListBlockedProperties = errors.New("list blocked properties")

	// ErrUpdateBlockedProperties is returned when UpdateBlockedPropertiesRequest fails.
	ErrUpdateBlockedProperties = errors.New("update blocked properties")
)
View Source
var (
	// ErrListCIDRBlocks is returned when ListCIDRBlocks fails.
	ErrListCIDRBlocks = errors.New("list CIDR blocks")
	// ErrCreateCIDRBlock is returned when CreateCIDRBlock fails.
	ErrCreateCIDRBlock = errors.New("create CIDR block")
	// ErrGetCIDRBlock is returned when GetCIDRBlock fails.
	ErrGetCIDRBlock = errors.New("get CIDR block")
	// ErrUpdateCIDRBlock is returned when UpdateCIDRBlock fails.
	ErrUpdateCIDRBlock = errors.New("update CIDR block")
	// ErrDeleteCIDRBlock is returned when DeleteCIDRBlock fails.
	ErrDeleteCIDRBlock = errors.New("delete CIDR block")
	// ErrValidateCIDRBlock is returned when ValidateCIDRBlock fails.
	ErrValidateCIDRBlock = errors.New("validate CIDR block")
)
View Source
var (
	// ErrCreateGroup is returned when CreateGroup fails.
	ErrCreateGroup = errors.New("create group")
	// ErrGetGroup is returned when GetGroup fails.
	ErrGetGroup = errors.New("get group")
	// ErrListAffectedUsers is returned when ListAffectedUsers fails.
	ErrListAffectedUsers = errors.New("list affected users")
	// ErrListGroups is returned when ListGroups fails.
	ErrListGroups = errors.New("list groups")
	// ErrUpdateGroupName is returned when UpdateGroupName fails.
	ErrUpdateGroupName = errors.New("update group name")
	// ErrRemoveGroup is returned when RemoveGroup fails.
	ErrRemoveGroup = errors.New("remove group")
	// ErrMoveGroup is returned when MoveGroup fails.
	ErrMoveGroup = errors.New("move group")
)
View Source
var (
	// ErrListAllowedCPCodes is returned when ListAllowedCPCodes fails.
	ErrListAllowedCPCodes = errors.New("list allowed CP codes")
	// ErrListAuthorizedUsers is returned when ListAuthorizedUsers fails.
	ErrListAuthorizedUsers = errors.New("list authorized users")
	// ErrListAllowedAPIs is returned when ListAllowedAPIs fails.
	ErrListAllowedAPIs = errors.New("list allowed APIs")
	// ErrAccessibleGroups is returned when ListAccessibleGroups fails.
	ErrAccessibleGroups = errors.New("list accessible groups")
)
View Source
var (
	// ErrDisableIPAllowlist is returned when DisableIPAllowlist fails.
	ErrDisableIPAllowlist = errors.New("disable ip allowlist")
	// ErrEnableIPAllowlist is returned when EnableIPAllowlist fails.
	ErrEnableIPAllowlist = errors.New("enable ip allowlist")
	// ErrGetIPAllowlistStatus is returned when GetIPAllowlistStatus fails.
	ErrGetIPAllowlistStatus = errors.New("get ip allowlist status")
)
View Source
var (
	// ErrListProperties is returned when ListProperties fails.
	ErrListProperties = errors.New("list properties")
	// ErrListUsersForProperty is returned when ListUsersForProperty fails.
	ErrListUsersForProperty = errors.New("list users for property")
	// ErrGetProperty is returned when GetProperty fails.
	ErrGetProperty = errors.New("get property")
	// ErrMoveProperty is returned when MoveProperty fails.
	ErrMoveProperty = errors.New("move property")
	// ErrMapPropertyIDToName is returned when MapPropertyIDToName fails.
	ErrMapPropertyIDToName = errors.New("map property by id")
	// ErrMapPropertyNameToID is returned when MapPropertyNameToID fails.
	ErrMapPropertyNameToID = errors.New("map property by name")
	// ErrNoProperty is returned when MapPropertyNameToID did not find given property.
	ErrNoProperty = errors.New("no such property")
	// ErrBlockUsers is returned when BlockUsers fails.
	ErrBlockUsers = errors.New("block users")
)
View Source
var (
	// ErrCreateRole is returned when CreateRole fails.
	ErrCreateRole = errors.New("create a role")
	// ErrGetRole is returned when GetRole fails.
	ErrGetRole = errors.New("get a role")
	// ErrUpdateRole is returned when UpdateRole fails.
	ErrUpdateRole = errors.New("update a role")
	// ErrDeleteRole is returned when DeleteRole fails.
	ErrDeleteRole = errors.New("delete a role")
	// ErrListRoles is returned when ListRoles fails.
	ErrListRoles = errors.New("list roles")
	// ErrListGrantableRoles is returned when ListGrantableRoles fails.
	ErrListGrantableRoles = errors.New("list grantable roles")
)
View Source
var (
	// ErrGetPasswordPolicy is returned when GetPasswordPolicy fails.
	ErrGetPasswordPolicy = errors.New("get password policy")

	// ErrListProducts is returned when ListProducts fails.
	ErrListProducts = errors.New("list products")

	// ErrListStates is returned when ListStates fails.
	ErrListStates = errors.New("list states")

	// ErrListTimeoutPolicies is returned when ListTimeoutPolicies fails.
	ErrListTimeoutPolicies = errors.New("list timeout policies")

	// ErrListAccountSwitchKeys is returned when ListAccountSwitchKeys fails.
	ErrListAccountSwitchKeys = errors.New("list account switch keys")

	// ErrSupportedContactTypes is returned when SupportedContactTypes fails.
	ErrSupportedContactTypes = errors.New("supported contact types")

	// ErrSupportedCountries is returned when SupportedCountries fails.
	ErrSupportedCountries = errors.New("supported countries")

	// ErrSupportedLanguages is returned when SupportedLanguages fails.
	ErrSupportedLanguages = errors.New("supported languages")

	// ErrSupportedTimezones is returned when SupportedTimezones fails.
	ErrSupportedTimezones = errors.New("supported timezones")
)
View Source
var (
	// ErrCreateUser is returned when CreateUser fails.
	ErrCreateUser = errors.New("create user")

	// ErrGetUser is returned when GetUser fails.
	ErrGetUser = errors.New("get user")

	// ErrListUsers is returned when ListUsers fails.
	ErrListUsers = errors.New("list users")

	// ErrRemoveUser is returned when RemoveUser fails.
	ErrRemoveUser = errors.New("remove user")

	// ErrUpdateUserAuthGrants is returned when UpdateUserAuthGrants fails.
	ErrUpdateUserAuthGrants = errors.New("update user auth grants")

	// ErrUpdateUserInfo is returned when UpdateUserInfo fails.
	ErrUpdateUserInfo = errors.New("update user info")

	// ErrUpdateUserNotifications is returned when UpdateUserNotifications fails.
	ErrUpdateUserNotifications = errors.New("update user notifications")

	// ErrUpdateTFA is returned when UpdateTFA fails.
	ErrUpdateTFA = errors.New("update user's two-factor authentication")

	// ErrUpdateMFA is returned when UpdateMFA fails.
	ErrUpdateMFA = errors.New("update user's authentication method")

	// ErrResetMFA is returned when ResetMFA fails.
	ErrResetMFA = errors.New("reset user's authentication method")
)
View Source
var (
	// ErrLockUser is returned when LockUser fails.
	ErrLockUser = errors.New("lock user")

	// ErrUnlockUser is returned when UnlockUser fails.
	ErrUnlockUser = errors.New("unlock user")
)
View Source
var (
	// ErrResetUserPassword is returned when ResetUserPassword fails.
	ErrResetUserPassword = errors.New("reset user password")

	// ErrSetUserPassword is returned when SetUserPassword fails.
	ErrSetUserPassword = errors.New("set user password")
)
View Source
var (
	// ErrStructValidation is returned when given struct validation failed
	ErrStructValidation = errors.New("struct validation")
)

Functions

This section is empty.

Types

type API

type API struct {
	AccessLevel      AccessLevel `json:"accessLevel"`
	APIID            int64       `json:"apiId"`
	APIName          string      `json:"apiName"`
	Description      string      `json:"description"`
	DocumentationURL string      `json:"documentationUrl"`
	Endpoint         string      `json:"endPoint"`
}

API represents single Application Programming Interface (API).

func (API) Validate

func (a API) Validate() error

Validate validates API.

type APIAccess

type APIAccess struct {
	AllAccessibleAPIs bool  `json:"allAccessibleApis"`
	APIs              []API `json:"apis"`
}

APIAccess represents the APIs the API client can access.

func (APIAccess) Validate

func (a APIAccess) Validate() error

Validate validates APIAccess.

type APIClient

type APIClient struct {
	AccessToken             string     `json:"accessToken"`
	ActiveCredentialCount   int64      `json:"activeCredentialCount"`
	AllowAccountSwitch      bool       `json:"allowAccountSwitch"`
	AuthorizedUsers         []string   `json:"authorizedUsers"`
	CanAutoCreateCredential bool       `json:"canAutoCreateCredential"`
	ClientDescription       string     `json:"clientDescription"`
	ClientID                string     `json:"clientId"`
	ClientName              string     `json:"clientName"`
	ClientType              ClientType `json:"clientType"`
	CreatedBy               string     `json:"createdBy"`
	CreatedDate             time.Time  `json:"createdDate"`
	IsLocked                bool       `json:"isLocked"`
	NotificationEmails      []string   `json:"notificationEmails"`
	ServiceConsumerToken    string     `json:"serviceConsumerToken"`
}

APIClient contains information about the API client.

type APIClientActions

type APIClientActions struct {
	Delete            bool `json:"delete"`
	DeactivateAll     bool `json:"deactivateAll"`
	Edit              bool `json:"edit"`
	EditAPIs          bool `json:"editApis"`
	EditAuth          bool `json:"editAuth"`
	EditGroups        bool `json:"editGroups"`
	EditIPAcl         bool `json:"editIpAcl"`
	EditSwitchAccount bool `json:"editSwitchAccount"`
	Lock              bool `json:"lock"`
	Transfer          bool `json:"transfer"`
	Unlock            bool `json:"unlock"`
}

APIClientActions specifies activities available for the API client.

type APIClientCredential

type APIClientCredential struct {
	Actions      CredentialActions `json:"actions"`
	ClientToken  string            `json:"clientToken"`
	CreatedOn    time.Time         `json:"createdOn"`
	CredentialID int64             `json:"credentialId"`
	Description  string            `json:"description"`
	ExpiresOn    time.Time         `json:"expiresOn"`
	Status       CredentialStatus  `json:"status"`
}

APIClientCredential represents single Credential returned by APIClient interfaces.

type AccessLevel

type AccessLevel string

AccessLevel represents the access level for API.

const (
	// ReadWriteLevel is the `READ-WRITE` access level.
	ReadWriteLevel AccessLevel = "READ-WRITE"
	// ReadOnlyLevel is the `READ-ONLY` access level.
	ReadOnlyLevel AccessLevel = "READ-ONLY"
)

type AccessibleGroup

type AccessibleGroup struct {
	GroupID         int64                `json:"groupId"`
	RoleID          int64                `json:"roleId"`
	GroupName       string               `json:"groupName"`
	RoleName        string               `json:"roleName"`
	IsBlocked       bool                 `json:"isBlocked"`
	RoleDescription string               `json:"roleDescription"`
	SubGroups       []AccessibleSubGroup `json:"subGroups"`
}

AccessibleGroup contains the details about accessible group.

type AccessibleSubGroup

type AccessibleSubGroup struct {
	GroupID       int64                `json:"groupId"`
	GroupName     string               `json:"groupName"`
	ParentGroupID int64                `json:"parentGroupId"`
	SubGroups     []AccessibleSubGroup `json:"subGroups"`
}

AccessibleSubGroup contains the details about subgroup.

type AccountSwitchKey

type AccountSwitchKey struct {
	AccountName      string `json:"accountName"`
	AccountSwitchKey string `json:"accountSwitchKey"`
}

AccountSwitchKey contains information about account switch key.

type AllowedAPI

type AllowedAPI struct {
	AccessLevels      []AccessLevel `json:"accessLevels"`
	APIID             int64         `json:"apiId"`
	APIName           string        `json:"apiName"`
	Description       string        `json:"description"`
	DocumentationURL  string        `json:"documentationUrl"`
	Endpoint          string        `json:"endpoint"`
	HasAccess         bool          `json:"hasAccess"`
	ServiceProviderID int64         `json:"serviceProviderId"`
}

AllowedAPI contains the details about the API.

type AllowedCPCodesGroup

type AllowedCPCodesGroup struct {
	GroupID         int64                 `json:"groupId,omitempty"`
	RoleID          int64                 `json:"roleId,omitempty"`
	GroupName       string                `json:"groupName,omitempty"`
	IsBlocked       bool                  `json:"isBlocked,omitempty"`
	ParentGroupID   int64                 `json:"parentGroupId,omitempty"`
	RoleDescription string                `json:"roleDescription,omitempty"`
	RoleName        string                `json:"roleName,omitempty"`
	SubGroups       []AllowedCPCodesGroup `json:"subGroups,omitempty"`
}

AllowedCPCodesGroup contains the group parameters for the ListAllowedCPCodes endpoint.

type AuthGrant

type AuthGrant struct {
	GroupID         int64       `json:"groupId"`
	GroupName       string      `json:"groupName"`
	IsBlocked       bool        `json:"isBlocked"`
	RoleDescription string      `json:"roleDescription"`
	RoleID          *int        `json:"roleId,omitempty"`
	RoleName        string      `json:"roleName"`
	Subgroups       []AuthGrant `json:"subGroups,omitempty"`
}

AuthGrant is user’s role assignments, per group.

func (AuthGrant) Validate

func (r AuthGrant) Validate() error

Validate validates validation on AuthGrant.

type AuthGrantRequest

type AuthGrantRequest struct {
	GroupID   int64              `json:"groupId"`
	IsBlocked bool               `json:"isBlocked"`
	RoleID    *int               `json:"roleId,omitempty"`
	Subgroups []AuthGrantRequest `json:"subGroups,omitempty"`
}

AuthGrantRequest is user’s role assignments, per group for the create/update operation.

type Authentication

type Authentication string

Authentication is a type of additional authentication.

func (Authentication) Validate

func (a Authentication) Validate() error

Validate validates Authentication.

type AuthorizedUser

type AuthorizedUser struct {
	FirstName    string `json:"firstName"`
	LastName     string `json:"lastName"`
	Username     string `json:"username"`
	Email        string `json:"email"`
	UIIdentityID string `json:"uiIdentityId"`
}

AuthorizedUser contains the details about the authorized user.

type BlockUserItem

type BlockUserItem struct {
	UIIdentityID string `json:"uiIdentityId"`
}

BlockUserItem contains body parameters for the BlockUsers endpoint.

func (BlockUserItem) Validate

func (r BlockUserItem) Validate() error

Validate validates BlockUserItem.

type BlockUsersRequest

type BlockUsersRequest struct {
	PropertyID int64
	Body       BlockUsersRequestBody
}

BlockUsersRequest contains the request parameters for the BlockUsers endpoint.

func (BlockUsersRequest) Validate

func (r BlockUsersRequest) Validate() error

Validate validates BlockUsersRequest.

type BlockUsersRequestBody

type BlockUsersRequestBody []BlockUserItem

BlockUsersRequestBody hold the request body parameters for the BlockUsers endpoint.

type BlockUsersResponse

type BlockUsersResponse []UsersForProperty

BlockUsersResponse holds the response data from the BlockUsers endpoint.

type CIDRActions

type CIDRActions struct {
	Delete bool `json:"delete"`
	Edit   bool `json:"edit"`
}

CIDRActions specifies activities available for the CIDR block.

type CIDRBlock

type CIDRBlock struct {
	Actions      *CIDRActions `json:"actions"`
	CIDRBlock    string       `json:"cidrBlock"`
	CIDRBlockID  int64        `json:"cidrBlockId"`
	Comments     *string      `json:"comments"`
	CreatedBy    string       `json:"createdBy"`
	CreatedDate  time.Time    `json:"createdDate"`
	Enabled      bool         `json:"enabled"`
	ModifiedBy   string       `json:"modifiedBy"`
	ModifiedDate time.Time    `json:"modifiedDate"`
}

CIDRBlock represents a CIDR block.

type CPCodeAccess

type CPCodeAccess struct {
	AllCurrentAndNewCPCodes bool    `json:"allCurrentAndNewCpcodes"`
	CPCodes                 []int64 `json:"cpcodes"`
}

CPCodeAccess represents the CP codes the API client can purge.

func (CPCodeAccess) Validate

func (ca CPCodeAccess) Validate() error

Validate validates CPCodeAccess.

type ClientFunc

type ClientFunc func(sess session.Session, opts ...Option) IAM

ClientFunc is an IAM client new method, this can be used for mocking.

type ClientGroup

type ClientGroup struct {
	GroupID         int64         `json:"groupId"`
	GroupName       string        `json:"groupName"`
	IsBlocked       bool          `json:"isBlocked"`
	ParentGroupID   int64         `json:"parentGroupId"`
	RoleDescription string        `json:"roleDescription"`
	RoleID          int64         `json:"roleId"`
	RoleName        string        `json:"roleName"`
	Subgroups       []ClientGroup `json:"subgroups"`
}

ClientGroup represents a group the API client can access.

func (ClientGroup) Validate

func (cg ClientGroup) Validate() error

Validate validates ClientGroup.

type ClientType

type ClientType string

ClientType represents the type of the client.

const (
	// UserClientType is the `USER_CLIENT` client type.
	UserClientType ClientType = "USER_CLIENT"
	// ServiceAccountClientType is the `SERVICE_ACCOUNT` client type.
	ServiceAccountClientType ClientType = "SERVICE_ACCOUNT"
	// ClientClientType is the `CLIENT` client type.
	ClientClientType ClientType = "CLIENT"
)

func (ClientType) Validate

func (c ClientType) Validate() error

Validate validates ClientType.

type CreateAPIClientCredential

type CreateAPIClientCredential struct {
	Actions      CredentialActions `json:"actions"`
	ClientToken  string            `json:"clientToken"`
	ClientSecret string            `json:"clientSecret"`
	CreatedOn    time.Time         `json:"createdOn"`
	CredentialID int64             `json:"credentialId"`
	Description  string            `json:"description"`
	ExpiresOn    time.Time         `json:"expiresOn"`
	Status       CredentialStatus  `json:"status"`
}

CreateAPIClientCredential represents single Credential returned by CreateAPIClient endpoint.

type CreateAPIClientRequest

type CreateAPIClientRequest struct {
	AllowAccountSwitch      bool          `json:"allowAccountSwitch"`
	APIAccess               APIAccess     `json:"apiAccess"`
	AuthorizedUsers         []string      `json:"authorizedUsers"`
	CanAutoCreateCredential bool          `json:"canAutoCreateCredential"`
	ClientDescription       string        `json:"clientDescription"`
	ClientName              string        `json:"clientName"`
	ClientType              ClientType    `json:"clientType"`
	CreateCredential        bool          `json:"createCredential"`
	GroupAccess             GroupAccess   `json:"groupAccess"`
	IPACL                   *IPACL        `json:"ipAcl,omitempty"`
	NotificationEmails      []string      `json:"notificationEmails"`
	PurgeOptions            *PurgeOptions `json:"purgeOptions,omitempty"`
}

CreateAPIClientRequest contains the request parameters for the CreateAPIClient endpoint.

func (CreateAPIClientRequest) Validate

func (r CreateAPIClientRequest) Validate() error

Validate validates CreateAPIClientRequest.

type CreateAPIClientResponse

type CreateAPIClientResponse struct {
	AccessToken             string                      `json:"accessToken"`
	Actions                 *APIClientActions           `json:"actions"`
	ActiveCredentialCount   int64                       `json:"activeCredentialCount"`
	AllowAccountSwitch      bool                        `json:"allowAccountSwitch"`
	APIAccess               APIAccess                   `json:"apiAccess"`
	AuthorizedUsers         []string                    `json:"authorizedUsers"`
	BaseURL                 string                      `json:"baseURL"`
	CanAutoCreateCredential bool                        `json:"canAutoCreateCredential"`
	ClientDescription       string                      `json:"clientDescription"`
	ClientID                string                      `json:"clientId"`
	ClientName              string                      `json:"clientName"`
	ClientType              ClientType                  `json:"clientType"`
	CreatedBy               string                      `json:"createdBy"`
	CreatedDate             time.Time                   `json:"createdDate"`
	Credentials             []CreateAPIClientCredential `json:"credentials"`
	GroupAccess             GroupAccess                 `json:"groupAccess"`
	IPACL                   IPACL                       `json:"ipAcl"`
	IsLocked                bool                        `json:"isLocked"`
	NotificationEmails      []string                    `json:"notificationEmails"`
	PurgeOptions            PurgeOptions                `json:"purgeOptions"`
	ServiceProviderID       int64                       `json:"serviceProviderId"`
}

CreateAPIClientResponse describes the response of the CreateAPIClient endpoint.

type CreateCIDRBlockRequest

type CreateCIDRBlockRequest struct {
	CIDRBlock string  `json:"cidrBlock"`
	Comments  *string `json:"comments,omitempty"`
	Enabled   bool    `json:"enabled"`
}

CreateCIDRBlockRequest contains the request parameters for the CreateCIDRBlock endpoint.

func (CreateCIDRBlockRequest) Validate

func (r CreateCIDRBlockRequest) Validate() error

Validate validates validation on CreateCIDRBlockRequest.

type CreateCIDRBlockResponse

type CreateCIDRBlockResponse CIDRBlock

CreateCIDRBlockResponse describes the response from the CreateCIDRBlock endpoint.

type CreateCredentialRequest

type CreateCredentialRequest struct {
	ClientID string
}

CreateCredentialRequest contains request parameters for the CreateCredential endpoint.

type CreateCredentialResponse

type CreateCredentialResponse struct {
	ClientSecret string           `json:"clientSecret"`
	ClientToken  string           `json:"clientToken"`
	CreatedOn    time.Time        `json:"createdOn"`
	CredentialID int64            `json:"credentialId"`
	Description  string           `json:"description"`
	ExpiresOn    time.Time        `json:"expiresOn"`
	Status       CredentialStatus `json:"status"`
}

CreateCredentialResponse holds response from the CreateCredentials endpoint.

type CreateRoleRequest

type CreateRoleRequest RoleRequest

CreateRoleRequest describes the request parameters for the CreateRole endpoint.

func (CreateRoleRequest) Validate

func (r CreateRoleRequest) Validate() error

Validate validates CreateRoleRequest.

type CreateUserRequest

type CreateUserRequest struct {
	UserBasicInfo
	AuthGrants    []AuthGrantRequest `json:"authGrants,omitempty"`
	Notifications *UserNotifications `json:"notifications,omitempty"`
	SendEmail     bool               `json:"-"`
}

CreateUserRequest contains the request parameters for the CreateUser endpoint.

func (CreateUserRequest) Validate

func (r CreateUserRequest) Validate() error

Validate validates CreateUserRequest.

type Credential

type Credential struct {
	ClientToken      string             `json:"clientToken"`
	CreatedOn        time.Time          `json:"createdOn"`
	CredentialID     int64              `json:"credentialId"`
	Description      string             `json:"description"`
	ExpiresOn        time.Time          `json:"expiresOn"`
	Status           CredentialStatus   `json:"status"`
	MaxAllowedExpiry time.Time          `json:"maxAllowedExpiry"`
	Actions          *CredentialActions `json:"actions"`
}

Credential represents single credential information.

type CredentialActions

type CredentialActions struct {
	Deactivate      bool `json:"deactivate"`
	Delete          bool `json:"delete"`
	Activate        bool `json:"activate"`
	EditDescription bool `json:"editDescription"`
	EditExpiration  bool `json:"editExpiration"`
}

CredentialActions describes the actions that can be performed on the credential.

type CredentialStatus

type CredentialStatus string

CredentialStatus represents the status of the credential.

const (
	// CredentialActive represents active credential.
	CredentialActive CredentialStatus = "ACTIVE"
	// CredentialInactive represents inactive credential.
	CredentialInactive CredentialStatus = "INACTIVE"
	// CredentialDeleted represents deleted credential.
	CredentialDeleted CredentialStatus = "DELETED"
)

func (CredentialStatus) Validate

func (c CredentialStatus) Validate() error

Validate validates CredentialStatus.

type DeactivateCredentialRequest

type DeactivateCredentialRequest struct {
	CredentialID int64
	ClientID     string
}

DeactivateCredentialRequest contains request parameters for the DeactivateCredential endpoint.

func (DeactivateCredentialRequest) Validate

func (r DeactivateCredentialRequest) Validate() error

Validate validates DeactivateCredentialRequest.

type DeactivateCredentialsRequest

type DeactivateCredentialsRequest struct {
	ClientID string
}

DeactivateCredentialsRequest contains request parameters for the DeactivateCredentials endpoint.

type DeleteAPIClientRequest

type DeleteAPIClientRequest struct {
	ClientID string
}

DeleteAPIClientRequest contains the request parameters for the DeleteAPIClient endpoint.

type DeleteCIDRBlockRequest

type DeleteCIDRBlockRequest struct {
	CIDRBlockID int64
}

DeleteCIDRBlockRequest contains the request parameters for the DeleteCIDRBlock endpoint.

func (DeleteCIDRBlockRequest) Validate

func (r DeleteCIDRBlockRequest) Validate() error

Validate validates validation on DeleteCIDRBlockRequest.

type DeleteCredentialRequest

type DeleteCredentialRequest struct {
	CredentialID int64
	ClientID     string
}

DeleteCredentialRequest contains request parameters for the DeleteCredential endpoint.

func (DeleteCredentialRequest) Validate

func (r DeleteCredentialRequest) Validate() error

Validate validates DeleteCredentialRequest.

type DeleteRoleRequest

type DeleteRoleRequest struct {
	ID int64
}

DeleteRoleRequest describes the request parameters for the DeleteRole endpoint.

func (DeleteRoleRequest) Validate

func (r DeleteRoleRequest) Validate() error

Validate validates DeleteRoleRequest.

type Error

type Error struct {
	Type          string          `json:"type"`
	Title         string          `json:"title"`
	Detail        string          `json:"detail"`
	Instance      string          `json:"instance,omitempty"`
	BehaviorName  string          `json:"behaviorName,omitempty"`
	ErrorLocation string          `json:"errorLocation,omitempty"`
	StatusCode    int             `json:"statusCode,omitempty"`
	Errors        json.RawMessage `json:"errors,omitempty"`
	Warnings      json.RawMessage `json:"warnings,omitempty"`
	HTTPStatus    int             `json:"httpStatus,omitempty"`
}

Error is an IAM error interface.

func (*Error) Error

func (e *Error) Error() string

func (*Error) Is

func (e *Error) Is(target error) bool

Is handles error comparisons.

type GetAPIClientRequest

type GetAPIClientRequest struct {
	ClientID    string
	Actions     bool
	GroupAccess bool
	APIAccess   bool
	Credentials bool
	IPACL       bool
}

GetAPIClientRequest contains the request parameters for the GetAPIClient endpoint.

type GetAPIClientResponse

type GetAPIClientResponse struct {
	AccessToken             string                `json:"accessToken"`
	Actions                 *APIClientActions     `json:"actions"`
	ActiveCredentialCount   int64                 `json:"activeCredentialCount"`
	AllowAccountSwitch      bool                  `json:"allowAccountSwitch"`
	APIAccess               APIAccess             `json:"apiAccess"`
	AuthorizedUsers         []string              `json:"authorizedUsers"`
	BaseURL                 string                `json:"baseURL"`
	CanAutoCreateCredential bool                  `json:"canAutoCreateCredential"`
	ClientDescription       string                `json:"clientDescription"`
	ClientID                string                `json:"clientId"`
	ClientName              string                `json:"clientName"`
	ClientType              ClientType            `json:"clientType"`
	CreatedBy               string                `json:"createdBy"`
	CreatedDate             time.Time             `json:"createdDate"`
	Credentials             []APIClientCredential `json:"credentials"`
	GroupAccess             GroupAccess           `json:"groupAccess"`
	IPACL                   IPACL                 `json:"ipAcl"`
	IsLocked                bool                  `json:"isLocked"`
	NotificationEmails      []string              `json:"notificationEmails"`
	PurgeOptions            PurgeOptions          `json:"purgeOptions"`
	ServiceProviderID       int64                 `json:"serviceProviderId"`
}

GetAPIClientResponse describes the response of the GetAPIClient endpoint.

type GetCIDRBlockRequest

type GetCIDRBlockRequest struct {
	CIDRBlockID int64
	Actions     bool
}

GetCIDRBlockRequest contains the request parameters for the GetCIDRBlock endpoint.

func (GetCIDRBlockRequest) Validate

func (r GetCIDRBlockRequest) Validate() error

Validate validates validation on GetCIDRBlockRequest.

type GetCIDRBlockResponse

type GetCIDRBlockResponse CIDRBlock

GetCIDRBlockResponse describes the response from the GetCIDRBlock endpoint.

type GetCredentialRequest

type GetCredentialRequest struct {
	CredentialID int64
	ClientID     string
	Actions      bool
}

GetCredentialRequest contains request parameters for the GetCredential endpoint.

func (GetCredentialRequest) Validate

func (r GetCredentialRequest) Validate() error

Validate validates GetCredentialRequest.

type GetCredentialResponse

type GetCredentialResponse Credential

GetCredentialResponse holds response from the GetCredential endpoint.

type GetGroupRequest

type GetGroupRequest struct {
	GroupID int64
	Actions bool
}

GetGroupRequest describes the request parameters for the GetGroup endpoint.

func (GetGroupRequest) Validate

func (r GetGroupRequest) Validate() error

Validate validates GetGroupRequest.

type GetIPAllowlistStatusResponse

type GetIPAllowlistStatusResponse struct {
	Enabled bool `json:"enabled"`
}

GetIPAllowlistStatusResponse contains response from the GetIPAllowlistStatus endpoint.

type GetPasswordPolicyResponse

type GetPasswordPolicyResponse struct {
	CaseDiff        int64  `json:"caseDif"`
	MaxRepeating    int64  `json:"maxRepeating"`
	MinDigits       int64  `json:"minDigits"`
	MinLength       int64  `json:"minLength"`
	MinLetters      int64  `json:"minLetters"`
	MinNonAlpha     int64  `json:"minNonAlpha"`
	MinReuse        int64  `json:"minReuse"`
	PwClass         string `json:"pwclass"`
	RotateFrequency int64  `json:"rotateFrequency"`
}

GetPasswordPolicyResponse holds the response data from the GetPasswordPolicy endpoint.

type GetPropertyRequest

type GetPropertyRequest struct {
	PropertyID int64
	GroupID    int64
}

GetPropertyRequest contains the request parameters for the GetProperty endpoint.

func (GetPropertyRequest) Validate

func (r GetPropertyRequest) Validate() error

Validate validates GetPropertyRequest.

type GetPropertyResponse

type GetPropertyResponse struct {
	ARLConfigFile string    `json:"arlConfigFile"`
	CreatedBy     string    `json:"createdBy"`
	CreatedDate   time.Time `json:"createdDate"`
	GroupID       int64     `json:"groupId"`
	GroupName     string    `json:"groupName"`
	ModifiedBy    string    `json:"modifiedBy"`
	ModifiedDate  time.Time `json:"modifiedDate"`
	PropertyID    int64     `json:"propertyId"`
	PropertyName  string    `json:"propertyName"`
}

GetPropertyResponse holds the response data from the GetProperty endpoint.

type GetRoleRequest

type GetRoleRequest struct {
	ID           int64
	Actions      bool
	GrantedRoles bool
	Users        bool
}

GetRoleRequest describes the request parameters for the GetRole endpoint.

func (GetRoleRequest) Validate

func (r GetRoleRequest) Validate() error

Validate validates GetRoleRequest.

type GetUserRequest

type GetUserRequest struct {
	IdentityID    string
	Actions       bool
	AuthGrants    bool
	Notifications bool
}

GetUserRequest contains the request parameters for the GetUser endpoint.

func (GetUserRequest) Validate

func (r GetUserRequest) Validate() error

Validate validates GetUserRequest.

type GrantedRoleID

type GrantedRoleID struct {
	ID int64 `json:"grantedRoleId"`
}

GrantedRoleID describes a unique identifier for a granted role.

type Group

type Group struct {
	Actions       *GroupActions `json:"actions,omitempty"`
	CreatedBy     string        `json:"createdBy"`
	CreatedDate   time.Time     `json:"createdDate"`
	GroupID       int64         `json:"groupId"`
	GroupName     string        `json:"groupName"`
	ModifiedBy    string        `json:"modifiedBy"`
	ModifiedDate  time.Time     `json:"modifiedDate"`
	ParentGroupID int64         `json:"parentGroupId"`
	SubGroups     []Group       `json:"subGroups,omitempty"`
}

Group describes the response from the ListGroups endpoint.

type GroupAccess

type GroupAccess struct {
	CloneAuthorizedUserGroups bool          `json:"cloneAuthorizedUserGroups"`
	Groups                    []ClientGroup `json:"groups"`
}

GroupAccess specifies the API client's group access.

func (GroupAccess) Validate

func (ga GroupAccess) Validate() error

Validate validates GroupAccess.

type GroupActions

type GroupActions struct {
	Delete bool `json:"delete"`
	Edit   bool `json:"edit"`
}

GroupActions encapsulates permissions available to the user for this group.

type GroupRequest

type GroupRequest struct {
	GroupID   int64  `json:"-"`
	GroupName string `json:"groupName"`
}

GroupRequest describes the request and body parameters for creating new group or updating a group name endpoint.

func (GroupRequest) Validate

func (r GroupRequest) Validate() error

Validate validates GroupRequest.

type GroupUser

type GroupUser struct {
	AccountID     string    `json:"accountId"`
	Email         string    `json:"email"`
	FirstName     string    `json:"firstName"`
	IdentityID    string    `json:"uiIdentityId"`
	LastLoginDate time.Time `json:"lastLoginDate"`
	LastName      string    `json:"lastName"`
	UserName      string    `json:"uiUserName"`
}

GroupUser describes the response from the ListAffectedUsers endpoint.

type IAM

type IAM interface {

	// LockAPIClient locks an API client based on `ClientID` parameter. If `ClientID` is not provided, it locks your API client.
	//
	// See: https://techdocs.akamai.com/iam-api/reference/put-lock-api-client, https://techdocs.akamai.com/iam-api/reference/put-lock-api-client-self
	LockAPIClient(ctx context.Context, params LockAPIClientRequest) (*LockAPIClientResponse, error)

	// UnlockAPIClient unlocks an API client.
	//
	// See: https://techdocs.akamai.com/iam-api/reference/put-unlock-api-client
	UnlockAPIClient(ctx context.Context, params UnlockAPIClientRequest) (*UnlockAPIClientResponse, error)

	// ListAPIClients lists API clients an administrator can manage.
	//
	// See: https://techdocs.akamai.com/iam-api/reference/get-api-clients
	ListAPIClients(ctx context.Context, params ListAPIClientsRequest) (ListAPIClientsResponse, error)

	// GetAPIClient provides details about an API client. If `ClientID` is not provided, it returns details about your API client.
	//
	// See: https://techdocs.akamai.com/iam-api/reference/get-api-client and https://techdocs.akamai.com/iam-api/reference/get-api-client-self
	GetAPIClient(ctx context.Context, params GetAPIClientRequest) (*GetAPIClientResponse, error)

	// CreateAPIClient creates a new API client. Optionally, it can automatically assign a credential for the client when creating it.
	//
	// See: https://techdocs.akamai.com/iam-api/reference/post-api-clients
	CreateAPIClient(ctx context.Context, params CreateAPIClientRequest) (*CreateAPIClientResponse, error)

	// UpdateAPIClient updates an API client. If `ClientID` is not provided, it updates your API client.
	//
	// See: https://techdocs.akamai.com/iam-api/reference/put-api-clients and https://techdocs.akamai.com/iam-api/reference/put-api-clients-self
	UpdateAPIClient(ctx context.Context, params UpdateAPIClientRequest) (*UpdateAPIClientResponse, error)

	// DeleteAPIClient permanently deletes the API client, breaking any API connections with the client.
	// If `ClientID` is not provided, it deletes your API client.
	//
	// See: https://techdocs.akamai.com/iam-api/reference/delete-api-client and https://techdocs.akamai.com/iam-api/reference/delete-api-client-self
	DeleteAPIClient(ctx context.Context, params DeleteAPIClientRequest) error

	// CreateCredential creates a new credential for the API client.  If `ClientID` is not provided, it creates credential for your API client.
	//
	// See: https://techdocs.akamai.com/iam-api/reference/post-self-credentials, https://techdocs.akamai.com/iam-api/reference/post-client-credentials
	CreateCredential(context.Context, CreateCredentialRequest) (*CreateCredentialResponse, error)

	// ListCredentials lists credentials for an API client. If `ClientID` is not provided, it lists credentials for your API client.
	//
	// See: https://techdocs.akamai.com/iam-api/reference/get-self-credentials, https://techdocs.akamai.com/iam-api/reference/get-client-credentials
	ListCredentials(context.Context, ListCredentialsRequest) (ListCredentialsResponse, error)

	// GetCredential returns details about a specific credential for an API client. If `ClientID` is not provided, it gets credential for your API client.
	//
	// See: https://techdocs.akamai.com/iam-api/reference/get-self-credential, https://techdocs.akamai.com/iam-api/reference/get-client-credential
	GetCredential(context.Context, GetCredentialRequest) (*GetCredentialResponse, error)

	// UpdateCredential updates a specific credential for an API client. If `ClientID` is not provided, it updates credential for your API client.
	//
	// See: https://techdocs.akamai.com/iam-api/reference/put-self-credential, https://techdocs.akamai.com/iam-api/reference/put-client-credential
	UpdateCredential(context.Context, UpdateCredentialRequest) (*UpdateCredentialResponse, error)

	// DeleteCredential deletes a specific credential from an API client. If `ClientID` is not provided, it deletes credential for your API client.
	//
	// See: https://techdocs.akamai.com/iam-api/reference/delete-self-credential, https://techdocs.akamai.com/iam-api/reference/delete-client-credential
	DeleteCredential(context.Context, DeleteCredentialRequest) error

	// DeactivateCredential deactivates a specific credential for an API client. If `ClientID` is not provided, it deactivates credential for your API client.
	//
	// See: https://techdocs.akamai.com/iam-api/reference/post-self-credential-deactivate, https://techdocs.akamai.com/iam-api/reference/post-client-credential-deactivate
	DeactivateCredential(context.Context, DeactivateCredentialRequest) error

	// DeactivateCredentials deactivates all credentials for a specific API client. If `ClientID` is not provided, it deactivates all credentials for your API client.
	//
	// See: https://techdocs.akamai.com/iam-api/reference/post-self-credentials-deactivate, https://techdocs.akamai.com/iam-api/reference/post-client-credentials-deactivate
	DeactivateCredentials(context.Context, DeactivateCredentialsRequest) error

	// ListBlockedProperties returns all properties a user doesn't have access to in a group.
	//
	// See: https://techdocs.akamai.com/iam-api/reference/get-blocked-properties
	ListBlockedProperties(context.Context, ListBlockedPropertiesRequest) ([]int64, error)

	// UpdateBlockedProperties removes or grants user access to properties.
	//
	// See: https://techdocs.akamai.com/iam-api/reference/put-blocked-properties
	UpdateBlockedProperties(context.Context, UpdateBlockedPropertiesRequest) ([]int64, error)

	// ListCIDRBlocks lists all CIDR blocks on selected account's allowlist.
	//
	// See: https://techdocs.akamai.com/iam-api/reference/get-allowlist
	ListCIDRBlocks(context.Context, ListCIDRBlocksRequest) (ListCIDRBlocksResponse, error)

	// CreateCIDRBlock adds CIDR blocks to your account's allowlist.
	//
	// See: https://techdocs.akamai.com/iam-api/reference/post-allowlist
	CreateCIDRBlock(context.Context, CreateCIDRBlockRequest) (*CreateCIDRBlockResponse, error)

	// GetCIDRBlock retrieves a CIDR block's details.
	//
	// See: https://techdocs.akamai.com/iam-api/reference/get-allowlist-cidrblockid
	GetCIDRBlock(context.Context, GetCIDRBlockRequest) (*GetCIDRBlockResponse, error)

	// UpdateCIDRBlock modifies an existing CIDR block.
	//
	// See: https://techdocs.akamai.com/iam-api/reference/put-allowlist-cidrblockid
	UpdateCIDRBlock(context.Context, UpdateCIDRBlockRequest) (*UpdateCIDRBlockResponse, error)

	// DeleteCIDRBlock deletes an existing CIDR block from the IP allowlist.
	//
	// See: https://techdocs.akamai.com/iam-api/reference/delete-allowlist-cidrblockid
	DeleteCIDRBlock(context.Context, DeleteCIDRBlockRequest) error

	// ValidateCIDRBlock checks the format of CIDR block.
	//
	// See: https://techdocs.akamai.com/iam-api/reference/get-allowlist-validate
	ValidateCIDRBlock(context.Context, ValidateCIDRBlockRequest) error

	// CreateGroup creates a new group within a parent group_id specified in the request.
	//
	// See: https://techdocs.akamai.com/iam-api/reference/post-group
	CreateGroup(context.Context, GroupRequest) (*Group, error)

	// GetGroup returns a group's details.
	//
	// See: https://techdocs.akamai.com/iam-api/reference/get-group
	GetGroup(context.Context, GetGroupRequest) (*Group, error)

	// ListAffectedUsers lists users who are affected when a group is moved.
	//
	// See: https://techdocs.akamai.com/iam-api/reference/get-move-affected-users
	ListAffectedUsers(context.Context, ListAffectedUsersRequest) ([]GroupUser, error)

	// ListGroups lists all groups in which you have a scope of admin for the current account and contract type.
	//
	// See: https://techdocs.akamai.com/iam-api/reference/get-groups
	ListGroups(context.Context, ListGroupsRequest) ([]Group, error)

	// RemoveGroup removes a group based on group_id. We can only delete a sub-group, and only if that sub-group doesn't include any users.
	//
	// See: https://techdocs.akamai.com/iam-api/reference/delete-group
	RemoveGroup(context.Context, RemoveGroupRequest) error

	// UpdateGroupName changes the name of the group.
	//
	// See: https://techdocs.akamai.com/iam-api/reference/put-group
	UpdateGroupName(context.Context, GroupRequest) (*Group, error)

	// MoveGroup moves a nested group under another group within the same parent hierarchy.
	//
	// See: https://techdocs.akamai.com/iam-api/reference/post-groups-move
	MoveGroup(context.Context, MoveGroupRequest) error

	// ListAllowedCPCodes lists available CP codes for a user.
	//
	// See: https://techdocs.akamai.com/iam-api/reference/post-api-clients-users-allowed-cpcodes
	ListAllowedCPCodes(context.Context, ListAllowedCPCodesRequest) (ListAllowedCPCodesResponse, error)

	// ListAuthorizedUsers lists authorized API client users.
	//
	// See: https://techdocs.akamai.com/iam-api/reference/get-api-clients-users
	ListAuthorizedUsers(context.Context) (ListAuthorizedUsersResponse, error)

	// ListAllowedAPIs lists available APIs for a user.
	//
	// See: https://techdocs.akamai.com/iam-api/reference/get-api-clients-users-allowed-apis
	ListAllowedAPIs(context.Context, ListAllowedAPIsRequest) (ListAllowedAPIsResponse, error)

	// ListAccessibleGroups lists groups available to a user.
	//
	// See: https://techdocs.akamai.com/iam-api/reference/get-api-clients-users-group-access
	ListAccessibleGroups(context.Context, ListAccessibleGroupsRequest) (ListAccessibleGroupsResponse, error)

	// DisableIPAllowlist disables IP allowlist on your account. After you disable IP allowlist,
	// users can access Control Center regardless of their IP address or who assigns it.
	//
	// See: https://techdocs.akamai.com/iam-api/reference/post-allowlist-disable
	DisableIPAllowlist(context.Context) error

	// EnableIPAllowlist enables IP allowlist on your account. Before you enable IP allowlist,
	// add at least one IP address to allow access to Control Center.
	// The allowlist can't be empty with IP allowlist enabled.
	//
	// See: https://techdocs.akamai.com/iam-api/reference/post-allowlist-enable
	EnableIPAllowlist(context.Context) error

	// GetIPAllowlistStatus indicates whether IP allowlist is enabled or disabled on your account.
	//
	// See: https://techdocs.akamai.com/iam-api/reference/get-allowlist-status
	GetIPAllowlistStatus(context.Context) (*GetIPAllowlistStatusResponse, error)

	// ListProperties lists the properties for the current account or other managed accounts using the accountSwitchKey parameter.
	//
	// See: https://techdocs.akamai.com/iam-api/reference/get-properties
	ListProperties(context.Context, ListPropertiesRequest) (ListPropertiesResponse, error)

	// ListUsersForProperty lists users who can access a property.
	//
	// See: https://techdocs.akamai.com/iam-api/reference/get-property-users
	ListUsersForProperty(context.Context, ListUsersForPropertyRequest) (ListUsersForPropertyResponse, error)

	// GetProperty lists a property's details.
	//
	// See: https://techdocs.akamai.com/iam-api/reference/get-property
	GetProperty(context.Context, GetPropertyRequest) (*GetPropertyResponse, error)

	// MoveProperty moves a property from one group to another group.
	//
	// See: https://techdocs.akamai.com/iam-api/reference/put-property
	MoveProperty(context.Context, MovePropertyRequest) error

	// MapPropertyIDToName returns property name for given (IAM) property ID
	// Mainly to be used to map (IAM) Property ID to (PAPI) Property ID
	// To finish the mapping, please use papi.MapPropertyNameToID
	MapPropertyIDToName(context.Context, MapPropertyIDToNameRequest) (*string, error)

	// BlockUsers blocks the users on a property.
	//
	// See: https://techdocs.akamai.com/iam-api/reference/put-property-users-block
	BlockUsers(context.Context, BlockUsersRequest) (*BlockUsersResponse, error)

	// CreateRole creates a custom role.
	//
	// See: https://techdocs.akamai.com/iam-api/reference/post-role
	CreateRole(context.Context, CreateRoleRequest) (*Role, error)

	// GetRole gets details for a specific role.
	//
	// See: https://techdocs.akamai.com/iam-api/reference/get-role
	GetRole(context.Context, GetRoleRequest) (*Role, error)

	// UpdateRole adds or removes permissions from a role and updates other parameters.
	//
	// See: https://techdocs.akamai.com/iam-api/reference/put-role
	UpdateRole(context.Context, UpdateRoleRequest) (*Role, error)

	// DeleteRole deletes a role. This operation is only allowed if the role isn't assigned to any users.
	//
	// See: https://techdocs.akamai.com/iam-api/reference/delete-role
	DeleteRole(context.Context, DeleteRoleRequest) error

	// ListRoles lists roles for the current account and contract type.
	//
	// See: https://techdocs.akamai.com/iam-api/reference/get-roles
	ListRoles(context.Context, ListRolesRequest) ([]Role, error)

	// ListGrantableRoles lists which grantable roles can be included in a new custom role or added to an existing custom role.
	//
	// See: https://techdocs.akamai.com/iam-api/reference/get-grantable-roles
	ListGrantableRoles(context.Context) ([]RoleGrantedRole, error)

	// GetPasswordPolicy gets the password policy for the account.
	//
	// See: https://techdocs.akamai.com/iam-api/reference/get-common-password-policy
	GetPasswordPolicy(ctx context.Context) (*GetPasswordPolicyResponse, error)

	// ListProducts lists products a user can subscribe to and receive notifications for on the account.
	//
	// See: https://techdocs.akamai.com/iam-api/reference/get-common-notification-products
	ListProducts(context.Context) ([]string, error)

	// ListStates lists U.S. states or Canadian provinces.
	//
	// See: https://techdocs.akamai.com/iam-api/reference/get-common-states
	ListStates(context.Context, ListStatesRequest) ([]string, error)

	// ListTimeoutPolicies lists all the possible session timeout policies.
	//
	// See: https://techdocs.akamai.com/iam-api/reference/get-common-timeout-policies
	ListTimeoutPolicies(context.Context) ([]TimeoutPolicy, error)

	// ListAccountSwitchKeys lists account switch keys available for a specific API client. If `ClientID` is not provided, it lists account switch keys available for your API client.
	//
	// See: https://techdocs.akamai.com/iam-api/reference/get-client-account-switch-keys, https://techdocs.akamai.com/iam-api/reference/get-self-account-switch-keys
	ListAccountSwitchKeys(context.Context, ListAccountSwitchKeysRequest) (ListAccountSwitchKeysResponse, error)

	// SupportedContactTypes lists supported contact types.
	//
	// See: https://techdocs.akamai.com/iam-api/reference/get-common-contact-types
	SupportedContactTypes(context.Context) ([]string, error)

	// SupportedCountries lists supported countries.
	//
	// See: https://techdocs.akamai.com/iam-api/reference/get-common-countries
	SupportedCountries(context.Context) ([]string, error)

	// SupportedLanguages lists supported languages.
	//
	// See: https://techdocs.akamai.com/iam-api/reference/get-common-languages
	SupportedLanguages(context.Context) ([]string, error)

	// SupportedTimezones lists supported timezones.
	//
	// See: https://techdocs.akamai.com/iam-api/reference/get-common-timezones
	SupportedTimezones(context.Context) ([]Timezone, error)

	// LockUser locks the user.
	//
	// See: https://techdocs.akamai.com/iam-api/reference/post-ui-identity-lock
	LockUser(context.Context, LockUserRequest) error

	// UnlockUser releases the lock on a user's account.
	//
	// See: https://techdocs.akamai.com/iam-api/reference/post-ui-identity-unlock
	UnlockUser(context.Context, UnlockUserRequest) error

	// ResetUserPassword optionally sends a one-time use password to the user.
	// If you send the email with the password directly to the user, the response for this operation doesn't include that password.
	// If you don't send the password to the user through email, the password is included in the response.
	//
	// See: https://techdocs.akamai.com/iam-api/reference/post-reset-password
	ResetUserPassword(context.Context, ResetUserPasswordRequest) (*ResetUserPasswordResponse, error)

	// SetUserPassword sets a specific password for a user.
	//
	// See: https://techdocs.akamai.com/iam-api/reference/post-set-password
	SetUserPassword(context.Context, SetUserPasswordRequest) error

	// CreateUser creates a user in the account specified in your own API client credentials or clone an existing user's role assignments.
	//
	// See: https://techdocs.akamai.com/iam-user-admin/reference/post-ui-identity
	CreateUser(context.Context, CreateUserRequest) (*User, error)

	// GetUser gets  a specific user's profile.
	//
	// See: https://techdocs.akamai.com/iam-user-admin/reference/get-ui-identity
	GetUser(context.Context, GetUserRequest) (*User, error)

	// ListUsers returns a list of users who have access on this account.
	//
	// See: https://techdocs.akamai.com/iam-api/reference/get-ui-identities
	ListUsers(context.Context, ListUsersRequest) ([]UserListItem, error)

	// RemoveUser removes a user identity.
	//
	// See: https://techdocs.akamai.com/iam-api/reference/delete-ui-identity
	RemoveUser(context.Context, RemoveUserRequest) error

	// UpdateUserAuthGrants edits what groups a user has access to, and how the user can interact with the objects in those groups.
	//
	// See: https://techdocs.akamai.com/iam-api/reference/put-ui-uiidentity-auth-grants
	UpdateUserAuthGrants(context.Context, UpdateUserAuthGrantsRequest) ([]AuthGrant, error)

	// UpdateUserInfo updates a user's information.
	//
	// See: https://techdocs.akamai.com/iam-api/reference/put-ui-identity-basic-info
	UpdateUserInfo(context.Context, UpdateUserInfoRequest) (*UserBasicInfo, error)

	// UpdateUserNotifications subscribes or un-subscribes user to product notification emails.
	//
	// See: https://techdocs.akamai.com/iam-api/reference/put-notifications
	UpdateUserNotifications(context.Context, UpdateUserNotificationsRequest) (*UserNotifications, error)

	// UpdateTFA updates a user's two-factor authentication setting and can reset tfa.
	//
	// See: https://techdocs.akamai.com/iam-user-admin/reference/put-ui-identity-tfa
	/** @deprecated */
	UpdateTFA(context.Context, UpdateTFARequest) error

	// UpdateMFA updates a user's profile authentication method.
	//
	// See: https://techdocs.akamai.com/iam-api/reference/put-user-profile-additional-authentication
	UpdateMFA(context.Context, UpdateMFARequest) error

	// ResetMFA resets a user's profile authentication method.
	//
	// See: https://techdocs.akamai.com/iam-api/reference/put-ui-identity-reset-additional-authentication
	ResetMFA(context.Context, ResetMFARequest) error
}

IAM is the IAM api interface

func Client

func Client(sess session.Session, opts ...Option) IAM

Client returns a new IAM Client instance with the specified controller.

type IPACL

type IPACL struct {
	CIDR   []string `json:"cidr"`
	Enable bool     `json:"enable"`
}

IPACL specifies the API client's IP list restriction.

type ListAPIClientsActions

type ListAPIClientsActions struct {
	Delete        bool `json:"delete"`
	DeactivateAll bool `json:"deactivateAll"`
	Edit          bool `json:"edit"`
	Lock          bool `json:"lock"`
	Transfer      bool `json:"transfer"`
	Unlock        bool `json:"unlock"`
}

ListAPIClientsActions specifies activities available for the API client.

type ListAPIClientsItem

type ListAPIClientsItem struct {
	AccessToken             string                 `json:"accessToken"`
	Actions                 *ListAPIClientsActions `json:"actions"`
	ActiveCredentialCount   int64                  `json:"activeCredentialCount"`
	AllowAccountSwitch      bool                   `json:"allowAccountSwitch"`
	AuthorizedUsers         []string               `json:"authorizedUsers"`
	CanAutoCreateCredential bool                   `json:"canAutoCreateCredential"`
	ClientDescription       string                 `json:"clientDescription"`
	ClientID                string                 `json:"clientId"`
	ClientName              string                 `json:"clientName"`
	ClientType              ClientType             `json:"clientType"`
	CreatedBy               string                 `json:"createdBy"`
	CreatedDate             time.Time              `json:"createdDate"`
	IsLocked                bool                   `json:"isLocked"`
	NotificationEmails      []string               `json:"notificationEmails"`
	ServiceConsumerToken    string                 `json:"serviceConsumerToken"`
}

ListAPIClientsItem represents information returned by the ListAPIClients endpoint for a single API client.

type ListAPIClientsRequest

type ListAPIClientsRequest struct {
	Actions bool
}

ListAPIClientsRequest contains the request parameters for the ListAPIClients endpoint.

type ListAPIClientsResponse

type ListAPIClientsResponse []ListAPIClientsItem

ListAPIClientsResponse describes the response of the ListAPIClients endpoint.

type ListAccessibleGroupsRequest

type ListAccessibleGroupsRequest struct {
	UserName string
}

ListAccessibleGroupsRequest contains the request parameter for the ListAccessibleGroups endpoint.

func (ListAccessibleGroupsRequest) Validate

func (r ListAccessibleGroupsRequest) Validate() error

Validate validates ListAccessibleGroupsRequest.

type ListAccessibleGroupsResponse

type ListAccessibleGroupsResponse []AccessibleGroup

ListAccessibleGroupsResponse contains the response from the ListAccessibleGroups endpoint.

type ListAccountSwitchKeysRequest

type ListAccountSwitchKeysRequest struct {
	ClientID string
	Search   string
}

ListAccountSwitchKeysRequest contains the request parameters for the ListAccountSwitchKeys endpoint.

type ListAccountSwitchKeysResponse

type ListAccountSwitchKeysResponse []AccountSwitchKey

ListAccountSwitchKeysResponse holds the response data from the ListAccountSwitchKeys endpoint.

type ListAffectedUsersRequest

type ListAffectedUsersRequest struct {
	DestinationGroupID int64
	SourceGroupID      int64
	UserType           string
}

ListAffectedUsersRequest describes the request and body parameters of the ListAffectedUsers endpoint.

func (ListAffectedUsersRequest) Validate

func (r ListAffectedUsersRequest) Validate() error

Validate validates ListAffectedUsersRequest.

type ListAllowedAPIsRequest

type ListAllowedAPIsRequest struct {
	UserName           string
	ClientType         ClientType
	AllowAccountSwitch bool
}

ListAllowedAPIsRequest contains the request parameters for the ListAllowedAPIs endpoint.

func (ListAllowedAPIsRequest) Validate

func (r ListAllowedAPIsRequest) Validate() error

Validate validates ListAllowedAPIsRequest.

type ListAllowedAPIsResponse

type ListAllowedAPIsResponse []AllowedAPI

ListAllowedAPIsResponse contains the response from the ListAllowedAPIs endpoint.

type ListAllowedCPCodesRequest

type ListAllowedCPCodesRequest struct {
	UserName string
	Body     ListAllowedCPCodesRequestBody
}

ListAllowedCPCodesRequest contains the request parameters for the ListAllowedCPCodes endpoint.

func (ListAllowedCPCodesRequest) Validate

func (r ListAllowedCPCodesRequest) Validate() error

Validate validates ListAllowedCPCodesRequest.

type ListAllowedCPCodesRequestBody

type ListAllowedCPCodesRequestBody struct {
	ClientType ClientType            `json:"clientType"`
	Groups     []AllowedCPCodesGroup `json:"groups"`
}

ListAllowedCPCodesRequestBody contains the filtering parameters for the ListAllowedCPCodes endpoint.

func (ListAllowedCPCodesRequestBody) Validate

func (r ListAllowedCPCodesRequestBody) Validate() error

Validate validates ListAllowedCPCodesRequestBody.

type ListAllowedCPCodesResponse

type ListAllowedCPCodesResponse []ListAllowedCPCodesResponseItem

ListAllowedCPCodesResponse contains response for the ListAllowedCPCodes endpoint.

type ListAllowedCPCodesResponseItem

type ListAllowedCPCodesResponseItem struct {
	Name  string `json:"name"`
	Value int    `json:"value"`
}

ListAllowedCPCodesResponseItem contains single item of the response from the ListAllowedCPCodes endpoint.

type ListAuthorizedUsersResponse

type ListAuthorizedUsersResponse []AuthorizedUser

ListAuthorizedUsersResponse contains the response from the ListAuthorizedUsers endpoint.

type ListBlockedPropertiesRequest

type ListBlockedPropertiesRequest struct {
	IdentityID string
	GroupID    int64
}

ListBlockedPropertiesRequest contains the request parameters for the ListBlockedProperties endpoint.

func (ListBlockedPropertiesRequest) Validate

func (r ListBlockedPropertiesRequest) Validate() error

Validate validates ListBlockedPropertiesRequest.

type ListCIDRBlocksRequest

type ListCIDRBlocksRequest struct {
	Actions bool
}

ListCIDRBlocksRequest contains the request parameters for the ListCIDRBlocks endpoint.

type ListCIDRBlocksResponse

type ListCIDRBlocksResponse []CIDRBlock

ListCIDRBlocksResponse describes the response from the ListCIDRBlocks endpoint.

type ListCredentialsRequest

type ListCredentialsRequest struct {
	ClientID string
	Actions  bool
}

ListCredentialsRequest contains request parameters for the ListCredentials endpoint.

type ListCredentialsResponse

type ListCredentialsResponse []Credential

ListCredentialsResponse holds response from the ListCredentials endpoint.

type ListGroupsRequest

type ListGroupsRequest struct {
	Actions bool
}

ListGroupsRequest describes the request parameters of the ListGroups endpoint.

type ListPropertiesRequest

type ListPropertiesRequest struct {
	GroupID int64
	Actions bool
}

ListPropertiesRequest contains the request parameters for the ListProperties endpoint.

type ListPropertiesResponse

type ListPropertiesResponse []Property

ListPropertiesResponse holds the response data from the ListProperties endpoint.

type ListRolesRequest

type ListRolesRequest struct {
	GroupID       *int64
	Actions       bool
	IgnoreContext bool
	Users         bool
}

ListRolesRequest describes the request parameters for the ListRoles endpoint.

type ListStatesRequest

type ListStatesRequest struct {
	Country string
}

ListStatesRequest contains the country request parameter for the ListStates endpoint.

func (ListStatesRequest) Validate

func (r ListStatesRequest) Validate() error

Validate validates ListStatesRequest.

type ListUsersForPropertyRequest

type ListUsersForPropertyRequest struct {
	PropertyID int64
	UserType   PropertyUserType
}

ListUsersForPropertyRequest contains the request parameters for the ListUsersForProperty endpoint.

func (ListUsersForPropertyRequest) Validate

func (r ListUsersForPropertyRequest) Validate() error

Validate validates ListUsersForPropertyRequest.

type ListUsersForPropertyResponse

type ListUsersForPropertyResponse []UsersForProperty

ListUsersForPropertyResponse holds the response data from the ListUsersForProperty endpoint.

type ListUsersRequest

type ListUsersRequest struct {
	GroupID    *int64
	AuthGrants bool
	Actions    bool
}

ListUsersRequest contains the request parameters for the ListUsers endpoint.

type LockAPIClientRequest

type LockAPIClientRequest struct {
	ClientID string
}

LockAPIClientRequest contains the request parameters for the LockAPIClient endpoint.

type LockAPIClientResponse

type LockAPIClientResponse APIClient

LockAPIClientResponse holds the response data from LockAPIClient.

type LockUserRequest

type LockUserRequest struct {
	IdentityID string
}

LockUserRequest contains the request parameters for the LockUser endpoint.

func (LockUserRequest) Validate

func (r LockUserRequest) Validate() error

Validate validates LockUserRequest.

type MapPropertyIDToNameRequest

type MapPropertyIDToNameRequest struct {
	PropertyID int64
	GroupID    int64
}

MapPropertyIDToNameRequest is the argument for MapPropertyIDToName.

func (MapPropertyIDToNameRequest) Validate

func (r MapPropertyIDToNameRequest) Validate() error

Validate validates MapPropertyIDToNameRequest.

type MapPropertyNameToIDRequest

type MapPropertyNameToIDRequest string

MapPropertyNameToIDRequest is the argument for MapPropertyNameToID.

type Mock

type Mock struct {
	mock.Mock
}

func (*Mock) BlockUsers

func (m *Mock) BlockUsers(ctx context.Context, request BlockUsersRequest) (*BlockUsersResponse, error)

func (*Mock) CreateAPIClient

func (m *Mock) CreateAPIClient(ctx context.Context, request CreateAPIClientRequest) (*CreateAPIClientResponse, error)

func (*Mock) CreateCIDRBlock

func (m *Mock) CreateCIDRBlock(ctx context.Context, request CreateCIDRBlockRequest) (*CreateCIDRBlockResponse, error)

func (*Mock) CreateCredential

func (m *Mock) CreateCredential(ctx context.Context, request CreateCredentialRequest) (*CreateCredentialResponse, error)

func (*Mock) CreateGroup

func (m *Mock) CreateGroup(ctx context.Context, request GroupRequest) (*Group, error)

func (*Mock) CreateRole

func (m *Mock) CreateRole(ctx context.Context, request CreateRoleRequest) (*Role, error)

func (*Mock) CreateUser

func (m *Mock) CreateUser(ctx context.Context, request CreateUserRequest) (*User, error)

func (*Mock) DeactivateCredential

func (m *Mock) DeactivateCredential(ctx context.Context, request DeactivateCredentialRequest) error

func (*Mock) DeactivateCredentials

func (m *Mock) DeactivateCredentials(ctx context.Context, request DeactivateCredentialsRequest) error

func (*Mock) DeleteAPIClient

func (m *Mock) DeleteAPIClient(ctx context.Context, request DeleteAPIClientRequest) error

func (*Mock) DeleteCIDRBlock

func (m *Mock) DeleteCIDRBlock(ctx context.Context, request DeleteCIDRBlockRequest) error

func (*Mock) DeleteCredential

func (m *Mock) DeleteCredential(ctx context.Context, request DeleteCredentialRequest) error

func (*Mock) DeleteRole

func (m *Mock) DeleteRole(ctx context.Context, request DeleteRoleRequest) error

func (*Mock) DisableIPAllowlist

func (m *Mock) DisableIPAllowlist(ctx context.Context) error

func (*Mock) EnableIPAllowlist

func (m *Mock) EnableIPAllowlist(ctx context.Context) error

func (*Mock) GetAPIClient

func (m *Mock) GetAPIClient(ctx context.Context, request GetAPIClientRequest) (*GetAPIClientResponse, error)

func (*Mock) GetCIDRBlock

func (m *Mock) GetCIDRBlock(ctx context.Context, request GetCIDRBlockRequest) (*GetCIDRBlockResponse, error)

func (*Mock) GetCredential

func (m *Mock) GetCredential(ctx context.Context, request GetCredentialRequest) (*GetCredentialResponse, error)

func (*Mock) GetGroup

func (m *Mock) GetGroup(ctx context.Context, request GetGroupRequest) (*Group, error)

func (*Mock) GetIPAllowlistStatus

func (m *Mock) GetIPAllowlistStatus(ctx context.Context) (*GetIPAllowlistStatusResponse, error)

func (*Mock) GetPasswordPolicy

func (m *Mock) GetPasswordPolicy(ctx context.Context) (*GetPasswordPolicyResponse, error)

func (*Mock) GetProperty

func (m *Mock) GetProperty(ctx context.Context, request GetPropertyRequest) (*GetPropertyResponse, error)

func (*Mock) GetRole

func (m *Mock) GetRole(ctx context.Context, request GetRoleRequest) (*Role, error)

func (*Mock) GetUser

func (m *Mock) GetUser(ctx context.Context, request GetUserRequest) (*User, error)

func (*Mock) ListAPIClients

func (m *Mock) ListAPIClients(ctx context.Context, request ListAPIClientsRequest) (ListAPIClientsResponse, error)

func (*Mock) ListAccessibleGroups

func (m *Mock) ListAccessibleGroups(ctx context.Context, request ListAccessibleGroupsRequest) (ListAccessibleGroupsResponse, error)

func (*Mock) ListAccountSwitchKeys

func (m *Mock) ListAccountSwitchKeys(ctx context.Context, request ListAccountSwitchKeysRequest) (ListAccountSwitchKeysResponse, error)

func (*Mock) ListAffectedUsers

func (m *Mock) ListAffectedUsers(ctx context.Context, request ListAffectedUsersRequest) ([]GroupUser, error)

func (*Mock) ListAllowedAPIs

func (m *Mock) ListAllowedAPIs(ctx context.Context, request ListAllowedAPIsRequest) (ListAllowedAPIsResponse, error)

func (*Mock) ListAllowedCPCodes

func (m *Mock) ListAllowedCPCodes(ctx context.Context, params ListAllowedCPCodesRequest) (ListAllowedCPCodesResponse, error)

func (*Mock) ListAuthorizedUsers

func (m *Mock) ListAuthorizedUsers(ctx context.Context) (ListAuthorizedUsersResponse, error)

func (*Mock) ListBlockedProperties

func (m *Mock) ListBlockedProperties(ctx context.Context, request ListBlockedPropertiesRequest) ([]int64, error)

func (*Mock) ListCIDRBlocks

func (m *Mock) ListCIDRBlocks(ctx context.Context, request ListCIDRBlocksRequest) (ListCIDRBlocksResponse, error)

func (*Mock) ListCredentials

func (m *Mock) ListCredentials(ctx context.Context, request ListCredentialsRequest) (ListCredentialsResponse, error)

func (*Mock) ListGrantableRoles

func (m *Mock) ListGrantableRoles(ctx context.Context) ([]RoleGrantedRole, error)

func (*Mock) ListGroups

func (m *Mock) ListGroups(ctx context.Context, request ListGroupsRequest) ([]Group, error)

func (*Mock) ListProducts

func (m *Mock) ListProducts(ctx context.Context) ([]string, error)

func (*Mock) ListProperties

func (m *Mock) ListProperties(ctx context.Context, request ListPropertiesRequest) (ListPropertiesResponse, error)

func (*Mock) ListRoles

func (m *Mock) ListRoles(ctx context.Context, request ListRolesRequest) ([]Role, error)

func (*Mock) ListStates

func (m *Mock) ListStates(ctx context.Context, request ListStatesRequest) ([]string, error)

func (*Mock) ListTimeoutPolicies

func (m *Mock) ListTimeoutPolicies(ctx context.Context) ([]TimeoutPolicy, error)

func (*Mock) ListUsers

func (m *Mock) ListUsers(ctx context.Context, request ListUsersRequest) ([]UserListItem, error)

func (*Mock) ListUsersForProperty

func (m *Mock) ListUsersForProperty(ctx context.Context, request ListUsersForPropertyRequest) (ListUsersForPropertyResponse, error)

func (*Mock) LockAPIClient

func (m *Mock) LockAPIClient(ctx context.Context, request LockAPIClientRequest) (*LockAPIClientResponse, error)

func (*Mock) LockUser

func (m *Mock) LockUser(ctx context.Context, request LockUserRequest) error

func (*Mock) MapPropertyIDToName

func (m *Mock) MapPropertyIDToName(ctx context.Context, request MapPropertyIDToNameRequest) (*string, error)

func (*Mock) MapPropertyNameToID

func (m *Mock) MapPropertyNameToID(ctx context.Context, request MapPropertyNameToIDRequest) (*int64, error)

func (*Mock) MoveGroup

func (m *Mock) MoveGroup(ctx context.Context, request MoveGroupRequest) error

func (*Mock) MoveProperty

func (m *Mock) MoveProperty(ctx context.Context, request MovePropertyRequest) error

func (*Mock) RemoveGroup

func (m *Mock) RemoveGroup(ctx context.Context, request RemoveGroupRequest) error

func (*Mock) RemoveUser

func (m *Mock) RemoveUser(ctx context.Context, request RemoveUserRequest) error

func (*Mock) ResetMFA

func (m *Mock) ResetMFA(ctx context.Context, request ResetMFARequest) error

func (*Mock) ResetUserPassword

func (m *Mock) ResetUserPassword(ctx context.Context, request ResetUserPasswordRequest) (*ResetUserPasswordResponse, error)

func (*Mock) SetUserPassword

func (m *Mock) SetUserPassword(ctx context.Context, request SetUserPasswordRequest) error

func (*Mock) SupportedContactTypes

func (m *Mock) SupportedContactTypes(ctx context.Context) ([]string, error)

func (*Mock) SupportedCountries

func (m *Mock) SupportedCountries(ctx context.Context) ([]string, error)

func (*Mock) SupportedLanguages

func (m *Mock) SupportedLanguages(ctx context.Context) ([]string, error)

func (*Mock) SupportedTimezones

func (m *Mock) SupportedTimezones(ctx context.Context) ([]Timezone, error)

func (*Mock) UnlockAPIClient

func (m *Mock) UnlockAPIClient(ctx context.Context, request UnlockAPIClientRequest) (*UnlockAPIClientResponse, error)

func (*Mock) UnlockUser

func (m *Mock) UnlockUser(ctx context.Context, request UnlockUserRequest) error

func (*Mock) UpdateAPIClient

func (m *Mock) UpdateAPIClient(ctx context.Context, request UpdateAPIClientRequest) (*UpdateAPIClientResponse, error)

func (*Mock) UpdateBlockedProperties

func (m *Mock) UpdateBlockedProperties(ctx context.Context, request UpdateBlockedPropertiesRequest) ([]int64, error)

func (*Mock) UpdateCIDRBlock

func (m *Mock) UpdateCIDRBlock(ctx context.Context, request UpdateCIDRBlockRequest) (*UpdateCIDRBlockResponse, error)

func (*Mock) UpdateCredential

func (m *Mock) UpdateCredential(ctx context.Context, request UpdateCredentialRequest) (*UpdateCredentialResponse, error)

func (*Mock) UpdateGroupName

func (m *Mock) UpdateGroupName(ctx context.Context, request GroupRequest) (*Group, error)

func (*Mock) UpdateMFA

func (m *Mock) UpdateMFA(ctx context.Context, request UpdateMFARequest) error

func (*Mock) UpdateRole

func (m *Mock) UpdateRole(ctx context.Context, request UpdateRoleRequest) (*Role, error)

func (*Mock) UpdateTFA

func (m *Mock) UpdateTFA(ctx context.Context, request UpdateTFARequest) error

func (*Mock) UpdateUserAuthGrants

func (m *Mock) UpdateUserAuthGrants(ctx context.Context, request UpdateUserAuthGrantsRequest) ([]AuthGrant, error)

func (*Mock) UpdateUserInfo

func (m *Mock) UpdateUserInfo(ctx context.Context, request UpdateUserInfoRequest) (*UserBasicInfo, error)

func (*Mock) UpdateUserNotifications

func (m *Mock) UpdateUserNotifications(ctx context.Context, request UpdateUserNotificationsRequest) (*UserNotifications, error)

func (*Mock) ValidateCIDRBlock

func (m *Mock) ValidateCIDRBlock(ctx context.Context, request ValidateCIDRBlockRequest) error

type MoveGroupRequest

type MoveGroupRequest struct {
	SourceGroupID      int64 `json:"sourceGroupId"`
	DestinationGroupID int64 `json:"destinationGroupId"`
}

MoveGroupRequest describes the request body for the MoveGroup endpoint.

func (MoveGroupRequest) Validate

func (r MoveGroupRequest) Validate() error

Validate validates MoveGroupRequest.

type MovePropertyRequest

type MovePropertyRequest struct {
	PropertyID int64
	Body       MovePropertyRequestBody
}

MovePropertyRequest contains the request parameters for the MoveProperty endpoint.

func (MovePropertyRequest) Validate

func (r MovePropertyRequest) Validate() error

Validate validates MovePropertyRequest.

type MovePropertyRequestBody

type MovePropertyRequestBody struct {
	DestinationGroupID int64 `json:"destinationGroupId"`
	SourceGroupID      int64 `json:"sourceGroupId"`
}

MovePropertyRequestBody contains body parameters for the MoveProperty endpoint.

func (MovePropertyRequestBody) Validate

func (r MovePropertyRequestBody) Validate() error

Validate validates MovePropertyRequestBody.

type Option

type Option func(*iam)

Option defines a IAM option.

type Property

type Property struct {
	PropertyID              int64           `json:"propertyId"`
	PropertyName            string          `json:"propertyName"`
	PropertyTypeDescription string          `json:"propertyTypeDescription"`
	GroupID                 int64           `json:"groupId"`
	GroupName               string          `json:"groupName"`
	Actions                 PropertyActions `json:"actions"`
}

Property holds the property details.

type PropertyActions

type PropertyActions struct {
	Move bool `json:"move"`
}

PropertyActions specifies activities available for the property.

type PropertyUserType

type PropertyUserType string

PropertyUserType filters property users based on their access to the property.

const (
	// PropertyUserTypeAll selects all property users.
	PropertyUserTypeAll PropertyUserType = "all"
	// PropertyUserTypeAssigned selects users that have access to the property.
	PropertyUserTypeAssigned PropertyUserType = "assigned"
	// PropertyUserTypeBlocked selects users whose access to the property is blocked.
	PropertyUserTypeBlocked PropertyUserType = "blocked"
)

func (PropertyUserType) Validate

func (p PropertyUserType) Validate() error

Validate validates PropertyUserType.

type PurgeOptions

type PurgeOptions struct {
	CanPurgeByCacheTag bool         `json:"canPurgeByCacheTag"`
	CanPurgeByCPCode   bool         `json:"canPurgeByCpcode"`
	CPCodeAccess       CPCodeAccess `json:"cpcodeAccess"`
}

PurgeOptions specifies the API clients configuration for access to the Fast Purge API.

func (PurgeOptions) Validate

func (po PurgeOptions) Validate() error

Validate validates PurgeOptions.

type RemoveGroupRequest

type RemoveGroupRequest struct {
	GroupID int64
}

RemoveGroupRequest describes the request parameter for the RemoveGroup endpoint.

func (RemoveGroupRequest) Validate

func (r RemoveGroupRequest) Validate() error

Validate validates RemoveGroupRequest.

type RemoveUserRequest

type RemoveUserRequest struct {
	IdentityID string
}

RemoveUserRequest contains the request parameters of the RemoveUser endpoint.

func (RemoveUserRequest) Validate

func (r RemoveUserRequest) Validate() error

Validate validates RemoveUserRequest.

type ResetMFARequest

type ResetMFARequest struct {
	IdentityID string
}

ResetMFARequest contains the request parameters for the ResetMFA endpoint.

type ResetUserPasswordRequest

type ResetUserPasswordRequest struct {
	IdentityID string
	SendEmail  bool
}

ResetUserPasswordRequest contains the request parameters for the ResetUserPassword endpoint.

func (ResetUserPasswordRequest) Validate

func (r ResetUserPasswordRequest) Validate() error

Validate validates ResetUserPasswordRequest.

type ResetUserPasswordResponse

type ResetUserPasswordResponse struct {
	NewPassword string `json:"newPassword"`
}

ResetUserPasswordResponse contains the response from the ResetUserPassword endpoint.

type Role

type Role struct {
	Actions         *RoleAction       `json:"actions,omitempty"`
	CreatedBy       string            `json:"createdBy"`
	CreatedDate     time.Time         `json:"createdDate"`
	GrantedRoles    []RoleGrantedRole `json:"grantedRoles,omitempty"`
	ModifiedBy      string            `json:"modifiedBy"`
	ModifiedDate    time.Time         `json:"modifiedDate"`
	RoleDescription string            `json:"roleDescription"`
	RoleID          int64             `json:"roleId"`
	RoleName        string            `json:"roleName"`
	Users           []RoleUser        `json:"users,omitempty"`
	RoleType        RoleType          `json:"type"`
}

Role encapsulates the response from the ListRoles endpoint.

type RoleAction

type RoleAction struct {
	Delete bool `json:"delete"`
	Edit   bool `json:"edit"`
}

RoleAction encapsulates permissions available to the user for this role.

type RoleGrantedRole

type RoleGrantedRole struct {
	Description string `json:"grantedRoleDescription,omitempty"`
	RoleID      int64  `json:"grantedRoleId"`
	RoleName    string `json:"grantedRoleName"`
}

RoleGrantedRole is a list of granted roles, giving the user access to objects in a group.

type RoleRequest

type RoleRequest struct {
	Name         string          `json:"roleName,omitempty"`
	Description  string          `json:"roleDescription,omitempty"`
	GrantedRoles []GrantedRoleID `json:"grantedRoles,omitempty"`
}

RoleRequest describes request parameters for the CreateRole and UpdateRole endpoints.

type RoleType

type RoleType string

RoleType is an enum of role types.

var (
	// RoleTypeStandard is a standard type provided by Akamai.
	RoleTypeStandard RoleType = "standard"

	// RoleTypeCustom is a custom role provided by the account.
	RoleTypeCustom RoleType = "custom"
)

type RoleUser

type RoleUser struct {
	AccountID     string    `json:"accountId"`
	Email         string    `json:"email"`
	FirstName     string    `json:"firstName"`
	LastLoginDate time.Time `json:"lastLoginDate"`
	LastName      string    `json:"lastName"`
	UIIdentityID  string    `json:"uiIdentityId"`
}

RoleUser user who shares the same role.

type SetUserPasswordRequest

type SetUserPasswordRequest struct {
	IdentityID  string `json:"-"`
	NewPassword string `json:"newPassword"`
}

SetUserPasswordRequest contains the request parameters for the SetUserPassword endpoint.

func (SetUserPasswordRequest) Validate

func (r SetUserPasswordRequest) Validate() error

Validate validates SetUserPasswordRequest.

type TFAActionType

type TFAActionType string

TFAActionType is a type for tfa action constants.

type TimeoutPolicy

type TimeoutPolicy struct {
	Name  string `json:"name"`
	Value int64  `json:"value"`
}

TimeoutPolicy encapsulates the response from the ListTimeoutPolicies endpoint.

type Timezone

type Timezone struct {
	Description string `json:"description"`
	Offset      string `json:"offset"`
	Posix       string `json:"posix"`
	Timezone    string `json:"timezone"`
}

Timezone contains the response from the ListSupportedTimezones endpoint.

type UnlockAPIClientRequest

type UnlockAPIClientRequest struct {
	ClientID string
}

UnlockAPIClientRequest contains the request parameters for the UnlockAPIClient endpoint.

func (UnlockAPIClientRequest) Validate

func (r UnlockAPIClientRequest) Validate() error

Validate validates UnlockAPIClientRequest.

type UnlockAPIClientResponse

type UnlockAPIClientResponse APIClient

UnlockAPIClientResponse holds the response data from UnlockAPIClient.

type UnlockUserRequest

type UnlockUserRequest struct {
	IdentityID string
}

UnlockUserRequest contains the request parameters for the UnlockUser endpoint.

func (UnlockUserRequest) Validate

func (r UnlockUserRequest) Validate() error

Validate validates UnlockUserRequest.

type UpdateAPIClientRequest

type UpdateAPIClientRequest struct {
	ClientID string
	Body     UpdateAPIClientRequestBody
}

UpdateAPIClientRequest contains the request parameters for the UpdateAPIClient endpoint.

func (UpdateAPIClientRequest) Validate

func (r UpdateAPIClientRequest) Validate() error

Validate validates UpdateAPIClientRequest.

type UpdateAPIClientRequestBody

type UpdateAPIClientRequestBody struct {
	AllowAccountSwitch      bool          `json:"allowAccountSwitch"`
	APIAccess               APIAccess     `json:"apiAccess"`
	AuthorizedUsers         []string      `json:"authorizedUsers"`
	CanAutoCreateCredential bool          `json:"canAutoCreateCredential"`
	ClientDescription       string        `json:"clientDescription"`
	ClientName              string        `json:"clientName"`
	ClientType              ClientType    `json:"clientType"`
	GroupAccess             GroupAccess   `json:"groupAccess"`
	IPACL                   *IPACL        `json:"ipAcl,omitempty"`
	NotificationEmails      []string      `json:"notificationEmails"`
	PurgeOptions            *PurgeOptions `json:"purgeOptions,omitempty"`
}

UpdateAPIClientRequestBody represents body params for the UpdateAPIClient endpoint.

func (UpdateAPIClientRequestBody) Validate

func (r UpdateAPIClientRequestBody) Validate() error

Validate validates UpdateAPIClientRequestBody.

type UpdateAPIClientResponse

type UpdateAPIClientResponse GetAPIClientResponse

UpdateAPIClientResponse describes the response from the UpdateAPIClient endpoint.

type UpdateBlockedPropertiesRequest

type UpdateBlockedPropertiesRequest struct {
	IdentityID string
	GroupID    int64
	Properties []int64
}

UpdateBlockedPropertiesRequest contains the request parameters for the UpdateBlockedProperties endpoint.

func (UpdateBlockedPropertiesRequest) Validate

Validate validates UpdateBlockedPropertiesRequest.

type UpdateCIDRBlockRequest

type UpdateCIDRBlockRequest struct {
	CIDRBlockID int64
	Body        UpdateCIDRBlockRequestBody
}

UpdateCIDRBlockRequest contains the request parameters for the UpdateCIDRBlock endpoint.

func (UpdateCIDRBlockRequest) Validate

func (r UpdateCIDRBlockRequest) Validate() error

Validate validates validation on UpdateCIDRBlockRequest.

type UpdateCIDRBlockRequestBody

type UpdateCIDRBlockRequestBody struct {
	CIDRBlock string  `json:"cidrBlock"`
	Comments  *string `json:"comments,omitempty"`
	Enabled   bool    `json:"enabled"`
}

UpdateCIDRBlockRequestBody contains the request body to be used in the UpdateCIDRBlock endpoint.

func (UpdateCIDRBlockRequestBody) Validate

func (r UpdateCIDRBlockRequestBody) Validate() error

Validate validates validation on UpdateCIDRBlockRequestBody.

type UpdateCIDRBlockResponse

type UpdateCIDRBlockResponse CIDRBlock

UpdateCIDRBlockResponse describes the response of the UpdateCIDRBlock endpoint.

type UpdateCredentialRequest

type UpdateCredentialRequest struct {
	CredentialID int64
	ClientID     string
	Body         UpdateCredentialRequestBody
}

UpdateCredentialRequest contains request parameters for the UpdateCredential endpoint.

func (UpdateCredentialRequest) Validate

func (r UpdateCredentialRequest) Validate() error

Validate validates UpdateCredentialRequest.

type UpdateCredentialRequestBody

type UpdateCredentialRequestBody struct {
	Description string           `json:"description,omitempty"`
	ExpiresOn   time.Time        `json:"expiresOn"`
	Status      CredentialStatus `json:"status"`
}

UpdateCredentialRequestBody contains request body parameters for the UpdateCredential endpoint.

func (UpdateCredentialRequestBody) Validate

func (r UpdateCredentialRequestBody) Validate() error

Validate validates UpdateCredentialRequestBody.

type UpdateCredentialResponse

type UpdateCredentialResponse struct {
	Status      CredentialStatus `json:"status"`
	ExpiresOn   time.Time        `json:"expiresOn"`
	Description *string          `json:"description"`
}

UpdateCredentialResponse holds response from the UpdateCredential endpoint.

type UpdateMFARequest

type UpdateMFARequest struct {
	IdentityID string
	Value      Authentication
}

UpdateMFARequest contains the request body for the UpdateMFA endpoint.

func (UpdateMFARequest) Validate

func (r UpdateMFARequest) Validate() error

Validate validates UpdateMFARequest.

type UpdateRoleRequest

type UpdateRoleRequest struct {
	ID int64
	RoleRequest
}

UpdateRoleRequest describes the request parameters for the UpdateRole endpoint. It works as patch request. You need to provide only fields which you want to update.

func (UpdateRoleRequest) Validate

func (r UpdateRoleRequest) Validate() error

Validate validates UpdateRoleRequest.

type UpdateTFARequest

type UpdateTFARequest struct {
	IdentityID string
	Action     TFAActionType
}

UpdateTFARequest contains the request parameters for the UpdateTFA endpoint.

func (UpdateTFARequest) Validate

func (r UpdateTFARequest) Validate() error

Validate validates UpdateTFARequest.

type UpdateUserAuthGrantsRequest

type UpdateUserAuthGrantsRequest struct {
	IdentityID string
	AuthGrants []AuthGrantRequest
}

UpdateUserAuthGrantsRequest contains the request parameters for the UpdateUserAuthGrants endpoint.

func (UpdateUserAuthGrantsRequest) Validate

func (r UpdateUserAuthGrantsRequest) Validate() error

Validate validates UpdateUserAuthGrantsRequest.

type UpdateUserInfoRequest

type UpdateUserInfoRequest struct {
	IdentityID string
	User       UserBasicInfo
}

UpdateUserInfoRequest contains the request parameters for the UpdateUserInfo endpoint.

func (UpdateUserInfoRequest) Validate

func (r UpdateUserInfoRequest) Validate() error

Validate validates UpdateUserInfoRequest.

type UpdateUserNotificationsRequest

type UpdateUserNotificationsRequest struct {
	IdentityID    string
	Notifications *UserNotifications
}

UpdateUserNotificationsRequest contains the request parameters for the UpdateUserNotifications endpoint.

func (UpdateUserNotificationsRequest) Validate

Validate validates UpdateUserNotificationsRequest.

type User

type User struct {
	UserBasicInfo
	IdentityID                         string            `json:"uiIdentityId"`
	IsLocked                           bool              `json:"isLocked"`
	LastLoginDate                      time.Time         `json:"lastLoginDate,omitempty"`
	PasswordExpiryDate                 time.Time         `json:"passwordExpiryDate,omitempty"`
	TFAConfigured                      bool              `json:"tfaConfigured"`
	EmailUpdatePending                 bool              `json:"emailUpdatePending"`
	AuthGrants                         []AuthGrant       `json:"authGrants,omitempty"`
	Notifications                      UserNotifications `json:"notifications,omitempty"`
	Actions                            *UserActions      `json:"actions,omitempty"`
	UserStatus                         string            `json:"userStatus"`
	AccountID                          string            `json:"accountId"`
	AdditionalAuthenticationConfigured bool              `json:"additionalAuthenticationConfigured"`
}

User describes the response from the GetUser and CreateUser endpoints.

type UserActions

type UserActions struct {
	APIClient             bool `json:"apiClient"`
	Delete                bool `json:"delete"`
	Edit                  bool `json:"edit"`
	IsCloneable           bool `json:"isCloneable"`
	ResetPassword         bool `json:"resetPassword"`
	ThirdPartyAccess      bool `json:"thirdPartyAccess"`
	CanEditTFA            bool `json:"canEditTFA"`
	CanEditMFA            bool `json:"canEditMFA"`
	CanEditNone           bool `json:"canEditNone"`
	EditProfile           bool `json:"editProfile"`
	EditRole              bool `json:"editRole"`
	CanGenerateBypassCode bool `json:"canGenerateBypassCode"`
}

UserActions encapsulates permissions available to the user for this group.

type UserBasicInfo

type UserBasicInfo struct {
	FirstName                string         `json:"firstName"`
	LastName                 string         `json:"lastName"`
	UserName                 string         `json:"uiUserName,omitempty"`
	Email                    string         `json:"email"`
	Phone                    string         `json:"phone,omitempty"`
	TimeZone                 string         `json:"timeZone,omitempty"`
	JobTitle                 string         `json:"jobTitle"`
	TFAEnabled               bool           `json:"tfaEnabled"`
	SecondaryEmail           string         `json:"secondaryEmail,omitempty"`
	MobilePhone              string         `json:"mobilePhone,omitempty"`
	Address                  string         `json:"address,omitempty"`
	City                     string         `json:"city,omitempty"`
	State                    string         `json:"state,omitempty"`
	ZipCode                  string         `json:"zipCode,omitempty"`
	Country                  string         `json:"country"`
	ContactType              string         `json:"contactType,omitempty"`
	PreferredLanguage        string         `json:"preferredLanguage,omitempty"`
	SessionTimeOut           *int           `json:"sessionTimeOut,omitempty"`
	AdditionalAuthentication Authentication `json:"additionalAuthentication"`
}

UserBasicInfo is the user basic info structure.

type UserListItem

type UserListItem struct {
	FirstName                          string         `json:"firstName"`
	LastName                           string         `json:"lastName"`
	UserName                           string         `json:"uiUserName,omitempty"`
	Email                              string         `json:"email"`
	TFAEnabled                         bool           `json:"tfaEnabled"`
	IdentityID                         string         `json:"uiIdentityId"`
	IsLocked                           bool           `json:"isLocked"`
	LastLoginDate                      time.Time      `json:"lastLoginDate,omitempty"`
	TFAConfigured                      bool           `json:"tfaConfigured"`
	AccountID                          string         `json:"accountId"`
	Actions                            *UserActions   `json:"actions,omitempty"`
	AuthGrants                         []AuthGrant    `json:"authGrants,omitempty"`
	AdditionalAuthentication           Authentication `json:"additionalAuthentication"`
	AdditionalAuthenticationConfigured bool           `json:"additionalAuthenticationConfigured"`
}

UserListItem describes the response from the ListUsers endpoint.

type UserNotificationOptions

type UserNotificationOptions struct {
	NewUser                   bool     `json:"newUserNotification"`
	PasswordExpiry            bool     `json:"passwordExpiry"`
	Proactive                 []string `json:"proactive"`
	Upgrade                   []string `json:"upgrade"`
	APIClientCredentialExpiry bool     `json:"apiClientCredentialExpiryNotification"`
}

UserNotificationOptions types of notification emails the user receives.

type UserNotifications

type UserNotifications struct {
	EnableEmail bool                    `json:"enableEmailNotifications"`
	Options     UserNotificationOptions `json:"options"`
}

UserNotifications types of notification emails the user receives.

type UsersForProperty

type UsersForProperty struct {
	FirstName    string `json:"firstName"`
	IsBlocked    bool   `json:"isBlocked"`
	LastName     string `json:"lastName"`
	UIIdentityID string `json:"uiIdentityId"`
	UIUserName   string `json:"uiUserName"`
}

UsersForProperty holds details about the users accessing the property.

type ValidateCIDRBlockRequest

type ValidateCIDRBlockRequest struct {
	CIDRBlock string
}

ValidateCIDRBlockRequest contains the request parameters for the ValidateCIDRBlock endpoint.

func (ValidateCIDRBlockRequest) Validate

func (r ValidateCIDRBlockRequest) Validate() error

Validate validates validation on ValidateCIDRBlockRequest.

Jump to

Keyboard shortcuts

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