From 3f5bd26e6a22b91005d3de5f638b1821b9268aab Mon Sep 17 00:00:00 2001 From: Maikel Poot Date: Tue, 9 May 2023 15:34:17 +0200 Subject: [PATCH] feat: Require and changes for keyhub contract version 62 --- keyhub.go | 2 +- model/group.go | 36 ++++-------------------------------- 2 files changed, 5 insertions(+), 33 deletions(-) diff --git a/keyhub.go b/keyhub.go index 1254987..7bd5e00 100644 --- a/keyhub.go +++ b/keyhub.go @@ -31,7 +31,7 @@ import ( const ( /* KeyHub contract version supported by this client, set to 0 for latest */ - supportedContractVersion = 57 + supportedContractVersion = 62 /* KeyHub json mediatype */ mediatype = "application/vnd.topicus.keyhub+json" diff --git a/model/group.go b/model/group.go index 5b6efce..627af8e 100644 --- a/model/group.go +++ b/model/group.go @@ -17,9 +17,7 @@ package model import ( "encoding/json" - "fmt" "net/url" - "strings" ) const ( @@ -255,12 +253,6 @@ func (p GroupAdditionalQueryParams) EncodeValues(key string, v *url.Values) erro return additionalQueryParamsUrlEncoder(p, key, v) } -const ( - PRGRP_SECURITY_LEVEL_LOW ProvisioningGroupSecurityLevel = "LOW" - PRGRP_SECURITY_LEVEL_MEDIUM ProvisioningGroupSecurityLevel = "MEDIUM" - PRGRP_SECURITY_LEVEL_HIGH ProvisioningGroupSecurityLevel = "HIGH" -) - // Section: Group func NewProvisioningGroup() *ProvisioningGroup { @@ -268,8 +260,7 @@ func NewProvisioningGroup() *ProvisioningGroup { Linkable: Linkable{ DType: "group.ProvisioningGroup", }, - SecurityLevel: PRGRP_SECURITY_LEVEL_HIGH, - StaticProvisioning: false, + ActivationRequired: true, } return &pg } @@ -278,26 +269,7 @@ func NewProvisioningGroup() *ProvisioningGroup { type ProvisioningGroup struct { Linkable - GroupOnSystem *GroupOnSystem `json:"groupOnSystem,omitempty"` - Group *Group `json:"group"` - SecurityLevel ProvisioningGroupSecurityLevel `json:"securityLevel"` - StaticProvisioning bool `json:"staticProvisioning"` + GroupOnSystem *GroupOnSystem `json:"groupOnSystem,omitempty"` + Group *Group `json:"group"` + ActivationRequired bool `json:"activationRequired"` } - -func (p *ProvisioningGroup) SetSecurityLevelString(level string) error { - - switch strings.ToUpper(level) { - case string(PRGRP_SECURITY_LEVEL_HIGH): - p.SecurityLevel = PRGRP_SECURITY_LEVEL_HIGH - case string(PRGRP_SECURITY_LEVEL_MEDIUM): - p.SecurityLevel = PRGRP_SECURITY_LEVEL_MEDIUM - case string(PRGRP_SECURITY_LEVEL_LOW): - p.SecurityLevel = PRGRP_SECURITY_LEVEL_LOW - default: - return fmt.Errorf("value %s is not a valid level", level) - } - return nil - -} - -type ProvisioningGroupSecurityLevel string