Documentation ¶
Overview ¶
akams package provides a client for the aka.ms API. See https://aka.ms/akaapi for more information.
Index ¶
- Constants
- type Client
- func (c *Client) CreateBulk(ctx context.Context, links []CreateLinkRequest) error
- func (c *Client) CreateOrUpdateBulk(ctx context.Context, links []CreateLinkRequest) error
- func (c *Client) SetBulkLimit(bulkSize int, maxSizeBytes int)
- func (c *Client) UpdateBulk(ctx context.Context, links []UpdateLinkRequest) error
- type CreateLinkRequest
- type Host
- type ResponseError
- type UpdateLinkRequest
Constants ¶
const Scope = "https://microsoft.onmicrosoft.com/redirectionapi"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a client for the aka.ms API.
func NewClientCustom ¶
func NewClientCustom(apiBaseURL string, host Host, tenant string, httpClient *http.Client) (*Client, error)
NewClientCustom creates a new Client with a custom API base URL and host.
func (*Client) CreateBulk ¶
func (c *Client) CreateBulk(ctx context.Context, links []CreateLinkRequest) error
CreateBulk creates multiple links in bulk.
func (*Client) CreateOrUpdateBulk ¶
func (c *Client) CreateOrUpdateBulk(ctx context.Context, links []CreateLinkRequest) error
CreateOrUpdateBulk creates or updates multiple links in bulk. If a link already exists, it will be updated. If a link does not exist, it will be created. If any link fails to be created or updated, the function will return an error.
func (*Client) SetBulkLimit ¶
SetBulkLimit sets the maximum number of items and the maximum size in bytes for bulk operations. The default is 300 items and 50_000 bytes. Setting a value of 0 or negative for bulkSize or maxSizeBytes will reset the limit to the default.
func (*Client) UpdateBulk ¶
func (c *Client) UpdateBulk(ctx context.Context, links []UpdateLinkRequest) error
UpdateBulk updates multiple links in bulk.
type CreateLinkRequest ¶
type CreateLinkRequest struct { ShortURL string `json:"shortUrl,omitempty"` TargetURL string `json:"targetUrl"` MobileURL string `json:"mobileUrl,omitempty"` CreatedBy string `json:"createdBy"` LastModifiedBy string `json:"lastModifiedBy"` IsVanity bool `json:"isVanity,omitempty"` IsAllowParam bool `json:"isAllowParam,omitempty"` IsTrackParam bool `json:"isTrackParam,omitempty"` Description string `json:"description,omitempty"` GroupOwner string `json:"groupOwner,omitempty"` Owners string `json:"owners"` Category string `json:"category,omitempty"` IsActive bool `json:"isActive,omitempty"` BypassCvsCheck bool `json:"bypassCvsCheck,omitempty"` BypassCvsCheckJustification string `json:"bypassCvsCheckJustification,omitempty"` }
func (*CreateLinkRequest) ToUpdateLinkRequest ¶
func (c *CreateLinkRequest) ToUpdateLinkRequest() UpdateLinkRequest
type ResponseError ¶
ResponseError is an error returned by the aka.ms API.
func (*ResponseError) Error ¶
func (e *ResponseError) Error() string
type UpdateLinkRequest ¶
type UpdateLinkRequest struct { ShortURL string `json:"shortUrl,omitempty"` TargetURL string `json:"targetUrl"` MobileURL string `json:"mobileUrl,omitempty"` IsAllowParam bool `json:"isAllowParam,omitempty"` IsTrackParam bool `json:"isTrackParam,omitempty"` Description string `json:"description,omitempty"` GroupOwner string `json:"groupOwner,omitempty"` LastModifiedBy string `json:"lastModifiedBy"` Owners string `json:"owners"` Category string `json:"category,omitempty"` IsActive bool `json:"isActive,omitempty"` }