AuthN | Go SDK | Agreements Endpoints
Agreements Endpoints
Create an agreement
func (a *Agreements) Create(ctx context.Context, input AgreementCreateRequest) (*pangea.PangeaResponse[AgreementCreateResult], error)Create an agreement.
input := authn.AgreementCreateRequest{
Type: authn.ATeula,
Name: "EULA_V1",
Text: "You agree to behave yourself while logged in.",
}
resp, err := authncli.Agreements.Create(ctx, input)
Delete an agreement
func (a *Agreements) Delete(ctx context.Context, input AgreementDeleteRequest) (*pangea.PangeaResponse[AgreementDeleteResult], error)Delete an agreement.
input := authn.AgreementDeleteRequest{
Type: authn.ATeula,
ID: "peu_wuk7tvtpswyjtlsx52b7yyi2l7zotv4a",
}
resp, err := authncli.Agreements.Delete(ctx, input)
List agreements
func (a *Agreements) List(ctx context.Context, input AgreementListRequest) (*pangea.PangeaResponse[AgreementListResult], error)List agreements.
input := authn.AgreementListRequest{}
resp, err := authncli.Agreements.List(ctx, input)
Update agreement
func (a *Agreements) Update(ctx context.Context, input AgreementUpdateRequest) (*pangea.PangeaResponse[AgreementUpdateResult], error)Update agreement.
input := authn.AgreementUpdateRequest{
Type: authn.ATeula,
ID: pangea.String("peu_wuk7tvtpswyjtlsx52b7yyi2l7zotv4a"),
Text: pangea.String("You agree to behave yourself while logged in. Don't be evil."),
}
resp, err := authncli.Agreements.Update(ctx, input)
Type AgreementCreateRequest
type AgreementCreateRequest structtype AgreementCreateRequest struct {
pangea.BaseRequest
Type AgreementType `json:"type"`
Name string `json:"name"`
Text string `json:"text"`
Active *bool `json:"active,omitempty"`
}
Type AgreementDeleteRequest
type AgreementDeleteRequest structtype AgreementDeleteRequest struct {
pangea.BaseRequest
Type AgreementType `json:"type"`
ID string `json:"id"`
}
Type AgreementListOrderBy
type AgreementListOrderBy stringtype AgreementListOrderBy string
Type AgreementListRequest
type AgreementListRequest structtype AgreementListRequest struct {
pangea.BaseRequest
// Should use FilterAgreementList object here
Filter map[string]any `json:"filter,omitempty"`
Last string `json:"last,omitempty"`
Order ItemOrder `json:"order,omitempty"`
OrderBy AgreementListOrderBy `json:"order_by,omitempty"`
Size int `json:"size,omitempty"`
}
Type AgreementType
type AgreementType stringtype AgreementType string
Type AgreementUpdateRequest
type AgreementUpdateRequest structtype AgreementUpdateRequest struct {
pangea.BaseRequest
Type AgreementType `json:"type"`
ID string `json:"id"`
Name *string `json:"name,omitempty"`
Text *string `json:"text,omitempty"`
Active *bool `json:"active,omitempty"`
}
Type ItemOrder
type ItemOrder stringtype ItemOrder string