Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AuthN Mapping spec cleanup to match implementation #1507

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.2",
"regenerated": "2022-05-20 17:09:19.398639",
"spec_repo_commit": "37954eaf"
"regenerated": "2022-05-23 07:09:54.505653",
"spec_repo_commit": "4797abcd"
},
"v2": {
"apigentools_version": "1.6.2",
"regenerated": "2022-05-20 17:09:19.413235",
"spec_repo_commit": "37954eaf"
"regenerated": "2022-05-23 07:09:54.518470",
"spec_repo_commit": "4797abcd"
}
}
}
33 changes: 16 additions & 17 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -850,11 +850,6 @@ components:
description: ID of the AuthN Mapping.
example: 3653d3c6-0c75-11ea-ad28-fb5701eabc7d
type: string
included:
description: Included data in the AuthN Mapping response.
items:
$ref: '#/components/schemas/AuthNMappingIncluded'
type: array
relationships:
$ref: '#/components/schemas/AuthNMappingRelationships'
type:
Expand Down Expand Up @@ -888,10 +883,8 @@ components:
type: string
saml_assertion_attribute_id:
description: The ID of the SAML assertion attribute.
example: 0
format: int32
maximum: 2147483647
type: integer
example: '0'
type: string
type: object
AuthNMappingCreateAttributes:
description: Key/Value pair of attributes used for create request.
Expand Down Expand Up @@ -953,6 +946,11 @@ components:
properties:
data:
$ref: '#/components/schemas/AuthNMapping'
included:
description: Included data in the AuthN Mapping response.
items:
$ref: '#/components/schemas/AuthNMappingIncluded'
type: array
type: object
AuthNMappingUpdateAttributes:
description: Key/Value pair of attributes used for update request.
Expand Down Expand Up @@ -1007,6 +1005,11 @@ components:
items:
$ref: '#/components/schemas/AuthNMapping'
type: array
included:
description: Included data in the AuthN Mapping response.
items:
$ref: '#/components/schemas/AuthNMappingIncluded'
type: array
meta:
$ref: '#/components/schemas/ResponseMetaAttributes'
type: object
Expand Down Expand Up @@ -5473,10 +5476,8 @@ components:
properties:
id:
description: The ID of the SAML assertion attribute.
example: 0
format: int32
maximum: 2147483647
type: integer
example: '0'
type: string
type:
$ref: '#/components/schemas/SAMLAssertionAttributesType'
required:
Expand Down Expand Up @@ -5778,10 +5779,8 @@ components:
$ref: '#/components/schemas/SAMLAssertionAttributeAttributes'
id:
description: The ID of the SAML assertion attribute.
example: 0
format: int32
maximum: 2147483647
type: integer
example: '0'
type: string
type:
$ref: '#/components/schemas/SAMLAssertionAttributesType'
required:
Expand Down
39 changes: 0 additions & 39 deletions api/v2/datadog/model_auth_n_mapping.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ type AuthNMapping struct {
Attributes *AuthNMappingAttributes `json:"attributes,omitempty"`
// ID of the AuthN Mapping.
Id string `json:"id"`
// Included data in the AuthN Mapping response.
Included []AuthNMappingIncluded `json:"included,omitempty"`
// All relationships associated with AuthN Mapping.
Relationships *AuthNMappingRelationships `json:"relationships,omitempty"`
// AuthN Mappings resource type.
Expand Down Expand Up @@ -104,38 +102,6 @@ func (o *AuthNMapping) SetId(v string) {
o.Id = v
}

// GetIncluded returns the Included field value if set, zero value otherwise.
func (o *AuthNMapping) GetIncluded() []AuthNMappingIncluded {
if o == nil || o.Included == nil {
var ret []AuthNMappingIncluded
return ret
}
return o.Included
}

// GetIncludedOk returns a tuple with the Included field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AuthNMapping) GetIncludedOk() (*[]AuthNMappingIncluded, bool) {
if o == nil || o.Included == nil {
return nil, false
}
return &o.Included, true
}

// HasIncluded returns a boolean if a field has been set.
func (o *AuthNMapping) HasIncluded() bool {
if o != nil && o.Included != nil {
return true
}

return false
}

// SetIncluded gets a reference to the given []AuthNMappingIncluded and assigns it to the Included field.
func (o *AuthNMapping) SetIncluded(v []AuthNMappingIncluded) {
o.Included = v
}

// GetRelationships returns the Relationships field value if set, zero value otherwise.
func (o *AuthNMapping) GetRelationships() AuthNMappingRelationships {
if o == nil || o.Relationships == nil {
Expand Down Expand Up @@ -200,9 +166,6 @@ func (o AuthNMapping) MarshalJSON() ([]byte, error) {
toSerialize["attributes"] = o.Attributes
}
toSerialize["id"] = o.Id
if o.Included != nil {
toSerialize["included"] = o.Included
}
if o.Relationships != nil {
toSerialize["relationships"] = o.Relationships
}
Expand All @@ -223,7 +186,6 @@ func (o *AuthNMapping) UnmarshalJSON(bytes []byte) (err error) {
all := struct {
Attributes *AuthNMappingAttributes `json:"attributes,omitempty"`
Id string `json:"id"`
Included []AuthNMappingIncluded `json:"included,omitempty"`
Relationships *AuthNMappingRelationships `json:"relationships,omitempty"`
Type AuthNMappingsType `json:"type"`
}{}
Expand Down Expand Up @@ -263,7 +225,6 @@ func (o *AuthNMapping) UnmarshalJSON(bytes []byte) (err error) {
}
o.Attributes = all.Attributes
o.Id = all.Id
o.Included = all.Included
if all.Relationships != nil && all.Relationships.UnparsedObject != nil && o.UnparsedObject == nil {
err = json.Unmarshal(bytes, &raw)
if err != nil {
Expand Down
14 changes: 7 additions & 7 deletions api/v2/datadog/model_auth_n_mapping_attributes.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ type AuthNMappingAttributes struct {
// Time of last AuthN Mapping modification.
ModifiedAt *time.Time `json:"modified_at,omitempty"`
// The ID of the SAML assertion attribute.
SamlAssertionAttributeId *int32 `json:"saml_assertion_attribute_id,omitempty"`
SamlAssertionAttributeId *string `json:"saml_assertion_attribute_id,omitempty"`
// UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct
UnparsedObject map[string]interface{} `json:-`
AdditionalProperties map[string]interface{}
Expand Down Expand Up @@ -174,17 +174,17 @@ func (o *AuthNMappingAttributes) SetModifiedAt(v time.Time) {
}

// GetSamlAssertionAttributeId returns the SamlAssertionAttributeId field value if set, zero value otherwise.
func (o *AuthNMappingAttributes) GetSamlAssertionAttributeId() int32 {
func (o *AuthNMappingAttributes) GetSamlAssertionAttributeId() string {
if o == nil || o.SamlAssertionAttributeId == nil {
var ret int32
var ret string
return ret
}
return *o.SamlAssertionAttributeId
}

// GetSamlAssertionAttributeIdOk returns a tuple with the SamlAssertionAttributeId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AuthNMappingAttributes) GetSamlAssertionAttributeIdOk() (*int32, bool) {
func (o *AuthNMappingAttributes) GetSamlAssertionAttributeIdOk() (*string, bool) {
if o == nil || o.SamlAssertionAttributeId == nil {
return nil, false
}
Expand All @@ -200,8 +200,8 @@ func (o *AuthNMappingAttributes) HasSamlAssertionAttributeId() bool {
return false
}

// SetSamlAssertionAttributeId gets a reference to the given int32 and assigns it to the SamlAssertionAttributeId field.
func (o *AuthNMappingAttributes) SetSamlAssertionAttributeId(v int32) {
// SetSamlAssertionAttributeId gets a reference to the given string and assigns it to the SamlAssertionAttributeId field.
func (o *AuthNMappingAttributes) SetSamlAssertionAttributeId(v string) {
o.SamlAssertionAttributeId = &v
}

Expand Down Expand Up @@ -247,7 +247,7 @@ func (o *AuthNMappingAttributes) UnmarshalJSON(bytes []byte) (err error) {
AttributeValue *string `json:"attribute_value,omitempty"`
CreatedAt *time.Time `json:"created_at,omitempty"`
ModifiedAt *time.Time `json:"modified_at,omitempty"`
SamlAssertionAttributeId *int32 `json:"saml_assertion_attribute_id,omitempty"`
SamlAssertionAttributeId *string `json:"saml_assertion_attribute_id,omitempty"`
}{}
err = json.Unmarshal(bytes, &all)
if err != nil {
Expand Down
41 changes: 40 additions & 1 deletion api/v2/datadog/model_auth_n_mapping_response.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ import (
type AuthNMappingResponse struct {
// The AuthN Mapping object returned by API.
Data *AuthNMapping `json:"data,omitempty"`
// Included data in the AuthN Mapping response.
Included []AuthNMappingIncluded `json:"included,omitempty"`
// UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct
UnparsedObject map[string]interface{} `json:-`
AdditionalProperties map[string]interface{}
Expand Down Expand Up @@ -68,6 +70,38 @@ func (o *AuthNMappingResponse) SetData(v AuthNMapping) {
o.Data = &v
}

// GetIncluded returns the Included field value if set, zero value otherwise.
func (o *AuthNMappingResponse) GetIncluded() []AuthNMappingIncluded {
if o == nil || o.Included == nil {
var ret []AuthNMappingIncluded
return ret
}
return o.Included
}

// GetIncludedOk returns a tuple with the Included field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AuthNMappingResponse) GetIncludedOk() (*[]AuthNMappingIncluded, bool) {
if o == nil || o.Included == nil {
return nil, false
}
return &o.Included, true
}

// HasIncluded returns a boolean if a field has been set.
func (o *AuthNMappingResponse) HasIncluded() bool {
if o != nil && o.Included != nil {
return true
}

return false
}

// SetIncluded gets a reference to the given []AuthNMappingIncluded and assigns it to the Included field.
func (o *AuthNMappingResponse) SetIncluded(v []AuthNMappingIncluded) {
o.Included = v
}

func (o AuthNMappingResponse) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.UnparsedObject != nil {
Expand All @@ -76,6 +110,9 @@ func (o AuthNMappingResponse) MarshalJSON() ([]byte, error) {
if o.Data != nil {
toSerialize["data"] = o.Data
}
if o.Included != nil {
toSerialize["included"] = o.Included
}

for key, value := range o.AdditionalProperties {
toSerialize[key] = value
Expand All @@ -86,7 +123,8 @@ func (o AuthNMappingResponse) MarshalJSON() ([]byte, error) {
func (o *AuthNMappingResponse) UnmarshalJSON(bytes []byte) (err error) {
raw := map[string]interface{}{}
all := struct {
Data *AuthNMapping `json:"data,omitempty"`
Data *AuthNMapping `json:"data,omitempty"`
Included []AuthNMappingIncluded `json:"included,omitempty"`
}{}
err = json.Unmarshal(bytes, &all)
if err != nil {
Expand All @@ -105,5 +143,6 @@ func (o *AuthNMappingResponse) UnmarshalJSON(bytes []byte) (err error) {
o.UnparsedObject = raw
}
o.Data = all.Data
o.Included = all.Included
return nil
}
43 changes: 41 additions & 2 deletions api/v2/datadog/model_auth_n_mappings_response.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ import (
type AuthNMappingsResponse struct {
// Array of returned AuthN Mappings.
Data []AuthNMapping `json:"data,omitempty"`
// Included data in the AuthN Mapping response.
Included []AuthNMappingIncluded `json:"included,omitempty"`
// Object describing meta attributes of response.
Meta *ResponseMetaAttributes `json:"meta,omitempty"`
// UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct
Expand Down Expand Up @@ -70,6 +72,38 @@ func (o *AuthNMappingsResponse) SetData(v []AuthNMapping) {
o.Data = v
}

// GetIncluded returns the Included field value if set, zero value otherwise.
func (o *AuthNMappingsResponse) GetIncluded() []AuthNMappingIncluded {
if o == nil || o.Included == nil {
var ret []AuthNMappingIncluded
return ret
}
return o.Included
}

// GetIncludedOk returns a tuple with the Included field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AuthNMappingsResponse) GetIncludedOk() (*[]AuthNMappingIncluded, bool) {
if o == nil || o.Included == nil {
return nil, false
}
return &o.Included, true
}

// HasIncluded returns a boolean if a field has been set.
func (o *AuthNMappingsResponse) HasIncluded() bool {
if o != nil && o.Included != nil {
return true
}

return false
}

// SetIncluded gets a reference to the given []AuthNMappingIncluded and assigns it to the Included field.
func (o *AuthNMappingsResponse) SetIncluded(v []AuthNMappingIncluded) {
o.Included = v
}

// GetMeta returns the Meta field value if set, zero value otherwise.
func (o *AuthNMappingsResponse) GetMeta() ResponseMetaAttributes {
if o == nil || o.Meta == nil {
Expand Down Expand Up @@ -110,6 +144,9 @@ func (o AuthNMappingsResponse) MarshalJSON() ([]byte, error) {
if o.Data != nil {
toSerialize["data"] = o.Data
}
if o.Included != nil {
toSerialize["included"] = o.Included
}
if o.Meta != nil {
toSerialize["meta"] = o.Meta
}
Expand All @@ -123,8 +160,9 @@ func (o AuthNMappingsResponse) MarshalJSON() ([]byte, error) {
func (o *AuthNMappingsResponse) UnmarshalJSON(bytes []byte) (err error) {
raw := map[string]interface{}{}
all := struct {
Data []AuthNMapping `json:"data,omitempty"`
Meta *ResponseMetaAttributes `json:"meta,omitempty"`
Data []AuthNMapping `json:"data,omitempty"`
Included []AuthNMappingIncluded `json:"included,omitempty"`
Meta *ResponseMetaAttributes `json:"meta,omitempty"`
}{}
err = json.Unmarshal(bytes, &all)
if err != nil {
Expand All @@ -136,6 +174,7 @@ func (o *AuthNMappingsResponse) UnmarshalJSON(bytes []byte) (err error) {
return nil
}
o.Data = all.Data
o.Included = all.Included
if all.Meta != nil && all.Meta.UnparsedObject != nil && o.UnparsedObject == nil {
err = json.Unmarshal(bytes, &raw)
if err != nil {
Expand Down
Loading