Skip to content

Commit 4a4ccc6

Browse files
api-clients-generation-pipeline[bot]jirikuncarci.datadog-api-spec
authored
Mark required type fields in User and Roles API v2 (#467)
* Use constructor with default values * Regenerate client from commit 372420b of spec repo Co-authored-by: Jiri Kuncar <[email protected]> Co-authored-by: api-clients-generation-pipeline[bot] <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent ecbfb97 commit 4a4ccc6

File tree

10 files changed

+92
-133
lines changed

10 files changed

+92
-133
lines changed

.apigentools-info

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.2.0",
7-
"regenerated": "2020-09-17 09:15:32.112617",
8-
"spec_repo_commit": "2cc8a06"
7+
"regenerated": "2020-09-17 14:32:44.680678",
8+
"spec_repo_commit": "372420b"
99
},
1010
"v2": {
1111
"apigentools_version": "1.2.0",
12-
"regenerated": "2020-09-17 09:15:37.617382",
13-
"spec_repo_commit": "2cc8a06"
12+
"regenerated": "2020-09-17 14:32:49.615066",
13+
"spec_repo_commit": "372420b"
1414
}
1515
}
1616
}

api/v2/datadog/api/openapi.yaml

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3386,6 +3386,9 @@ components:
33863386
type: string
33873387
type:
33883388
$ref: '#/components/schemas/OrganizationsType'
3389+
required:
3390+
- id
3391+
- type
33893392
type: object
33903393
RelationshipToOrganizations:
33913394
description: Relationship to organizations.
@@ -3497,10 +3500,10 @@ components:
34973500
description: ID of the user.
34983501
type: string
34993502
type:
3500-
default: users
3501-
description: Users type.
3502-
readOnly: true
3503-
type: string
3503+
$ref: '#/components/schemas/UsersType'
3504+
required:
3505+
- id
3506+
- type
35043507
type: object
35053508
RelationshipToUsers:
35063509
description: Relationship to users.
@@ -4598,6 +4601,7 @@ components:
45984601
email: email
45994602
status: status
46004603
id: id
4604+
type: users
46014605
properties:
46024606
attributes:
46034607
$ref: '#/components/schemas/UserAttributes'
@@ -4682,6 +4686,7 @@ components:
46824686
name: name
46834687
title: title
46844688
email: email
4689+
type: users
46854690
properties:
46864691
attributes:
46874692
$ref: '#/components/schemas/UserCreateAttributes'
@@ -4705,6 +4710,7 @@ components:
47054710
name: name
47064711
title: title
47074712
email: email
4713+
type: users
47084714
properties:
47094715
data:
47104716
$ref: '#/components/schemas/UserCreateData'
@@ -4892,6 +4898,7 @@ components:
48924898
email: email
48934899
status: status
48944900
id: id
4901+
type: users
48954902
included:
48964903
- null
48974904
- null
@@ -4971,6 +4978,7 @@ components:
49714978
disabled: true
49724979
email: email
49734980
id: id
4981+
type: users
49744982
properties:
49754983
attributes:
49764984
$ref: '#/components/schemas/UserUpdateAttributes'
@@ -4989,6 +4997,7 @@ components:
49894997
disabled: true
49904998
email: email
49914999
id: id
5000+
type: users
49925001
properties:
49935002
data:
49945003
$ref: '#/components/schemas/UserUpdateData'
@@ -5031,6 +5040,7 @@ components:
50315040
email: email
50325041
status: status
50335042
id: id
5043+
type: users
50345044
- relationships:
50355045
other_users:
50365046
data:
@@ -5065,6 +5075,7 @@ components:
50655075
email: email
50665076
status: status
50675077
id: id
5078+
type: users
50685079
meta:
50695080
page:
50705081
total_count: 6
@@ -5091,6 +5102,7 @@ components:
50915102
description: Users resource type.
50925103
enum:
50935104
- users
5105+
example: users
50945106
type: string
50955107
x-enum-varnames:
50965108
- USERS

api/v2/datadog/docs/RelationshipToOrganizationData.md

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

55
Name | Type | Description | Notes
66
------------ | ------------- | ------------- | -------------
7-
**Id** | Pointer to **string** | ID of the organization. | [optional]
8-
**Type** | Pointer to [**OrganizationsType**](OrganizationsType.md) | | [optional] [default to "orgs"]
7+
**Id** | **string** | ID of the organization. |
8+
**Type** | [**OrganizationsType**](OrganizationsType.md) | | [default to "orgs"]
99

1010
## Methods
1111

1212
### NewRelationshipToOrganizationData
1313

14-
`func NewRelationshipToOrganizationData() *RelationshipToOrganizationData`
14+
`func NewRelationshipToOrganizationData(id string, type_ OrganizationsType, ) *RelationshipToOrganizationData`
1515

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

4646
SetId sets Id field to given value.
4747

48-
### HasId
49-
50-
`func (o *RelationshipToOrganizationData) HasId() bool`
51-
52-
HasId returns a boolean if a field has been set.
5348

5449
### GetType
5550

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

7166
SetType sets Type field to given value.
7267

73-
### HasType
74-
75-
`func (o *RelationshipToOrganizationData) HasType() bool`
76-
77-
HasType returns a boolean if a field has been set.
7868

7969

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

api/v2/datadog/docs/RelationshipToUserData.md

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

55
Name | Type | Description | Notes
66
------------ | ------------- | ------------- | -------------
7-
**Id** | Pointer to **string** | ID of the user. | [optional]
8-
**Type** | Pointer to **string** | Users type. | [optional] [readonly] [default to "users"]
7+
**Id** | **string** | ID of the user. |
8+
**Type** | [**UsersType**](UsersType.md) | | [default to "users"]
99

1010
## Methods
1111

1212
### NewRelationshipToUserData
1313

14-
`func NewRelationshipToUserData() *RelationshipToUserData`
14+
`func NewRelationshipToUserData(id string, type_ UsersType, ) *RelationshipToUserData`
1515

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

4646
SetId sets Id field to given value.
4747

48-
### HasId
49-
50-
`func (o *RelationshipToUserData) HasId() bool`
51-
52-
HasId returns a boolean if a field has been set.
5348

5449
### GetType
5550

56-
`func (o *RelationshipToUserData) GetType() string`
51+
`func (o *RelationshipToUserData) GetType() UsersType`
5752

5853
GetType returns the Type field if non-nil, zero value otherwise.
5954

6055
### GetTypeOk
6156

62-
`func (o *RelationshipToUserData) GetTypeOk() (*string, bool)`
57+
`func (o *RelationshipToUserData) GetTypeOk() (*UsersType, bool)`
6358

6459
GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise
6560
and a boolean to check if the value has been set.
6661

6762
### SetType
6863

69-
`func (o *RelationshipToUserData) SetType(v string)`
64+
`func (o *RelationshipToUserData) SetType(v UsersType)`
7065

7166
SetType sets Type field to given value.
7267

73-
### HasType
74-
75-
`func (o *RelationshipToUserData) HasType() bool`
76-
77-
HasType returns a boolean if a field has been set.
7868

7969

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

api/v2/datadog/docs/RolesApi.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ func main() {
139139
)
140140

141141
roleId := "roleId_example" // string | The ID of the role.
142-
body := datadog.RelationshipToUser{Data: datadog.RelationshipToUserData{Id: "Id_example", Type: "Type_example"}} // RelationshipToUser | (optional)
142+
body := datadog.RelationshipToUser{Data: datadog.RelationshipToUserData{Id: "Id_example", Type: datadog.UsersType{}}} // RelationshipToUser | (optional)
143143

144144
configuration := datadog.NewConfiguration()
145145
api_client := datadog.NewAPIClient(configuration)
@@ -223,7 +223,7 @@ func main() {
223223
},
224224
)
225225

226-
body := datadog.RoleCreateRequest{Data: datadog.RoleCreateData{Attributes: datadog.RoleCreateAttributes{CreatedAt: "TODO", ModifiedAt: "TODO", Name: "Name_example"}, Relationships: datadog.RoleRelationships{Permissions: datadog.RelationshipToPermissions{Data: []RelationshipToPermissionData{datadog.RelationshipToPermissionData{Id: "Id_example", Type: datadog.PermissionsType{}})}, Users: datadog.RelationshipToUsers{Data: []RelationshipToUserData{datadog.RelationshipToUserData{Id: "Id_example", Type: "Type_example"})}}, Type: datadog.RolesType{}}} // RoleCreateRequest | (optional)
226+
body := datadog.RoleCreateRequest{Data: datadog.RoleCreateData{Attributes: datadog.RoleCreateAttributes{CreatedAt: "TODO", ModifiedAt: "TODO", Name: "Name_example"}, Relationships: datadog.RoleRelationships{Permissions: datadog.RelationshipToPermissions{Data: []RelationshipToPermissionData{datadog.RelationshipToPermissionData{Id: "Id_example", Type: datadog.PermissionsType{}})}, Users: datadog.RelationshipToUsers{Data: []RelationshipToUserData{datadog.RelationshipToUserData{Id: "Id_example", Type: datadog.UsersType{}})}}, Type: datadog.RolesType{}}} // RoleCreateRequest | (optional)
227227

228228
configuration := datadog.NewConfiguration()
229229
api_client := datadog.NewAPIClient(configuration)

api/v2/datadog/docs/UsersApi.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -631,7 +631,7 @@ func main() {
631631
},
632632
)
633633

634-
body := datadog.UserInvitationsRequest{Data: []UserInvitationData{datadog.UserInvitationData{Relationships: datadog.UserInvitationRelationships{User: datadog.RelationshipToUser{Data: datadog.RelationshipToUserData{Id: "Id_example", Type: "Type_example"}}}, Type: datadog.UserInvitationsType{}})} // UserInvitationsRequest | (optional)
634+
body := datadog.UserInvitationsRequest{Data: []UserInvitationData{datadog.UserInvitationData{Relationships: datadog.UserInvitationRelationships{User: datadog.RelationshipToUser{Data: datadog.RelationshipToUserData{Id: "Id_example", Type: datadog.UsersType{}}}}, Type: datadog.UserInvitationsType{}})} // UserInvitationsRequest | (optional)
635635

636636
configuration := datadog.NewConfiguration()
637637
api_client := datadog.NewAPIClient(configuration)
@@ -711,7 +711,7 @@ func main() {
711711
)
712712

713713
userId := "userId_example" // string | The ID of the user.
714-
body := datadog.UserUpdateRequest{Data: datadog.UserUpdateData{Attributes: datadog.UserUpdateAttributes{Disabled: false, Email: "Email_example", Name: "Name_example"}, Id: "Id_example", Type: datadog.UsersType{}}} // UserUpdateRequest | (optional)
714+
body := datadog.UserUpdateRequest{Data: datadog.UserUpdateData{Attributes: datadog.UserUpdateAttributes{Disabled: false, Email: "Email_example", Name: "Name_example"}, Id: "Id_example", Type: }} // UserUpdateRequest | (optional)
715715

716716
configuration := datadog.NewConfiguration()
717717
api_client := datadog.NewAPIClient(configuration)

api/v2/datadog/model_relationship_to_organization_data.go

Lines changed: 26 additions & 42 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)