diff --git a/CHANGELOG.md b/CHANGELOG.md index 1d8b5a4d..d523a962 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +# Release (Unreleased) + +* `github.com/patrickcping/pingone-go-sdk-v2/risk` : [v0.6.1](./risk/CHANGELOG.md) + * **Bug** Fix the `RiskPolicyResult` object, where the `Level` should only be `LOW`. + # Release (2023-05-22) * `github.com/patrickcping/pingone-go-sdk-v2` : v0.7.1 diff --git a/pingone-risk.yml b/pingone-risk.yml index 8c3c578c..2e9c9268 100644 --- a/pingone-risk.yml +++ b/pingone-risk.yml @@ -64,6 +64,10 @@ components: description: | Indicates the type of policy you are defining. Can be one of the following values: `AGGREGATED_SCORES`, `AGGREGATED_WEIGHTS`, `VALUE_COMPARISON`, and `IP_RANGE` (for override policies or custom predictors). enum: [AGGREGATED_WEIGHTS, AGGREGATED_SCORES, VALUE_COMPARISON, IP_RANGE] + EnumRiskPolicyResultLevel: + type: string + enum: [LOW] + description: Contains the default result level returned if none of the conditions in the policy are evaluated to true. At this time, the value must be `LOW`. EnumPredictorCompositeConditionType: type: string enum: [VALUE_COMPARISON, STRING_LIST, AND, NOT, OR] @@ -605,8 +609,15 @@ components: type: integer description: An integer that specifies priority of the policy inside a risk policy set, designating which policy should run first. This is a read-only value. The priority is determined by the order in which policies are listed in the policy set. The first policy in the list is assigned priority 1 and is evaluated first. The next policy in the list is assigned priority 2 and so on. result: - $ref: '#/components/schemas/RiskPolicyResult' + type: object description: A result object that specifies the result returned if the policy is evaluated as true. If several policies are evaluated as true, the result related to the highest priority policy is returned. for more information, see the Result attribute data model in the Risk Evaluations topic. + properties: + level: + $ref: '#/components/schemas/EnumRiskPolicyResultLevel' + type: + $ref: '#/components/schemas/EnumResultType' + required: + - level updatedAt: type: string format: date-time diff --git a/risk/.openapi-generator/FILES b/risk/.openapi-generator/FILES index e982dfb5..7e201e37 100644 --- a/risk/.openapi-generator/FILES +++ b/risk/.openapi-generator/FILES @@ -20,6 +20,7 @@ docs/EnumPredictorVelocityUseType.md docs/EnumResultType.md docs/EnumRiskLevel.md docs/EnumRiskPolicyConditionType.md +docs/EnumRiskPolicyResultLevel.md docs/EnumThresholdSource.md docs/EnumUserRiskBehaviorRiskModel.md docs/EnumUserType.md @@ -124,6 +125,7 @@ model_enum_predictor_velocity_use_type.go model_enum_result_type.go model_enum_risk_level.go model_enum_risk_policy_condition_type.go +model_enum_risk_policy_result_level.go model_enum_threshold_source.go model_enum_user_risk_behavior_risk_model.go model_enum_user_type.go diff --git a/risk/.version b/risk/.version index 09a3acfa..7ceb0404 100644 --- a/risk/.version +++ b/risk/.version @@ -1 +1 @@ -0.6.0 \ No newline at end of file +0.6.1 \ No newline at end of file diff --git a/risk/CHANGELOG.md b/risk/CHANGELOG.md index 7a53a05d..9b7601f6 100644 --- a/risk/CHANGELOG.md +++ b/risk/CHANGELOG.md @@ -1,3 +1,7 @@ +# v0.6.1 (Unreleased) + +* **Bug** Fix the `RiskPolicyResult` object, where the `Level` should only be `LOW`. + # v0.6.0 (2023-05-19) * **Breaking change** `RiskPolicySetRiskPoliciesInner` model changed to `RiskPolicy`. [#170](https://github.com/patrickcping/pingone-go-sdk-v2/pull/170) diff --git a/risk/README.md b/risk/README.md index 24953301..dae0cb07 100644 --- a/risk/README.md +++ b/risk/README.md @@ -6,7 +6,7 @@ The PingOne Platform API covering the PingOne Risk service 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. - API version: 2021-10-17 -- Package version: 0.6.0 +- Package version: 0.6.1 - Build package: org.openapitools.codegen.languages.GoClientCodegen ## Installation @@ -110,6 +110,7 @@ Class | Method | HTTP request | Description - [EnumResultType](docs/EnumResultType.md) - [EnumRiskLevel](docs/EnumRiskLevel.md) - [EnumRiskPolicyConditionType](docs/EnumRiskPolicyConditionType.md) + - [EnumRiskPolicyResultLevel](docs/EnumRiskPolicyResultLevel.md) - [EnumThresholdSource](docs/EnumThresholdSource.md) - [EnumUserRiskBehaviorRiskModel](docs/EnumUserRiskBehaviorRiskModel.md) - [EnumUserType](docs/EnumUserType.md) diff --git a/risk/api/openapi.yaml b/risk/api/openapi.yaml index 4b13dc65..a4c14cb6 100644 --- a/risk/api/openapi.yaml +++ b/risk/api/openapi.yaml @@ -936,7 +936,6 @@ components: - result: level: null type: null - value: value createdAt: 2000-01-23T04:56:07.000+00:00 condition: aggregatedWeights: @@ -969,7 +968,6 @@ components: - result: level: null type: null - value: value createdAt: 2000-01-23T04:56:07.000+00:00 condition: aggregatedWeights: @@ -1018,7 +1016,6 @@ components: - result: level: null type: null - value: value createdAt: 2000-01-23T04:56:07.000+00:00 condition: aggregatedWeights: @@ -1051,7 +1048,6 @@ components: - result: level: null type: null - value: value createdAt: 2000-01-23T04:56:07.000+00:00 condition: aggregatedWeights: @@ -1138,6 +1134,12 @@ components: - VALUE_COMPARISON - IP_RANGE type: string + EnumRiskPolicyResultLevel: + description: "Contains the default result level returned if none of the conditions\ + \ in the policy are evaluated to true. At this time, the value must be `LOW`." + enum: + - LOW + type: string EnumPredictorCompositeConditionType: enum: - VALUE_COMPARISON @@ -1638,7 +1640,6 @@ components: result: level: null type: null - value: value createdAt: 2000-01-23T04:56:07.000+00:00 condition: aggregatedWeights: @@ -1703,7 +1704,7 @@ components: \ list is assigned priority 2 and so on." type: integer result: - $ref: '#/components/schemas/RiskPolicyResult' + $ref: '#/components/schemas/RiskPolicy_result' updatedAt: description: The time the resource was last updated (format ISO-8061). format: date-time @@ -1730,7 +1731,6 @@ components: - result: level: null type: null - value: value createdAt: 2000-01-23T04:56:07.000+00:00 condition: aggregatedWeights: @@ -1763,7 +1763,6 @@ components: - result: level: null type: null - value: value createdAt: 2000-01-23T04:56:07.000+00:00 condition: aggregatedWeights: @@ -2089,7 +2088,6 @@ components: - result: level: null type: null - value: value createdAt: 2000-01-23T04:56:07.000+00:00 condition: aggregatedWeights: @@ -2122,7 +2120,6 @@ components: - result: level: null type: null - value: value createdAt: 2000-01-23T04:56:07.000+00:00 condition: aggregatedWeights: @@ -2171,7 +2168,6 @@ components: - result: level: null type: null - value: value createdAt: 2000-01-23T04:56:07.000+00:00 condition: aggregatedWeights: @@ -2204,7 +2200,6 @@ components: - result: level: null type: null - value: value createdAt: 2000-01-23T04:56:07.000+00:00 condition: aggregatedWeights: @@ -2853,6 +2848,22 @@ components: between: $ref: '#/components/schemas/RiskPolicy_condition_between' type: object + RiskPolicy_result: + description: "A result object that specifies the result returned if the policy\ + \ is evaluated as true. If several policies are evaluated as true, the result\ + \ related to the highest priority policy is returned. for more information,\ + \ see the Result attribute data model in the Risk Evaluations topic." + example: + level: null + type: null + properties: + level: + $ref: '#/components/schemas/EnumRiskPolicyResultLevel' + type: + $ref: '#/components/schemas/EnumResultType' + required: + - level + type: object RiskPolicySet_evaluatedPredictors_inner: example: id: id diff --git a/risk/configuration.go b/risk/configuration.go index 562f46dd..9b2a4534 100644 --- a/risk/configuration.go +++ b/risk/configuration.go @@ -89,7 +89,7 @@ type Configuration struct { func NewConfiguration() *Configuration { cfg := &Configuration{ DefaultHeader: make(map[string]string), - UserAgent: "PingOne-GOLANG-SDK/0.6.0/go", + UserAgent: "PingOne-GOLANG-SDK/0.6.1/go", Debug: false, Servers: ServerConfigurations{ { diff --git a/risk/docs/EnumRiskPolicyResultLevel.md b/risk/docs/EnumRiskPolicyResultLevel.md new file mode 100644 index 00000000..6be744f6 --- /dev/null +++ b/risk/docs/EnumRiskPolicyResultLevel.md @@ -0,0 +1,11 @@ +# EnumRiskPolicyResultLevel + +## Enum + + +* `LOW` (value: `"LOW"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/risk/docs/RiskPolicyResult.md b/risk/docs/RiskPolicyResult.md index 16f842ac..6545c5b7 100644 --- a/risk/docs/RiskPolicyResult.md +++ b/risk/docs/RiskPolicyResult.md @@ -4,15 +4,14 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Level** | [**EnumRiskLevel**](EnumRiskLevel.md) | | +**Level** | [**EnumRiskPolicyResultLevel**](EnumRiskPolicyResultLevel.md) | | **Type** | Pointer to [**EnumResultType**](EnumResultType.md) | | [optional] -**Value** | Pointer to **string** | | [optional] ## Methods ### NewRiskPolicyResult -`func NewRiskPolicyResult(level EnumRiskLevel, ) *RiskPolicyResult` +`func NewRiskPolicyResult(level EnumRiskPolicyResultLevel, ) *RiskPolicyResult` NewRiskPolicyResult instantiates a new RiskPolicyResult object This constructor will assign default values to properties that have it defined, @@ -29,20 +28,20 @@ but it doesn't guarantee that properties required by API are set ### GetLevel -`func (o *RiskPolicyResult) GetLevel() EnumRiskLevel` +`func (o *RiskPolicyResult) GetLevel() EnumRiskPolicyResultLevel` GetLevel returns the Level field if non-nil, zero value otherwise. ### GetLevelOk -`func (o *RiskPolicyResult) GetLevelOk() (*EnumRiskLevel, bool)` +`func (o *RiskPolicyResult) GetLevelOk() (*EnumRiskPolicyResultLevel, bool)` GetLevelOk returns a tuple with the Level field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetLevel -`func (o *RiskPolicyResult) SetLevel(v EnumRiskLevel)` +`func (o *RiskPolicyResult) SetLevel(v EnumRiskPolicyResultLevel)` SetLevel sets Level field to given value. @@ -72,31 +71,6 @@ SetType sets Type field to given value. HasType returns a boolean if a field has been set. -### GetValue - -`func (o *RiskPolicyResult) GetValue() string` - -GetValue returns the Value field if non-nil, zero value otherwise. - -### GetValueOk - -`func (o *RiskPolicyResult) GetValueOk() (*string, bool)` - -GetValueOk returns a tuple with the Value field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetValue - -`func (o *RiskPolicyResult) SetValue(v string)` - -SetValue sets Value field to given value. - -### HasValue - -`func (o *RiskPolicyResult) HasValue() bool` - -HasValue returns a boolean if a field has been set. - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/risk/go.mod b/risk/go.mod index 3e665c94..9c7b3040 100644 --- a/risk/go.mod +++ b/risk/go.mod @@ -2,4 +2,4 @@ module github.com/patrickcping/pingone-go-sdk-v2/risk go 1.18 -require golang.org/x/exp v0.0.0-20230515195305-f3d0a9c9a5cc +require golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 diff --git a/risk/go.sum b/risk/go.sum index 7cb94fb2..001575fc 100644 --- a/risk/go.sum +++ b/risk/go.sum @@ -1,2 +1,2 @@ -golang.org/x/exp v0.0.0-20230515195305-f3d0a9c9a5cc h1:mCRnTeVUjcrhlRmO0VK8a6k6Rrf6TF9htwo2pJVSjIU= -golang.org/x/exp v0.0.0-20230515195305-f3d0a9c9a5cc/go.mod h1:V1LtkGg67GoY2N1AnLN78QLrzxkLyJw7RJb1gzOOz9w= +golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 h1:k/i9J1pBpvlfR+9QsetwPyERsqu1GIbi967PQMq3Ivc= +golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1/go.mod h1:V1LtkGg67GoY2N1AnLN78QLrzxkLyJw7RJb1gzOOz9w= diff --git a/risk/model_enum_risk_policy_result_level.go b/risk/model_enum_risk_policy_result_level.go new file mode 100644 index 00000000..427b6c3d --- /dev/null +++ b/risk/model_enum_risk_policy_result_level.go @@ -0,0 +1,109 @@ +/* +PingOne Platform API - PingOne Risk + +The PingOne Platform API covering the PingOne Risk service + +API version: 2021-10-17 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package risk + +import ( + "encoding/json" + "fmt" +) + +// EnumRiskPolicyResultLevel Contains the default result level returned if none of the conditions in the policy are evaluated to true. At this time, the value must be `LOW`. +type EnumRiskPolicyResultLevel string + +// List of EnumRiskPolicyResultLevel +const ( + ENUMRISKPOLICYRESULTLEVEL_LOW EnumRiskPolicyResultLevel = "LOW" +) + +// All allowed values of EnumRiskPolicyResultLevel enum +var AllowedEnumRiskPolicyResultLevelEnumValues = []EnumRiskPolicyResultLevel{ + "LOW", +} + +func (v *EnumRiskPolicyResultLevel) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := EnumRiskPolicyResultLevel(value) + for _, existing := range AllowedEnumRiskPolicyResultLevelEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid EnumRiskPolicyResultLevel", value) +} + +// NewEnumRiskPolicyResultLevelFromValue returns a pointer to a valid EnumRiskPolicyResultLevel +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewEnumRiskPolicyResultLevelFromValue(v string) (*EnumRiskPolicyResultLevel, error) { + ev := EnumRiskPolicyResultLevel(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for EnumRiskPolicyResultLevel: valid values are %v", v, AllowedEnumRiskPolicyResultLevelEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v EnumRiskPolicyResultLevel) IsValid() bool { + for _, existing := range AllowedEnumRiskPolicyResultLevelEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to EnumRiskPolicyResultLevel value +func (v EnumRiskPolicyResultLevel) Ptr() *EnumRiskPolicyResultLevel { + return &v +} + +type NullableEnumRiskPolicyResultLevel struct { + value *EnumRiskPolicyResultLevel + isSet bool +} + +func (v NullableEnumRiskPolicyResultLevel) Get() *EnumRiskPolicyResultLevel { + return v.value +} + +func (v *NullableEnumRiskPolicyResultLevel) Set(val *EnumRiskPolicyResultLevel) { + v.value = val + v.isSet = true +} + +func (v NullableEnumRiskPolicyResultLevel) IsSet() bool { + return v.isSet +} + +func (v *NullableEnumRiskPolicyResultLevel) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEnumRiskPolicyResultLevel(val *EnumRiskPolicyResultLevel) *NullableEnumRiskPolicyResultLevel { + return &NullableEnumRiskPolicyResultLevel{value: val, isSet: true} +} + +func (v NullableEnumRiskPolicyResultLevel) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEnumRiskPolicyResultLevel) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/risk/model_risk_policy_result.go b/risk/model_risk_policy_result.go index e0a65f09..39d5d369 100644 --- a/risk/model_risk_policy_result.go +++ b/risk/model_risk_policy_result.go @@ -17,18 +17,17 @@ import ( // checks if the RiskPolicyResult type satisfies the MappedNullable interface at compile time var _ MappedNullable = &RiskPolicyResult{} -// RiskPolicyResult struct for RiskPolicyResult +// RiskPolicyResult A result object that specifies the result returned if the policy is evaluated as true. If several policies are evaluated as true, the result related to the highest priority policy is returned. for more information, see the Result attribute data model in the Risk Evaluations topic. type RiskPolicyResult struct { - Level EnumRiskLevel `json:"level"` + Level EnumRiskPolicyResultLevel `json:"level"` Type *EnumResultType `json:"type,omitempty"` - Value *string `json:"value,omitempty"` } // NewRiskPolicyResult instantiates a new RiskPolicyResult object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewRiskPolicyResult(level EnumRiskLevel) *RiskPolicyResult { +func NewRiskPolicyResult(level EnumRiskPolicyResultLevel) *RiskPolicyResult { this := RiskPolicyResult{} this.Level = level return &this @@ -43,9 +42,9 @@ func NewRiskPolicyResultWithDefaults() *RiskPolicyResult { } // GetLevel returns the Level field value -func (o *RiskPolicyResult) GetLevel() EnumRiskLevel { +func (o *RiskPolicyResult) GetLevel() EnumRiskPolicyResultLevel { if o == nil { - var ret EnumRiskLevel + var ret EnumRiskPolicyResultLevel return ret } @@ -54,7 +53,7 @@ func (o *RiskPolicyResult) GetLevel() EnumRiskLevel { // GetLevelOk returns a tuple with the Level field value // and a boolean to check if the value has been set. -func (o *RiskPolicyResult) GetLevelOk() (*EnumRiskLevel, bool) { +func (o *RiskPolicyResult) GetLevelOk() (*EnumRiskPolicyResultLevel, bool) { if o == nil { return nil, false } @@ -62,7 +61,7 @@ func (o *RiskPolicyResult) GetLevelOk() (*EnumRiskLevel, bool) { } // SetLevel sets field value -func (o *RiskPolicyResult) SetLevel(v EnumRiskLevel) { +func (o *RiskPolicyResult) SetLevel(v EnumRiskPolicyResultLevel) { o.Level = v } @@ -98,38 +97,6 @@ func (o *RiskPolicyResult) SetType(v EnumResultType) { o.Type = &v } -// GetValue returns the Value field value if set, zero value otherwise. -func (o *RiskPolicyResult) GetValue() string { - if o == nil || IsNil(o.Value) { - var ret string - return ret - } - return *o.Value -} - -// GetValueOk returns a tuple with the Value field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *RiskPolicyResult) GetValueOk() (*string, bool) { - if o == nil || IsNil(o.Value) { - return nil, false - } - return o.Value, true -} - -// HasValue returns a boolean if a field has been set. -func (o *RiskPolicyResult) HasValue() bool { - if o != nil && !IsNil(o.Value) { - return true - } - - return false -} - -// SetValue gets a reference to the given string and assigns it to the Value field. -func (o *RiskPolicyResult) SetValue(v string) { - o.Value = &v -} - func (o RiskPolicyResult) MarshalJSON() ([]byte, error) { toSerialize,err := o.ToMap() if err != nil { @@ -144,9 +111,6 @@ func (o RiskPolicyResult) ToMap() (map[string]interface{}, error) { if !IsNil(o.Type) { toSerialize["type"] = o.Type } - if !IsNil(o.Value) { - toSerialize["value"] = o.Value - } return toSerialize, nil }