Skip to content

Commit 80dcb77

Browse files
authored
fix: CreateGroupPushMappingRequest accept Appconfig as pointer (#584)
1 parent 5484043 commit 80dcb77

9 files changed

Lines changed: 38 additions & 53 deletions

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30023,8 +30023,6 @@ components:
3002330023
type:
3002430024
type: string
3002530025
$ref: '#/components/schemas/AppConfigType'
30026-
required:
30027-
- type
3002830026
discriminator:
3002930027
propertyName: type
3003030028
mapping:
@@ -34324,7 +34322,6 @@ components:
3432434322
type: object
3432534323
properties:
3432634324
appConfig:
34327-
type: object
3432834325
$ref: '#/components/schemas/AppConfig'
3432934326
sourceGroupId:
3433034327
description: The ID of the source group for the group push mapping

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.2
9+
- Package version: 6.1.3
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 & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48363,8 +48363,6 @@ components:
4836348363
type: string
4836448364
x-okta-known-values:
4836548365
- ACTIVE_DIRECTORY
48366-
required:
48367-
- type
4836848366
type: object
4836948367
AppConfigActiveDirectory:
4837048368
allOf:

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.2"
71+
VERSION = "6.1.3"
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.2", runtime.Version(), runtime.GOOS, runtime.GOARCH),
168+
UserAgent: fmt.Sprintf("okta-sdk-golang/%s golang/%s %s/%s", "6.1.3", runtime.Version(), runtime.GOOS, runtime.GOARCH),
169169
Debug: false,
170170
Servers: ServerConfigurations{
171171
{

okta/docs/AppConfig.md

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

55
Name | Type | Description | Notes
66
------------ | ------------- | ------------- | -------------
7-
**Type** | **string** | The type of the app configuration |
7+
**Type** | Pointer to **string** | The type of the app configuration | [optional]
88

99
## Methods
1010

1111
### NewAppConfig
1212

13-
`func NewAppConfig(type_ string, ) *AppConfig`
13+
`func NewAppConfig() *AppConfig`
1414

1515
NewAppConfig instantiates a new AppConfig object
1616
This constructor will assign default values to properties that have it defined,
@@ -44,6 +44,11 @@ and a boolean to check if the value has been set.
4444

4545
SetType sets Type field to given value.
4646

47+
### HasType
48+
49+
`func (o *AppConfig) HasType() bool`
50+
51+
HasType returns a boolean if a field has been set.
4752

4853

4954
[[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_app_config.go

Lines changed: 22 additions & 35 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 AppConfig type satisfies the MappedNullable interface at compile time
@@ -34,7 +33,7 @@ var _ MappedNullable = &AppConfig{}
3433
// AppConfig Additional app configuration for group push mappings. Currently only required for Active Directory.
3534
type AppConfig struct {
3635
// The type of the app configuration
37-
Type string `json:"type"`
36+
Type *string `json:"type,omitempty"`
3837
AdditionalProperties map[string]interface{}
3938
}
4039

@@ -44,9 +43,8 @@ type _AppConfig AppConfig
4443
// This constructor will assign default values to properties that have it defined,
4544
// and makes sure properties required by API are set, but the set of arguments
4645
// will change when the set of required properties is changed
47-
func NewAppConfig(type_ string) *AppConfig {
46+
func NewAppConfig() *AppConfig {
4847
this := AppConfig{}
49-
this.Type = type_
5048
return &this
5149
}
5250

@@ -58,28 +56,36 @@ func NewAppConfigWithDefaults() *AppConfig {
5856
return &this
5957
}
6058

61-
// GetType returns the Type field value
59+
// GetType returns the Type field value if set, zero value otherwise.
6260
func (o *AppConfig) GetType() string {
63-
if o == nil {
61+
if o == nil || IsNil(o.Type) {
6462
var ret string
6563
return ret
6664
}
67-
68-
return o.Type
65+
return *o.Type
6966
}
7067

71-
// GetTypeOk returns a tuple with the Type field value
68+
// GetTypeOk returns a tuple with the Type field value if set, nil otherwise
7269
// and a boolean to check if the value has been set.
7370
func (o *AppConfig) GetTypeOk() (*string, bool) {
74-
if o == nil {
71+
if o == nil || IsNil(o.Type) {
7572
return nil, false
7673
}
77-
return &o.Type, true
74+
return o.Type, true
75+
}
76+
77+
// HasType returns a boolean if a field has been set.
78+
func (o *AppConfig) HasType() bool {
79+
if o != nil && !IsNil(o.Type) {
80+
return true
81+
}
82+
83+
return false
7884
}
7985

80-
// SetType sets field value
86+
// SetType gets a reference to the given string and assigns it to the Type field.
8187
func (o *AppConfig) SetType(v string) {
82-
o.Type = v
88+
o.Type = &v
8389
}
8490

8591
func (o AppConfig) MarshalJSON() ([]byte, error) {
@@ -92,7 +98,9 @@ func (o AppConfig) MarshalJSON() ([]byte, error) {
9298

9399
func (o AppConfig) ToMap() (map[string]interface{}, error) {
94100
toSerialize := map[string]interface{}{}
95-
toSerialize["type"] = o.Type
101+
if !IsNil(o.Type) {
102+
toSerialize["type"] = o.Type
103+
}
96104

97105
for key, value := range o.AdditionalProperties {
98106
toSerialize[key] = value
@@ -102,27 +110,6 @@ func (o AppConfig) ToMap() (map[string]interface{}, error) {
102110
}
103111

104112
func (o *AppConfig) UnmarshalJSON(data []byte) (err error) {
105-
// This validates that all required properties are included in the JSON object
106-
// by unmarshalling the object into a generic map with string keys and checking
107-
// that every required field exists as a key in the generic map.
108-
requiredProperties := []string{
109-
"type",
110-
}
111-
112-
allProperties := make(map[string]interface{})
113-
114-
err = json.Unmarshal(data, &allProperties)
115-
116-
if err != nil {
117-
return err
118-
}
119-
120-
for _, requiredProperty := range requiredProperties {
121-
if _, exists := allProperties[requiredProperty]; !exists {
122-
return fmt.Errorf("no value given for required property %v", requiredProperty)
123-
}
124-
}
125-
126113
varAppConfig := _AppConfig{}
127114

128115
err = json.Unmarshal(data, &varAppConfig)

okta/model_app_config_active_directory.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,8 @@ type _AppConfigActiveDirectory AppConfigActiveDirectory
5353
// This constructor will assign default values to properties that have it defined,
5454
// and makes sure properties required by API are set, but the set of arguments
5555
// will change when the set of required properties is changed
56-
func NewAppConfigActiveDirectory(distinguishedName string, groupScope string, groupType string, samAccountName string, type_ string) *AppConfigActiveDirectory {
56+
func NewAppConfigActiveDirectory(distinguishedName string, groupScope string, groupType string, samAccountName string) *AppConfigActiveDirectory {
5757
this := AppConfigActiveDirectory{}
58-
this.Type = type_
5958
return &this
6059
}
6160

@@ -202,7 +201,6 @@ func (o *AppConfigActiveDirectory) UnmarshalJSON(data []byte) (err error) {
202201
"groupScope",
203202
"groupType",
204203
"samAccountName",
205-
"type",
206204
}
207205

208206
allProperties := make(map[string]interface{})

okta/model_create_group_push_mapping_request.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ var _ MappedNullable = &CreateGroupPushMappingRequest{}
3333

3434
// CreateGroupPushMappingRequest struct for CreateGroupPushMappingRequest
3535
type CreateGroupPushMappingRequest struct {
36-
AppConfig AppConfig `json:"appConfig,omitempty"`
36+
AppConfig *AppConfig `json:"appConfig,omitempty"`
3737
// The ID of the source group for the group push mapping
3838
SourceGroupId string `json:"sourceGroupId"`
3939
// The status of the group push mapping
@@ -75,14 +75,14 @@ func (o *CreateGroupPushMappingRequest) GetAppConfig() AppConfig {
7575
var ret AppConfig
7676
return ret
7777
}
78-
return o.AppConfig
78+
return *o.AppConfig
7979
}
8080

8181
// GetAppConfigOk returns a tuple with the AppConfig field value if set, nil otherwise
8282
// and a boolean to check if the value has been set.
83-
func (o *CreateGroupPushMappingRequest) GetAppConfigOk() (AppConfig, bool) {
83+
func (o *CreateGroupPushMappingRequest) GetAppConfigOk() (*AppConfig, bool) {
8484
if o == nil || IsNil(o.AppConfig) {
85-
return AppConfig{}, false
85+
return nil, false
8686
}
8787
return o.AppConfig, true
8888
}
@@ -98,7 +98,7 @@ func (o *CreateGroupPushMappingRequest) HasAppConfig() bool {
9898

9999
// SetAppConfig gets a reference to the given AppConfig and assigns it to the AppConfig field.
100100
func (o *CreateGroupPushMappingRequest) SetAppConfig(v AppConfig) {
101-
o.AppConfig = v
101+
o.AppConfig = &v
102102
}
103103

104104
// GetSourceGroupId returns the SourceGroupId field value

0 commit comments

Comments
 (0)