feat(accounts): add consent settings and organization management
This commit is contained in:
1 parent
24638d46d2
commit
391af7a1ef
83 files changed
+10198
-613
No files matched your search
@@ -1498,6 +1498,80 @@ func decodeGetMyAssessmentResultParams(args [1]string, argsEscaped bool, r *http
|
||||
return params, nil
|
||||
}
|
||||
|
||||
// GetMyConsentTextParams is parameters of GetMyConsentText operation.
|
||||
type GetMyConsentTextParams struct {
|
||||
// Consent whose current text is requested.
|
||||
Purpose ConsentSettingsPurpose
|
||||
}
|
||||
|
||||
func unpackGetMyConsentTextParams(packed middleware.Parameters) (params GetMyConsentTextParams) {
|
||||
{
|
||||
key := middleware.ParameterKey{
|
||||
Name: "purpose",
|
||||
In: "path",
|
||||
}
|
||||
params.Purpose = packed[key].(ConsentSettingsPurpose)
|
||||
}
|
||||
return params
|
||||
}
|
||||
|
||||
func decodeGetMyConsentTextParams(args [1]string, argsEscaped bool, r *http.Request) (params GetMyConsentTextParams, _ error) {
|
||||
// Decode path: purpose.
|
||||
if err := func() error {
|
||||
param := args[0]
|
||||
if argsEscaped {
|
||||
unescaped, err := url.PathUnescape(args[0])
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "unescape path")
|
||||
}
|
||||
param = unescaped
|
||||
}
|
||||
if len(param) > 0 {
|
||||
d := uri.NewPathDecoder(uri.PathDecoderConfig{
|
||||
Param: "purpose",
|
||||
Value: param,
|
||||
Style: uri.PathStyleSimple,
|
||||
Explode: false,
|
||||
})
|
||||
|
||||
if err := func() error {
|
||||
val, err := d.DecodeValue()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
c, err := conv.ToString(val)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
params.Purpose = ConsentSettingsPurpose(c)
|
||||
return nil
|
||||
}(); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := func() error {
|
||||
if err := params.Purpose.Validate(); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}(); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
return validate.ErrFieldRequired
|
||||
}
|
||||
return nil
|
||||
}(); err != nil {
|
||||
return params, &ogenerrors.DecodeParamError{
|
||||
Name: "purpose",
|
||||
In: "path",
|
||||
Err: err,
|
||||
}
|
||||
}
|
||||
return params, nil
|
||||
}
|
||||
|
||||
// GetMyInvitationParams is parameters of GetMyInvitation operation.
|
||||
type GetMyInvitationParams struct {
|
||||
// Identifier of an invitation addressed to the current candidate. A draft, an invitation addressed to
|
||||
@@ -2074,6 +2148,80 @@ func decodeGetOrganizationNeedParams(args [2]string, argsEscaped bool, r *http.R
|
||||
return params, nil
|
||||
}
|
||||
|
||||
// GrantMyConsentParams is parameters of GrantMyConsent operation.
|
||||
type GrantMyConsentParams struct {
|
||||
// Independent consent being granted. C4 is not available here.
|
||||
Purpose ConsentSettingsPurpose
|
||||
}
|
||||
|
||||
func unpackGrantMyConsentParams(packed middleware.Parameters) (params GrantMyConsentParams) {
|
||||
{
|
||||
key := middleware.ParameterKey{
|
||||
Name: "purpose",
|
||||
In: "path",
|
||||
}
|
||||
params.Purpose = packed[key].(ConsentSettingsPurpose)
|
||||
}
|
||||
return params
|
||||
}
|
||||
|
||||
func decodeGrantMyConsentParams(args [1]string, argsEscaped bool, r *http.Request) (params GrantMyConsentParams, _ error) {
|
||||
// Decode path: purpose.
|
||||
if err := func() error {
|
||||
param := args[0]
|
||||
if argsEscaped {
|
||||
unescaped, err := url.PathUnescape(args[0])
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "unescape path")
|
||||
}
|
||||
param = unescaped
|
||||
}
|
||||
if len(param) > 0 {
|
||||
d := uri.NewPathDecoder(uri.PathDecoderConfig{
|
||||
Param: "purpose",
|
||||
Value: param,
|
||||
Style: uri.PathStyleSimple,
|
||||
Explode: false,
|
||||
})
|
||||
|
||||
if err := func() error {
|
||||
val, err := d.DecodeValue()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
c, err := conv.ToString(val)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
params.Purpose = ConsentSettingsPurpose(c)
|
||||
return nil
|
||||
}(); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := func() error {
|
||||
if err := params.Purpose.Validate(); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}(); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
return validate.ErrFieldRequired
|
||||
}
|
||||
return nil
|
||||
}(); err != nil {
|
||||
return params, &ogenerrors.DecodeParamError{
|
||||
Name: "purpose",
|
||||
In: "path",
|
||||
Err: err,
|
||||
}
|
||||
}
|
||||
return params, nil
|
||||
}
|
||||
|
||||
// HideOrganizationParams is parameters of HideOrganization operation.
|
||||
type HideOrganizationParams struct {
|
||||
// Identifier of the organization that the current candidate hides or stops hiding the profile from. It
|
||||
@@ -4209,6 +4357,147 @@ func decodeRegisterAccountParams(args [0]string, argsEscaped bool, r *http.Reque
|
||||
return params, nil
|
||||
}
|
||||
|
||||
// RevokeMyConsentParams is parameters of RevokeMyConsent operation.
|
||||
type RevokeMyConsentParams struct {
|
||||
// Consent being revoked. C1 has a deletion-request operation and C4 requires an organization scope.
|
||||
Purpose ConsentSettingsRevokePurpose
|
||||
}
|
||||
|
||||
func unpackRevokeMyConsentParams(packed middleware.Parameters) (params RevokeMyConsentParams) {
|
||||
{
|
||||
key := middleware.ParameterKey{
|
||||
Name: "purpose",
|
||||
In: "path",
|
||||
}
|
||||
params.Purpose = packed[key].(ConsentSettingsRevokePurpose)
|
||||
}
|
||||
return params
|
||||
}
|
||||
|
||||
func decodeRevokeMyConsentParams(args [1]string, argsEscaped bool, r *http.Request) (params RevokeMyConsentParams, _ error) {
|
||||
// Decode path: purpose.
|
||||
if err := func() error {
|
||||
param := args[0]
|
||||
if argsEscaped {
|
||||
unescaped, err := url.PathUnescape(args[0])
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "unescape path")
|
||||
}
|
||||
param = unescaped
|
||||
}
|
||||
if len(param) > 0 {
|
||||
d := uri.NewPathDecoder(uri.PathDecoderConfig{
|
||||
Param: "purpose",
|
||||
Value: param,
|
||||
Style: uri.PathStyleSimple,
|
||||
Explode: false,
|
||||
})
|
||||
|
||||
if err := func() error {
|
||||
val, err := d.DecodeValue()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
c, err := conv.ToString(val)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
params.Purpose = ConsentSettingsRevokePurpose(c)
|
||||
return nil
|
||||
}(); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := func() error {
|
||||
if err := params.Purpose.Validate(); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}(); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
return validate.ErrFieldRequired
|
||||
}
|
||||
return nil
|
||||
}(); err != nil {
|
||||
return params, &ogenerrors.DecodeParamError{
|
||||
Name: "purpose",
|
||||
In: "path",
|
||||
Err: err,
|
||||
}
|
||||
}
|
||||
return params, nil
|
||||
}
|
||||
|
||||
// RevokeMyOrganizationContactConsentParams is parameters of RevokeMyOrganizationContactConsent operation.
|
||||
type RevokeMyOrganizationContactConsentParams struct {
|
||||
// Organization whose stored C4 grants this account revokes. A well-formed identifier outside the
|
||||
// account's stored records changes nothing and does not reveal whether that organization exists.
|
||||
OrgID uuid.UUID
|
||||
}
|
||||
|
||||
func unpackRevokeMyOrganizationContactConsentParams(packed middleware.Parameters) (params RevokeMyOrganizationContactConsentParams) {
|
||||
{
|
||||
key := middleware.ParameterKey{
|
||||
Name: "org_id",
|
||||
In: "path",
|
||||
}
|
||||
params.OrgID = packed[key].(uuid.UUID)
|
||||
}
|
||||
return params
|
||||
}
|
||||
|
||||
func decodeRevokeMyOrganizationContactConsentParams(args [1]string, argsEscaped bool, r *http.Request) (params RevokeMyOrganizationContactConsentParams, _ error) {
|
||||
// Decode path: org_id.
|
||||
if err := func() error {
|
||||
param := args[0]
|
||||
if argsEscaped {
|
||||
unescaped, err := url.PathUnescape(args[0])
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "unescape path")
|
||||
}
|
||||
param = unescaped
|
||||
}
|
||||
if len(param) > 0 {
|
||||
d := uri.NewPathDecoder(uri.PathDecoderConfig{
|
||||
Param: "org_id",
|
||||
Value: param,
|
||||
Style: uri.PathStyleSimple,
|
||||
Explode: false,
|
||||
})
|
||||
|
||||
if err := func() error {
|
||||
val, err := d.DecodeValue()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
c, err := conv.ToUUID(val)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
params.OrgID = c
|
||||
return nil
|
||||
}(); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
return validate.ErrFieldRequired
|
||||
}
|
||||
return nil
|
||||
}(); err != nil {
|
||||
return params, &ogenerrors.DecodeParamError{
|
||||
Name: "org_id",
|
||||
In: "path",
|
||||
Err: err,
|
||||
}
|
||||
}
|
||||
return params, nil
|
||||
}
|
||||
|
||||
// SendOrganizationInvitationParams is parameters of SendOrganizationInvitation operation.
|
||||
type SendOrganizationInvitationParams struct {
|
||||
// Identifier of an organization. Access comes only from an active membership of the session account in
|
||||
|
||||
Reference in new issue
Block a user