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

Enable route for auto merging. #2596

Closed
Closed
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.6",
"regenerated": "2024-07-26 19:06:16.771423",
"spec_repo_commit": "44cf4afe"
"regenerated": "2024-07-30 15:00:21.508898",
"spec_repo_commit": "641cbbcf"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2024-07-26 19:06:16.789960",
"spec_repo_commit": "44cf4afe"
"regenerated": "2024-07-30 15:00:21.527020",
"spec_repo_commit": "641cbbcf"
}
}
}
8 changes: 8 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14853,11 +14853,13 @@ components:
$ref: '#/components/schemas/PermissionAttributes'
id:
description: ID of the permission.
example: '219'
type: string
type:
$ref: '#/components/schemas/PermissionsType'
required:
- type
- id
type: object
PermissionAttributes:
description: Attributes of a permission.
Expand Down Expand Up @@ -16471,15 +16473,21 @@ components:
properties:
data:
$ref: '#/components/schemas/RelationshipToPermissionData'
required:
- data
type: object
RelationshipToPermissionData:
description: Relationship to permission object.
properties:
id:
description: ID of the permission.
example: '219'
type: string
type:
$ref: '#/components/schemas/PermissionsType'
required:
- id
- type
type: object
RelationshipToPermissions:
description: Relationship to multiple permissions objects.
Expand Down
37 changes: 17 additions & 20 deletions api/datadogV2/model_permission.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type Permission struct {
// Attributes of a permission.
Attributes *PermissionAttributes `json:"attributes,omitempty"`
// ID of the permission.
Id *string `json:"id,omitempty"`
Id string `json:"id"`
// Permissions resource type.
Type PermissionsType `json:"type"`
// UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct
Expand All @@ -27,8 +27,9 @@ type Permission struct {
// 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 NewPermission(typeVar PermissionsType) *Permission {
func NewPermission(id string, typeVar PermissionsType) *Permission {
this := Permission{}
this.Id = id
this.Type = typeVar
return &this
}
Expand Down Expand Up @@ -71,32 +72,27 @@ func (o *Permission) SetAttributes(v PermissionAttributes) {
o.Attributes = &v
}

// GetId returns the Id field value if set, zero value otherwise.
// GetId returns the Id field value.
func (o *Permission) GetId() string {
if o == nil || o.Id == nil {
if o == nil {
var ret string
return ret
}
return *o.Id
return o.Id
}

// GetIdOk returns a tuple with the Id field value if set, nil otherwise
// GetIdOk returns a tuple with the Id field value
// and a boolean to check if the value has been set.
func (o *Permission) GetIdOk() (*string, bool) {
if o == nil || o.Id == nil {
if o == nil {
return nil, false
}
return o.Id, true
}

// HasId returns a boolean if a field has been set.
func (o *Permission) HasId() bool {
return o != nil && o.Id != nil
return &o.Id, true
}

// SetId gets a reference to the given string and assigns it to the Id field.
// SetId sets field value.
func (o *Permission) SetId(v string) {
o.Id = &v
o.Id = v
}

// GetType returns the Type field value.
Expand Down Expand Up @@ -131,9 +127,7 @@ func (o Permission) MarshalJSON() ([]byte, error) {
if o.Attributes != nil {
toSerialize["attributes"] = o.Attributes
}
if o.Id != nil {
toSerialize["id"] = o.Id
}
toSerialize["id"] = o.Id
toSerialize["type"] = o.Type

for key, value := range o.AdditionalProperties {
Expand All @@ -146,12 +140,15 @@ func (o Permission) MarshalJSON() ([]byte, error) {
func (o *Permission) UnmarshalJSON(bytes []byte) (err error) {
all := struct {
Attributes *PermissionAttributes `json:"attributes,omitempty"`
Id *string `json:"id,omitempty"`
Id *string `json:"id"`
Type *PermissionsType `json:"type"`
}{}
if err = datadog.Unmarshal(bytes, &all); err != nil {
return datadog.Unmarshal(bytes, &o.UnparsedObject)
}
if all.Id == nil {
return fmt.Errorf("required field id missing")
}
if all.Type == nil {
return fmt.Errorf("required field type missing")
}
Expand All @@ -167,7 +164,7 @@ func (o *Permission) UnmarshalJSON(bytes []byte) (err error) {
hasInvalidField = true
}
o.Attributes = all.Attributes
o.Id = all.Id
o.Id = *all.Id
if !all.Type.IsValid() {
hasInvalidField = true
} else {
Expand Down
41 changes: 20 additions & 21 deletions api/datadogV2/model_relationship_to_permission.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@
package datadogV2

import (
"fmt"

"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
)

// RelationshipToPermission Relationship to a permissions object.
type RelationshipToPermission struct {
// Relationship to permission object.
Data *RelationshipToPermissionData `json:"data,omitempty"`
Data RelationshipToPermissionData `json:"data"`
// 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 All @@ -21,8 +23,9 @@ type RelationshipToPermission struct {
// 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 NewRelationshipToPermission() *RelationshipToPermission {
func NewRelationshipToPermission(data RelationshipToPermissionData) *RelationshipToPermission {
this := RelationshipToPermission{}
this.Data = data
return &this
}

Expand All @@ -34,32 +37,27 @@ func NewRelationshipToPermissionWithDefaults() *RelationshipToPermission {
return &this
}

// GetData returns the Data field value if set, zero value otherwise.
// GetData returns the Data field value.
func (o *RelationshipToPermission) GetData() RelationshipToPermissionData {
if o == nil || o.Data == nil {
if o == nil {
var ret RelationshipToPermissionData
return ret
}
return *o.Data
return o.Data
}

// GetDataOk returns a tuple with the Data field value if set, nil otherwise
// GetDataOk returns a tuple with the Data field value
// and a boolean to check if the value has been set.
func (o *RelationshipToPermission) GetDataOk() (*RelationshipToPermissionData, bool) {
if o == nil || o.Data == nil {
if o == nil {
return nil, false
}
return o.Data, true
}

// HasData returns a boolean if a field has been set.
func (o *RelationshipToPermission) HasData() bool {
return o != nil && o.Data != nil
return &o.Data, true
}

// SetData gets a reference to the given RelationshipToPermissionData and assigns it to the Data field.
// SetData sets field value.
func (o *RelationshipToPermission) SetData(v RelationshipToPermissionData) {
o.Data = &v
o.Data = v
}

// MarshalJSON serializes the struct using spec logic.
Expand All @@ -68,9 +66,7 @@ func (o RelationshipToPermission) MarshalJSON() ([]byte, error) {
if o.UnparsedObject != nil {
return datadog.Marshal(o.UnparsedObject)
}
if o.Data != nil {
toSerialize["data"] = o.Data
}
toSerialize["data"] = o.Data

for key, value := range o.AdditionalProperties {
toSerialize[key] = value
Expand All @@ -81,11 +77,14 @@ func (o RelationshipToPermission) MarshalJSON() ([]byte, error) {
// UnmarshalJSON deserializes the given payload.
func (o *RelationshipToPermission) UnmarshalJSON(bytes []byte) (err error) {
all := struct {
Data *RelationshipToPermissionData `json:"data,omitempty"`
Data *RelationshipToPermissionData `json:"data"`
}{}
if err = datadog.Unmarshal(bytes, &all); err != nil {
return datadog.Unmarshal(bytes, &o.UnparsedObject)
}
if all.Data == nil {
return fmt.Errorf("required field data missing")
}
additionalProperties := make(map[string]interface{})
if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil {
datadog.DeleteKeys(additionalProperties, &[]string{"data"})
Expand All @@ -94,10 +93,10 @@ func (o *RelationshipToPermission) UnmarshalJSON(bytes []byte) (err error) {
}

hasInvalidField := false
if all.Data != nil && all.Data.UnparsedObject != nil && o.UnparsedObject == nil {
if all.Data.UnparsedObject != nil && o.UnparsedObject == nil {
hasInvalidField = true
}
o.Data = all.Data
o.Data = *all.Data

if len(additionalProperties) > 0 {
o.AdditionalProperties = additionalProperties
Expand Down
Loading
Loading