Skip to content

Commit 59e763d

Browse files
authored
feat: remove required parameters from user identifier policy conditions (#589)
1 parent cf104e7 commit 59e763d

10 files changed

Lines changed: 124 additions & 114 deletions

.generator/okta-management-APIs-oasv3-noEnums-inheritance.yaml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54180,9 +54180,6 @@ components:
5418054180
value:
5418154181
type: string
5418254182
description: The regular expression or simple match string
54183-
required:
54184-
- matchType
54185-
- value
5418654183
UserIdentifierMatchType:
5418754184
description: The type of pattern. For regex, use `EXPRESSION`.
5418854185
type: string
@@ -54205,9 +54202,6 @@ components:
5420554202
$ref: '#/components/schemas/UserIdentifierConditionEvaluatorPattern'
5420654203
type:
5420754204
$ref: '#/components/schemas/UserIdentifierType'
54208-
required:
54209-
- patterns
54210-
- type
5421154205
UserIdentifierType:
5421254206
description: What to match against, either user ID or an attribute in the user's Okta profile.
5421354207
type: string

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
11
# Changelog
22
Running changelog of releases since `2.0.0-rc.4`
33

4+
## v6.1.6
5+
- Fix UserIdentifierPolicyRuleCondition by making patterns and type as optional parameters. Thanks [@pranav-okta](https://github.com/pranav-okta)
6+
7+
## v6.1.5
8+
- Fix the RiskPolicyRuleConditions where level is a required parameter. Thanks [@pranav-okta](https://github.com/pranav-okta)
9+
10+
## v6.1.4
11+
- Add OAuth2ClientJsonWebKeySet schema for listJwk response. Thanks [@aditya-okta](https://github.com/aditya-okta)
12+
13+
## v6.1.3
14+
- Fix the CreatePushGroupMapping to accept AppConfig as a pointer. Thanks [@pranav-okta](https://github.com/pranav-okta)
15+
416
## v6.1.2
517
- Fix AppConfig by adding required type param. Thanks [@pranav-okta](https://github.com/pranav-okta)
618

okta/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Allows customers to easily access the Okta Management APIs
66
This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client.
77

88
- API version: 5.1.0
9-
- Package version: 6.1.5
9+
- Package version: 6.1.6
1010
- Build package: org.openapitools.codegen.languages.GoClientCodegen
1111
For more information, please visit [https://developer.okta.com/](https://developer.okta.com/)
1212

okta/api/openapi.yaml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82507,9 +82507,6 @@ components:
8250782507
value:
8250882508
description: The regular expression or simple match string
8250982509
type: string
82510-
required:
82511-
- matchType
82512-
- value
8251382510
type: object
8251482511
UserIdentifierMatchType:
8251582512
description: "The type of pattern. For regex, use `EXPRESSION`."
@@ -82538,9 +82535,6 @@ components:
8253882535
x-okta-known-values:
8253982536
- ATTRIBUTE
8254082537
- IDENTIFIER
82541-
required:
82542-
- patterns
82543-
- type
8254482538
type: object
8254582539
UserIdentifierType:
8254682540
description: "What to match against, either user ID or an attribute in the user's\

okta/client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ var (
6868
)
6969

7070
const (
71-
VERSION = "6.1.5"
71+
VERSION = "6.1.6"
7272
AccessTokenCacheKey = "OKTA_ACCESS_TOKEN"
7373
DpopAccessTokenNonce = "DPOP_OKTA_ACCESS_TOKEN_NONCE"
7474
DpopAccessTokenPrivateKey = "DPOP_OKTA_ACCESS_TOKEN_PRIVATE_KEY"

okta/configuration.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ type Configuration struct {
165165
func NewConfiguration(conf ...ConfigSetter) (*Configuration, error) {
166166
cfg := &Configuration{
167167
DefaultHeader: make(map[string]string),
168-
UserAgent: fmt.Sprintf("okta-sdk-golang/%s golang/%s %s/%s", "6.1.5", runtime.Version(), runtime.GOOS, runtime.GOARCH),
168+
UserAgent: fmt.Sprintf("okta-sdk-golang/%s golang/%s %s/%s", "6.1.6", runtime.Version(), runtime.GOOS, runtime.GOARCH),
169169
Debug: false,
170170
Servers: ServerConfigurations{
171171
{

okta/docs/UserIdentifierConditionEvaluatorPattern.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44

55
Name | Type | Description | Notes
66
------------ | ------------- | ------------- | -------------
7-
**MatchType** | **string** | The type of pattern. For regex, use `EXPRESSION`. |
8-
**Value** | **string** | The regular expression or simple match string |
7+
**MatchType** | Pointer to **string** | The type of pattern. For regex, use `EXPRESSION`. | [optional]
8+
**Value** | Pointer to **string** | The regular expression or simple match string | [optional]
99

1010
## Methods
1111

1212
### NewUserIdentifierConditionEvaluatorPattern
1313

14-
`func NewUserIdentifierConditionEvaluatorPattern(matchType string, value string, ) *UserIdentifierConditionEvaluatorPattern`
14+
`func NewUserIdentifierConditionEvaluatorPattern() *UserIdentifierConditionEvaluatorPattern`
1515

1616
NewUserIdentifierConditionEvaluatorPattern instantiates a new UserIdentifierConditionEvaluatorPattern object
1717
This constructor will assign default values to properties that have it defined,
@@ -45,6 +45,11 @@ and a boolean to check if the value has been set.
4545

4646
SetMatchType sets MatchType field to given value.
4747

48+
### HasMatchType
49+
50+
`func (o *UserIdentifierConditionEvaluatorPattern) HasMatchType() bool`
51+
52+
HasMatchType returns a boolean if a field has been set.
4853

4954
### GetValue
5055

@@ -65,6 +70,11 @@ and a boolean to check if the value has been set.
6570

6671
SetValue sets Value field to given value.
6772

73+
### HasValue
74+
75+
`func (o *UserIdentifierConditionEvaluatorPattern) HasValue() bool`
76+
77+
HasValue returns a boolean if a field has been set.
6878

6979

7080
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

okta/docs/UserIdentifierPolicyRuleCondition.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
Name | Type | Description | Notes
66
------------ | ------------- | ------------- | -------------
77
**Attribute** | Pointer to **string** | The name of the profile attribute to match against. Only used when type is `ATTRIBUTE`. | [optional]
8-
**Patterns** | [**[]UserIdentifierConditionEvaluatorPattern**](UserIdentifierConditionEvaluatorPattern.md) | |
9-
**Type** | **string** | What to match against, either user ID or an attribute in the user's Okta profile. |
8+
**Patterns** | Pointer to [**[]UserIdentifierConditionEvaluatorPattern**](UserIdentifierConditionEvaluatorPattern.md) | | [optional]
9+
**Type** | Pointer to **string** | What to match against, either user ID or an attribute in the user's Okta profile. | [optional]
1010

1111
## Methods
1212

1313
### NewUserIdentifierPolicyRuleCondition
1414

15-
`func NewUserIdentifierPolicyRuleCondition(patterns []UserIdentifierConditionEvaluatorPattern, type_ string, ) *UserIdentifierPolicyRuleCondition`
15+
`func NewUserIdentifierPolicyRuleCondition() *UserIdentifierPolicyRuleCondition`
1616

1717
NewUserIdentifierPolicyRuleCondition instantiates a new UserIdentifierPolicyRuleCondition object
1818
This constructor will assign default values to properties that have it defined,
@@ -71,6 +71,11 @@ and a boolean to check if the value has been set.
7171

7272
SetPatterns sets Patterns field to given value.
7373

74+
### HasPatterns
75+
76+
`func (o *UserIdentifierPolicyRuleCondition) HasPatterns() bool`
77+
78+
HasPatterns returns a boolean if a field has been set.
7479

7580
### GetType
7681

@@ -91,6 +96,11 @@ and a boolean to check if the value has been set.
9196

9297
SetType sets Type field to given value.
9398

99+
### HasType
100+
101+
`func (o *UserIdentifierPolicyRuleCondition) HasType() bool`
102+
103+
HasType returns a boolean if a field has been set.
94104

95105

96106
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

okta/model_user_identifier_condition_evaluator_pattern.go

Lines changed: 43 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ package okta
2525

2626
import (
2727
"encoding/json"
28-
"fmt"
2928
)
3029

3130
// checks if the UserIdentifierConditionEvaluatorPattern type satisfies the MappedNullable interface at compile time
@@ -34,9 +33,9 @@ var _ MappedNullable = &UserIdentifierConditionEvaluatorPattern{}
3433
// UserIdentifierConditionEvaluatorPattern Specifies the details of the patterns to match against
3534
type UserIdentifierConditionEvaluatorPattern struct {
3635
// The type of pattern. For regex, use `EXPRESSION`.
37-
MatchType string `json:"matchType"`
36+
MatchType *string `json:"matchType,omitempty"`
3837
// The regular expression or simple match string
39-
Value string `json:"value"`
38+
Value *string `json:"value,omitempty"`
4039
AdditionalProperties map[string]interface{}
4140
}
4241

@@ -46,10 +45,8 @@ type _UserIdentifierConditionEvaluatorPattern UserIdentifierConditionEvaluatorPa
4645
// This constructor will assign default values to properties that have it defined,
4746
// and makes sure properties required by API are set, but the set of arguments
4847
// will change when the set of required properties is changed
49-
func NewUserIdentifierConditionEvaluatorPattern(matchType string, value string) *UserIdentifierConditionEvaluatorPattern {
48+
func NewUserIdentifierConditionEvaluatorPattern() *UserIdentifierConditionEvaluatorPattern {
5049
this := UserIdentifierConditionEvaluatorPattern{}
51-
this.MatchType = matchType
52-
this.Value = value
5350
return &this
5451
}
5552

@@ -61,52 +58,68 @@ func NewUserIdentifierConditionEvaluatorPatternWithDefaults() *UserIdentifierCon
6158
return &this
6259
}
6360

64-
// GetMatchType returns the MatchType field value
61+
// GetMatchType returns the MatchType field value if set, zero value otherwise.
6562
func (o *UserIdentifierConditionEvaluatorPattern) GetMatchType() string {
66-
if o == nil {
63+
if o == nil || IsNil(o.MatchType) {
6764
var ret string
6865
return ret
6966
}
70-
71-
return o.MatchType
67+
return *o.MatchType
7268
}
7369

74-
// GetMatchTypeOk returns a tuple with the MatchType field value
70+
// GetMatchTypeOk returns a tuple with the MatchType field value if set, nil otherwise
7571
// and a boolean to check if the value has been set.
7672
func (o *UserIdentifierConditionEvaluatorPattern) GetMatchTypeOk() (*string, bool) {
77-
if o == nil {
73+
if o == nil || IsNil(o.MatchType) {
7874
return nil, false
7975
}
80-
return &o.MatchType, true
76+
return o.MatchType, true
77+
}
78+
79+
// HasMatchType returns a boolean if a field has been set.
80+
func (o *UserIdentifierConditionEvaluatorPattern) HasMatchType() bool {
81+
if o != nil && !IsNil(o.MatchType) {
82+
return true
83+
}
84+
85+
return false
8186
}
8287

83-
// SetMatchType sets field value
88+
// SetMatchType gets a reference to the given string and assigns it to the MatchType field.
8489
func (o *UserIdentifierConditionEvaluatorPattern) SetMatchType(v string) {
85-
o.MatchType = v
90+
o.MatchType = &v
8691
}
8792

88-
// GetValue returns the Value field value
93+
// GetValue returns the Value field value if set, zero value otherwise.
8994
func (o *UserIdentifierConditionEvaluatorPattern) GetValue() string {
90-
if o == nil {
95+
if o == nil || IsNil(o.Value) {
9196
var ret string
9297
return ret
9398
}
94-
95-
return o.Value
99+
return *o.Value
96100
}
97101

98-
// GetValueOk returns a tuple with the Value field value
102+
// GetValueOk returns a tuple with the Value field value if set, nil otherwise
99103
// and a boolean to check if the value has been set.
100104
func (o *UserIdentifierConditionEvaluatorPattern) GetValueOk() (*string, bool) {
101-
if o == nil {
105+
if o == nil || IsNil(o.Value) {
102106
return nil, false
103107
}
104-
return &o.Value, true
108+
return o.Value, true
105109
}
106110

107-
// SetValue sets field value
111+
// HasValue returns a boolean if a field has been set.
112+
func (o *UserIdentifierConditionEvaluatorPattern) HasValue() bool {
113+
if o != nil && !IsNil(o.Value) {
114+
return true
115+
}
116+
117+
return false
118+
}
119+
120+
// SetValue gets a reference to the given string and assigns it to the Value field.
108121
func (o *UserIdentifierConditionEvaluatorPattern) SetValue(v string) {
109-
o.Value = v
122+
o.Value = &v
110123
}
111124

112125
func (o UserIdentifierConditionEvaluatorPattern) MarshalJSON() ([]byte, error) {
@@ -119,8 +132,12 @@ func (o UserIdentifierConditionEvaluatorPattern) MarshalJSON() ([]byte, error) {
119132

120133
func (o UserIdentifierConditionEvaluatorPattern) ToMap() (map[string]interface{}, error) {
121134
toSerialize := map[string]interface{}{}
122-
toSerialize["matchType"] = o.MatchType
123-
toSerialize["value"] = o.Value
135+
if !IsNil(o.MatchType) {
136+
toSerialize["matchType"] = o.MatchType
137+
}
138+
if !IsNil(o.Value) {
139+
toSerialize["value"] = o.Value
140+
}
124141

125142
for key, value := range o.AdditionalProperties {
126143
toSerialize[key] = value
@@ -130,28 +147,6 @@ func (o UserIdentifierConditionEvaluatorPattern) ToMap() (map[string]interface{}
130147
}
131148

132149
func (o *UserIdentifierConditionEvaluatorPattern) UnmarshalJSON(data []byte) (err error) {
133-
// This validates that all required properties are included in the JSON object
134-
// by unmarshalling the object into a generic map with string keys and checking
135-
// that every required field exists as a key in the generic map.
136-
requiredProperties := []string{
137-
"matchType",
138-
"value",
139-
}
140-
141-
allProperties := make(map[string]interface{})
142-
143-
err = json.Unmarshal(data, &allProperties)
144-
145-
if err != nil {
146-
return err
147-
}
148-
149-
for _, requiredProperty := range requiredProperties {
150-
if _, exists := allProperties[requiredProperty]; !exists {
151-
return fmt.Errorf("no value given for required property %v", requiredProperty)
152-
}
153-
}
154-
155150
varUserIdentifierConditionEvaluatorPattern := _UserIdentifierConditionEvaluatorPattern{}
156151

157152
err = json.Unmarshal(data, &varUserIdentifierConditionEvaluatorPattern)

0 commit comments

Comments
 (0)