From e44c9a6cfe28f97d67b37d468a53987bced1a6f0 Mon Sep 17 00:00:00 2001 From: "api-clients-generation-pipeline[bot]" <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Date: Tue, 15 Jun 2021 09:46:38 +0200 Subject: [PATCH] Regenerate client from commit 0664044 of spec repo (#863) Co-authored-by: ci.datadog-api-spec --- .apigentools-info | 8 ++-- api_docs/v1/Dashboard.md | 1 + .../api/v1/client/model/Dashboard.java | 43 +++++++++++++++++++ src/main/java/com/datadog/api/v1/openapi.yaml | 12 ++++++ .../api/v1/client/api/dashboards.feature | 10 ++--- 5 files changed, 65 insertions(+), 9 deletions(-) diff --git a/.apigentools-info b/.apigentools-info index 1e5203f062b..40c8f2a42aa 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.4.1.dev8", - "regenerated": "2021-06-14 11:43:39.800721", - "spec_repo_commit": "6c1fcab" + "regenerated": "2021-06-14 19:17:51.699962", + "spec_repo_commit": "0664044" }, "v2": { "apigentools_version": "1.4.1.dev8", - "regenerated": "2021-06-14 11:44:20.341651", - "spec_repo_commit": "6c1fcab" + "regenerated": "2021-06-14 19:18:38.923397", + "spec_repo_commit": "0664044" } } } \ No newline at end of file diff --git a/api_docs/v1/Dashboard.md b/api_docs/v1/Dashboard.md index 2b5e3b3a3b5..b323fb3d4ae 100644 --- a/api_docs/v1/Dashboard.md +++ b/api_docs/v1/Dashboard.md @@ -17,6 +17,7 @@ Name | Type | Description | Notes **modifiedAt** | **OffsetDateTime** | Modification date of the dashboard. | [optional] [readonly] **notifyList** | **List<String>** | List of handles of users to notify when changes are made to this dashboard. | [optional] **reflowType** | **DashboardReflowType** | | [optional] +**restrictedRoles** | **List<String>** | A list of role identifiers. Only the author and users associated with at least one of these roles can edit this dashboard. Overrides the `is_read_only` property if both are present. **This feature is currently in beta.** | [optional] **templateVariablePresets** | [**List<DashboardTemplateVariablePreset>**](DashboardTemplateVariablePreset.md) | Array of template variables saved views. | [optional] **templateVariables** | [**List<DashboardTemplateVariable>**](DashboardTemplateVariable.md) | List of template variables for this dashboard. | [optional] **title** | **String** | Title of the dashboard. | diff --git a/src/main/java/com/datadog/api/v1/client/model/Dashboard.java b/src/main/java/com/datadog/api/v1/client/model/Dashboard.java index 128f430f664..f9e9de1d808 100644 --- a/src/main/java/com/datadog/api/v1/client/model/Dashboard.java +++ b/src/main/java/com/datadog/api/v1/client/model/Dashboard.java @@ -42,6 +42,7 @@ Dashboard.JSON_PROPERTY_MODIFIED_AT, Dashboard.JSON_PROPERTY_NOTIFY_LIST, Dashboard.JSON_PROPERTY_REFLOW_TYPE, + Dashboard.JSON_PROPERTY_RESTRICTED_ROLES, Dashboard.JSON_PROPERTY_TEMPLATE_VARIABLE_PRESETS, Dashboard.JSON_PROPERTY_TEMPLATE_VARIABLES, Dashboard.JSON_PROPERTY_TITLE, @@ -77,6 +78,9 @@ public class Dashboard { public static final String JSON_PROPERTY_REFLOW_TYPE = "reflow_type"; private DashboardReflowType reflowType; + public static final String JSON_PROPERTY_RESTRICTED_ROLES = "restricted_roles"; + private List restrictedRoles = null; + public static final String JSON_PROPERTY_TEMPLATE_VARIABLE_PRESETS = "template_variable_presets"; private JsonNullable> templateVariablePresets = JsonNullable.>undefined(); @@ -306,6 +310,42 @@ public void setReflowType(DashboardReflowType reflowType) { this.reflowType = reflowType; } + public Dashboard restrictedRoles(List restrictedRoles) { + this.restrictedRoles = restrictedRoles; + return this; + } + + public Dashboard addRestrictedRolesItem(String restrictedRolesItem) { + if (this.restrictedRoles == null) { + this.restrictedRoles = new ArrayList<>(); + } + this.restrictedRoles.add(restrictedRolesItem); + return this; + } + + /** + * A list of role identifiers. Only the author and users associated with at least one of these + * roles can edit this dashboard. Overrides the `is_read_only` property if both are + * present. **This feature is currently in beta.** + * + * @return restrictedRoles + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "A list of role identifiers. Only the author and users associated with at least one of" + + " these roles can edit this dashboard. Overrides the `is_read_only` property if" + + " both are present. **This feature is currently in beta.**") + @JsonProperty(JSON_PROPERTY_RESTRICTED_ROLES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getRestrictedRoles() { + return restrictedRoles; + } + + public void setRestrictedRoles(List restrictedRoles) { + this.restrictedRoles = restrictedRoles; + } + public Dashboard templateVariablePresets( List templateVariablePresets) { this.templateVariablePresets = @@ -488,6 +528,7 @@ public boolean equals(Object o) { && Objects.equals(this.modifiedAt, dashboard.modifiedAt) && Objects.equals(this.notifyList, dashboard.notifyList) && Objects.equals(this.reflowType, dashboard.reflowType) + && Objects.equals(this.restrictedRoles, dashboard.restrictedRoles) && Objects.equals(this.templateVariablePresets, dashboard.templateVariablePresets) && Objects.equals(this.templateVariables, dashboard.templateVariables) && Objects.equals(this.title, dashboard.title) @@ -507,6 +548,7 @@ public int hashCode() { modifiedAt, notifyList, reflowType, + restrictedRoles, templateVariablePresets, templateVariables, title, @@ -527,6 +569,7 @@ public String toString() { sb.append(" modifiedAt: ").append(toIndentedString(modifiedAt)).append("\n"); sb.append(" notifyList: ").append(toIndentedString(notifyList)).append("\n"); sb.append(" reflowType: ").append(toIndentedString(reflowType)).append("\n"); + sb.append(" restrictedRoles: ").append(toIndentedString(restrictedRoles)).append("\n"); sb.append(" templateVariablePresets: ") .append(toIndentedString(templateVariablePresets)) .append("\n"); diff --git a/src/main/java/com/datadog/api/v1/openapi.yaml b/src/main/java/com/datadog/api/v1/openapi.yaml index 0d9b14ae4dc..ba5e63ae6ed 100644 --- a/src/main/java/com/datadog/api/v1/openapi.yaml +++ b/src/main/java/com/datadog/api/v1/openapi.yaml @@ -11062,6 +11062,9 @@ components: notify_list: - notify_list - notify_list + restricted_roles: + - restricted_roles + - restricted_roles title: "" widgets: - definition: @@ -11124,6 +11127,15 @@ components: type: array reflow_type: $ref: '#/components/schemas/DashboardReflowType' + restricted_roles: + description: A list of role identifiers. Only the author and users associated + with at least one of these roles can edit this dashboard. Overrides the + `is_read_only` property if both are present. **This feature is currently + in beta.** + items: + description: A role UUID. + type: string + type: array template_variable_presets: description: Array of template variables saved views. items: diff --git a/src/test/resources/com/datadog/api/v1/client/api/dashboards.feature b/src/test/resources/com/datadog/api/v1/client/api/dashboards.feature index 729efc248ad..4e11ff71277 100644 --- a/src/test/resources/com/datadog/api/v1/client/api/dashboards.feature +++ b/src/test/resources/com/datadog/api/v1/client/api/dashboards.feature @@ -12,14 +12,14 @@ Feature: Dashboards @generated @skip Scenario: Create a new dashboard returns "Bad Request" response Given new "CreateDashboard" request - And body with value {"description": null, "is_read_only": false, "layout_type": "ordered", "notify_list": [null], "reflow_type": "auto", "template_variable_presets": [{"name": null, "template_variables": [{"name": null, "value": null}]}], "template_variables": [{"default": "my-host", "name": "host1", "prefix": "host"}], "title": "", "widgets": [{"definition": {"requests": {"fill": {"q": "system.cpu.user"}}, "type": "hostmap"}}]} + And body with value {"description": null, "is_read_only": false, "layout_type": "ordered", "notify_list": [null], "reflow_type": "auto", "restricted_roles": [null], "template_variable_presets": [{"name": null, "template_variables": [{"name": null, "value": null}]}], "template_variables": [{"default": "my-host", "name": "host1", "prefix": "host"}], "title": "", "widgets": [{"definition": {"requests": {"fill": {"q": "system.cpu.user"}}, "type": "hostmap"}}]} When the request is sent Then the response status is 400 Bad Request @generated @skip Scenario: Create a new dashboard returns "OK" response Given new "CreateDashboard" request - And body with value {"description": null, "is_read_only": false, "layout_type": "ordered", "notify_list": [null], "reflow_type": "auto", "template_variable_presets": [{"name": null, "template_variables": [{"name": null, "value": null}]}], "template_variables": [{"default": "my-host", "name": "host1", "prefix": "host"}], "title": "", "widgets": [{"definition": {"requests": {"fill": {"q": "system.cpu.user"}}, "type": "hostmap"}}]} + And body with value {"description": null, "is_read_only": false, "layout_type": "ordered", "notify_list": [null], "reflow_type": "auto", "restricted_roles": [null], "template_variable_presets": [{"name": null, "template_variables": [{"name": null, "value": null}]}], "template_variables": [{"default": "my-host", "name": "host1", "prefix": "host"}], "title": "", "widgets": [{"definition": {"requests": {"fill": {"q": "system.cpu.user"}}, "type": "hostmap"}}]} When the request is sent Then the response status is 200 OK @@ -78,7 +78,7 @@ Feature: Dashboards Scenario: Update a dashboard returns "Bad Request" response Given new "UpdateDashboard" request And request contains "dashboard_id" parameter from "" - And body with value {"description": null, "is_read_only": false, "layout_type": "ordered", "notify_list": [null], "reflow_type": "auto", "template_variable_presets": [{"name": null, "template_variables": [{"name": null, "value": null}]}], "template_variables": [{"default": "my-host", "name": "host1", "prefix": "host"}], "title": "", "widgets": [{"definition": {"requests": {"fill": {"q": "system.cpu.user"}}, "type": "hostmap"}}]} + And body with value {"description": null, "is_read_only": false, "layout_type": "ordered", "notify_list": [null], "reflow_type": "auto", "restricted_roles": [null], "template_variable_presets": [{"name": null, "template_variables": [{"name": null, "value": null}]}], "template_variables": [{"default": "my-host", "name": "host1", "prefix": "host"}], "title": "", "widgets": [{"definition": {"requests": {"fill": {"q": "system.cpu.user"}}, "type": "hostmap"}}]} When the request is sent Then the response status is 400 Bad Request @@ -86,7 +86,7 @@ Feature: Dashboards Scenario: Update a dashboard returns "Item Not Found" response Given new "UpdateDashboard" request And request contains "dashboard_id" parameter from "" - And body with value {"description": null, "is_read_only": false, "layout_type": "ordered", "notify_list": [null], "reflow_type": "auto", "template_variable_presets": [{"name": null, "template_variables": [{"name": null, "value": null}]}], "template_variables": [{"default": "my-host", "name": "host1", "prefix": "host"}], "title": "", "widgets": [{"definition": {"requests": {"fill": {"q": "system.cpu.user"}}, "type": "hostmap"}}]} + And body with value {"description": null, "is_read_only": false, "layout_type": "ordered", "notify_list": [null], "reflow_type": "auto", "restricted_roles": [null], "template_variable_presets": [{"name": null, "template_variables": [{"name": null, "value": null}]}], "template_variables": [{"default": "my-host", "name": "host1", "prefix": "host"}], "title": "", "widgets": [{"definition": {"requests": {"fill": {"q": "system.cpu.user"}}, "type": "hostmap"}}]} When the request is sent Then the response status is 404 Item Not Found @@ -94,6 +94,6 @@ Feature: Dashboards Scenario: Update a dashboard returns "OK" response Given new "UpdateDashboard" request And request contains "dashboard_id" parameter from "" - And body with value {"description": null, "is_read_only": false, "layout_type": "ordered", "notify_list": [null], "reflow_type": "auto", "template_variable_presets": [{"name": null, "template_variables": [{"name": null, "value": null}]}], "template_variables": [{"default": "my-host", "name": "host1", "prefix": "host"}], "title": "", "widgets": [{"definition": {"requests": {"fill": {"q": "system.cpu.user"}}, "type": "hostmap"}}]} + And body with value {"description": null, "is_read_only": false, "layout_type": "ordered", "notify_list": [null], "reflow_type": "auto", "restricted_roles": [null], "template_variable_presets": [{"name": null, "template_variables": [{"name": null, "value": null}]}], "template_variables": [{"default": "my-host", "name": "host1", "prefix": "host"}], "title": "", "widgets": [{"definition": {"requests": {"fill": {"q": "system.cpu.user"}}, "type": "hostmap"}}]} When the request is sent Then the response status is 200 OK