Skip to content

Commit

Permalink
Mark dashboard 'is_read_only' and 'restricted_roles' properties as de…
Browse files Browse the repository at this point in the history
…precated (#2343)

Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
Co-authored-by: api-clients-generation-pipeline[bot] <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com>
  • Loading branch information
api-clients-generation-pipeline[bot] and ci.datadog-api-spec authored Jan 18, 2024
1 parent a5fcf5d commit 78355ea
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 10 deletions.
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-01-12 20:45:36.228943",
"spec_repo_commit": "bdf7d582"
"regenerated": "2024-01-18 22:51:58.199195",
"spec_repo_commit": "4d921fb1"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2024-01-12 20:45:36.248061",
"spec_repo_commit": "bdf7d582"
"regenerated": "2024-01-18 22:51:58.221645",
"spec_repo_commit": "4d921fb1"
}
}
}
23 changes: 18 additions & 5 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1142,9 +1142,12 @@ components:
is_read_only:
default: false
deprecated: true
description: Whether this dashboard is read-only. If True, only the author
and admins can make changes to it. Prefer using `restricted_roles` to
manage write authorization.
description: 'Whether this dashboard is read-only. If True, only the author
and admins can make changes to it.


This property is deprecated; please use the [Restriction Policies API](https://docs.datadoghq.com/api/latest/restriction-policies/)
instead to manage write authorization for individual dashboards.'
example: false
type: boolean
layout_type:
Expand All @@ -1165,8 +1168,13 @@ components:
reflow_type:
$ref: '#/components/schemas/DashboardReflowType'
restricted_roles:
description: A list of role identifiers. Only the author and users associated
deprecated: true
description: 'A list of role identifiers. Only the author and users associated
with at least one of these roles can edit this dashboard.


This property is deprecated; please use the [Restriction Policies API](https://docs.datadoghq.com/api/latest/restriction-policies/)
instead to manage write authorization for individual dashboards.'
items:
description: A role UUID.
type: string
Expand Down Expand Up @@ -1439,8 +1447,13 @@ components:
description: Dashboard identifier.
type: string
is_read_only:
description: Whether this dashboard is read-only. If True, only the author
deprecated: true
description: 'Whether this dashboard is read-only. If True, only the author
and admins can make changes to it.


This property is deprecated; please use the [Restriction Policies API](https://docs.datadoghq.com/api/latest/restriction-policies/)
instead to manage write authorization for individual dashboards.'
type: boolean
layout_type:
$ref: '#/components/schemas/DashboardLayoutType'
Expand Down
10 changes: 9 additions & 1 deletion api/datadogV1/model_dashboard.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ type Dashboard struct {
Description datadog.NullableString `json:"description,omitempty"`
// ID of the dashboard.
Id *string `json:"id,omitempty"`
// Whether this dashboard is read-only. If True, only the author and admins can make changes to it. Prefer using `restricted_roles` to manage write authorization.
// Whether this dashboard is read-only. If True, only the author and admins can make changes to it.
//
// This property is deprecated; please use the [Restriction Policies API](https://docs.datadoghq.com/api/latest/restriction-policies/) instead to manage write authorization for individual dashboards.
// Deprecated
IsReadOnly *bool `json:"is_read_only,omitempty"`
// Layout type of the dashboard.
Expand All @@ -38,6 +40,9 @@ type Dashboard struct {
// widgets should not have layouts.
ReflowType *DashboardReflowType `json:"reflow_type,omitempty"`
// A list of role identifiers. Only the author and users associated with at least one of these roles can edit this dashboard.
//
// This property is deprecated; please use the [Restriction Policies API](https://docs.datadoghq.com/api/latest/restriction-policies/) instead to manage write authorization for individual dashboards.
// Deprecated
RestrictedRoles []string `json:"restricted_roles,omitempty"`
// List of team names representing ownership of a dashboard.
Tags datadog.NullableList[string] `json:"tags,omitempty"`
Expand Down Expand Up @@ -392,6 +397,7 @@ func (o *Dashboard) SetReflowType(v DashboardReflowType) {
}

// GetRestrictedRoles returns the RestrictedRoles field value if set, zero value otherwise.
// Deprecated
func (o *Dashboard) GetRestrictedRoles() []string {
if o == nil || o.RestrictedRoles == nil {
var ret []string
Expand All @@ -402,6 +408,7 @@ func (o *Dashboard) GetRestrictedRoles() []string {

// GetRestrictedRolesOk returns a tuple with the RestrictedRoles field value if set, nil otherwise
// and a boolean to check if the value has been set.
// Deprecated
func (o *Dashboard) GetRestrictedRolesOk() (*[]string, bool) {
if o == nil || o.RestrictedRoles == nil {
return nil, false
Expand All @@ -415,6 +422,7 @@ func (o *Dashboard) HasRestrictedRoles() bool {
}

// SetRestrictedRoles gets a reference to the given []string and assigns it to the RestrictedRoles field.
// Deprecated
func (o *Dashboard) SetRestrictedRoles(v []string) {
o.RestrictedRoles = v
}
Expand Down
6 changes: 6 additions & 0 deletions api/datadogV1/model_dashboard_summary_definition.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ type DashboardSummaryDefinition struct {
// Dashboard identifier.
Id *string `json:"id,omitempty"`
// Whether this dashboard is read-only. If True, only the author and admins can make changes to it.
//
// This property is deprecated; please use the [Restriction Policies API](https://docs.datadoghq.com/api/latest/restriction-policies/) instead to manage write authorization for individual dashboards.
// Deprecated
IsReadOnly *bool `json:"is_read_only,omitempty"`
// Layout type of the dashboard.
LayoutType *DashboardLayoutType `json:"layout_type,omitempty"`
Expand Down Expand Up @@ -176,6 +179,7 @@ func (o *DashboardSummaryDefinition) SetId(v string) {
}

// GetIsReadOnly returns the IsReadOnly field value if set, zero value otherwise.
// Deprecated
func (o *DashboardSummaryDefinition) GetIsReadOnly() bool {
if o == nil || o.IsReadOnly == nil {
var ret bool
Expand All @@ -186,6 +190,7 @@ func (o *DashboardSummaryDefinition) GetIsReadOnly() bool {

// GetIsReadOnlyOk returns a tuple with the IsReadOnly field value if set, nil otherwise
// and a boolean to check if the value has been set.
// Deprecated
func (o *DashboardSummaryDefinition) GetIsReadOnlyOk() (*bool, bool) {
if o == nil || o.IsReadOnly == nil {
return nil, false
Expand All @@ -199,6 +204,7 @@ func (o *DashboardSummaryDefinition) HasIsReadOnly() bool {
}

// SetIsReadOnly gets a reference to the given bool and assigns it to the IsReadOnly field.
// Deprecated
func (o *DashboardSummaryDefinition) SetIsReadOnly(v bool) {
o.IsReadOnly = &v
}
Expand Down

0 comments on commit 78355ea

Please sign in to comment.