Skip to content

Commit ce45982

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Regenerate client from commit e52b06e of spec repo (#3576)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent a7d200b commit ce45982

14 files changed

Lines changed: 903 additions & 0 deletions

.generator/schemas/v2/openapi.yaml

Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73429,6 +73429,86 @@ components:
7342973429
- MINUS_ID
7343073430
- NAME
7343173431
- MINUS_NAME
73432+
OrgGroupPolicySuggestionAttributes:
73433+
description: Attributes of an org group policy suggestion.
73434+
properties:
73435+
consensus_ratio:
73436+
description: The ratio of member orgs whose configuration agrees on the recommended value.
73437+
example: 0.75
73438+
format: double
73439+
maximum: 1
73440+
minimum: 0
73441+
type: number
73442+
policy_name:
73443+
description: The name of the suggested policy.
73444+
example: "monitor_timezone"
73445+
type: string
73446+
recommended_value:
73447+
description: The recommended value for the policy, based on member org consensus.
73448+
example: "UTC"
73449+
status:
73450+
$ref: "#/components/schemas/OrgGroupPolicySuggestionStatus"
73451+
required:
73452+
- policy_name
73453+
- status
73454+
- consensus_ratio
73455+
- recommended_value
73456+
type: object
73457+
OrgGroupPolicySuggestionData:
73458+
description: An org group policy suggestion resource.
73459+
properties:
73460+
attributes:
73461+
$ref: "#/components/schemas/OrgGroupPolicySuggestionAttributes"
73462+
id:
73463+
description: The ID of the org group policy suggestion.
73464+
example: "1a2b3c4d-5e6f-7890-abcd-ef0123456789"
73465+
type: string
73466+
relationships:
73467+
$ref: "#/components/schemas/OrgGroupPolicySuggestionRelationships"
73468+
type:
73469+
$ref: "#/components/schemas/OrgGroupPolicySuggestionType"
73470+
required:
73471+
- id
73472+
- type
73473+
- attributes
73474+
type: object
73475+
OrgGroupPolicySuggestionListResponse:
73476+
description: Response containing a list of org group policy suggestions.
73477+
properties:
73478+
data:
73479+
description: An array of org group policy suggestions.
73480+
items:
73481+
$ref: "#/components/schemas/OrgGroupPolicySuggestionData"
73482+
type: array
73483+
required:
73484+
- data
73485+
type: object
73486+
OrgGroupPolicySuggestionRelationships:
73487+
description: Relationships of an org group policy suggestion.
73488+
properties:
73489+
org_group:
73490+
$ref: "#/components/schemas/OrgGroupRelationshipToOne"
73491+
type: object
73492+
OrgGroupPolicySuggestionStatus:
73493+
description: The status of the policy suggestion.
73494+
enum:
73495+
- pending
73496+
- accepted
73497+
- dismissed
73498+
example: pending
73499+
type: string
73500+
x-enum-varnames:
73501+
- PENDING
73502+
- ACCEPTED
73503+
- DISMISSED
73504+
OrgGroupPolicySuggestionType:
73505+
description: Org group policy suggestions resource type.
73506+
enum:
73507+
- org_group_policy_suggestions
73508+
example: org_group_policy_suggestions
73509+
type: string
73510+
x-enum-varnames:
73511+
- ORG_GROUP_POLICY_SUGGESTIONS
7343273512
OrgGroupPolicyType:
7343373513
description: Org group policies resource type.
7343473514
enum:
@@ -164938,6 +165018,64 @@ paths:
164938165018
x-unstable: |-
164939165019
**Note**: This endpoint is in preview and is subject to change.
164940165020
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
165021+
/api/v2/org_group_policy_suggestions:
165022+
get:
165023+
description: List suggested organization group policies. Requires a filter on org group ID.
165024+
operationId: ListOrgGroupPolicySuggestions
165025+
parameters:
165026+
- $ref: "#/components/parameters/OrgGroupPolicyFilterOrgGroupId"
165027+
responses:
165028+
"200":
165029+
content:
165030+
application/json:
165031+
examples:
165032+
default:
165033+
value:
165034+
data:
165035+
- attributes:
165036+
consensus_ratio: 0.75
165037+
policy_name: "monitor_timezone"
165038+
recommended_value: "UTC"
165039+
status: "pending"
165040+
id: "1a2b3c4d-5e6f-7890-abcd-ef0123456789"
165041+
relationships:
165042+
org_group:
165043+
data:
165044+
id: "a1b2c3d4-e5f6-7890-abcd-ef0123456789"
165045+
type: org_groups
165046+
type: org_group_policy_suggestions
165047+
schema:
165048+
$ref: "#/components/schemas/OrgGroupPolicySuggestionListResponse"
165049+
description: OK
165050+
"400":
165051+
content:
165052+
application/json:
165053+
schema:
165054+
$ref: "#/components/schemas/JSONAPIErrorResponse"
165055+
description: Bad Request
165056+
"401":
165057+
content:
165058+
application/json:
165059+
schema:
165060+
$ref: "#/components/schemas/JSONAPIErrorResponse"
165061+
description: Unauthorized
165062+
"403":
165063+
content:
165064+
application/json:
165065+
schema:
165066+
$ref: "#/components/schemas/JSONAPIErrorResponse"
165067+
description: Forbidden
165068+
"429":
165069+
$ref: "#/components/responses/TooManyRequestsResponse"
165070+
summary: List org group policy suggestions
165071+
tags: [Org Groups]
165072+
"x-permission":
165073+
operator: OR
165074+
permissions:
165075+
- org_group_read
165076+
x-unstable: |-
165077+
**Note**: This endpoint is in preview and is subject to change.
165078+
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
164941165079
/api/v2/org_groups:
164942165080
get:
164943165081
description: List all organization groups that the requesting organization has access to.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# List org group policy suggestions returns "OK" response
2+
3+
require "datadog_api_client"
4+
DatadogAPIClient.configure do |config|
5+
config.unstable_operations["v2.list_org_group_policy_suggestions".to_sym] = true
6+
end
7+
api_instance = DatadogAPIClient::V2::OrgGroupsAPI.new
8+
p api_instance.list_org_group_policy_suggestions("a1b2c3d4-e5f6-7890-abcd-ef0123456789")

features/scenarios_model_mapping.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4706,6 +4706,9 @@
47064706
"org_group_policy_override_id" => "UUID",
47074707
"body" => "OrgGroupPolicyOverrideUpdateRequest",
47084708
},
4709+
"v2.ListOrgGroupPolicySuggestions" => {
4710+
"filter_org_group_id" => "UUID",
4711+
},
47094712
"v2.ListOrgGroups" => {
47104713
"page_number" => "Integer",
47114714
"page_size" => "Integer",

features/v2/org_groups.feature

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,22 @@ Feature: Org Groups
325325
When the request is sent
326326
Then the response status is 200 OK
327327

328+
@generated @skip @team:DataDog/org-management
329+
Scenario: List org group policy suggestions returns "Bad Request" response
330+
Given operation "ListOrgGroupPolicySuggestions" enabled
331+
And new "ListOrgGroupPolicySuggestions" request
332+
And request contains "filter[org_group_id]" parameter from "REPLACE.ME"
333+
When the request is sent
334+
Then the response status is 400 Bad Request
335+
336+
@generated @skip @team:DataDog/org-management
337+
Scenario: List org group policy suggestions returns "OK" response
338+
Given operation "ListOrgGroupPolicySuggestions" enabled
339+
And new "ListOrgGroupPolicySuggestions" request
340+
And request contains "filter[org_group_id]" parameter from "REPLACE.ME"
341+
When the request is sent
342+
Then the response status is 200 OK
343+
328344
@generated @skip @team:DataDog/org-management
329345
Scenario: List org groups returns "Bad Request" response
330346
Given operation "ListOrgGroups" enabled

features/v2/undo.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5971,6 +5971,12 @@
59715971
"type": "idempotent"
59725972
}
59735973
},
5974+
"ListOrgGroupPolicySuggestions": {
5975+
"tag": "Org Groups",
5976+
"undo": {
5977+
"type": "safe"
5978+
}
5979+
},
59745980
"ListOrgGroups": {
59755981
"tag": "Org Groups",
59765982
"undo": {

lib/datadog_api_client/configuration.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -642,6 +642,7 @@ def initialize
642642
"v2.list_org_group_policies": false,
643643
"v2.list_org_group_policy_configs": false,
644644
"v2.list_org_group_policy_overrides": false,
645+
"v2.list_org_group_policy_suggestions": false,
645646
"v2.list_org_groups": false,
646647
"v2.update_org_group": false,
647648
"v2.update_org_group_membership": false,

lib/datadog_api_client/inflector.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5535,6 +5535,12 @@ def overrides
55355535
"v2.org_group_policy_relationship_to_one_data" => "OrgGroupPolicyRelationshipToOneData",
55365536
"v2.org_group_policy_response" => "OrgGroupPolicyResponse",
55375537
"v2.org_group_policy_sort_option" => "OrgGroupPolicySortOption",
5538+
"v2.org_group_policy_suggestion_attributes" => "OrgGroupPolicySuggestionAttributes",
5539+
"v2.org_group_policy_suggestion_data" => "OrgGroupPolicySuggestionData",
5540+
"v2.org_group_policy_suggestion_list_response" => "OrgGroupPolicySuggestionListResponse",
5541+
"v2.org_group_policy_suggestion_relationships" => "OrgGroupPolicySuggestionRelationships",
5542+
"v2.org_group_policy_suggestion_status" => "OrgGroupPolicySuggestionStatus",
5543+
"v2.org_group_policy_suggestion_type" => "OrgGroupPolicySuggestionType",
55385544
"v2.org_group_policy_type" => "OrgGroupPolicyType",
55395545
"v2.org_group_policy_update_attributes" => "OrgGroupPolicyUpdateAttributes",
55405546
"v2.org_group_policy_update_data" => "OrgGroupPolicyUpdateData",

lib/datadog_api_client/v2/api/org_groups_api.rb

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1153,6 +1153,78 @@ def list_org_group_policy_overrides_with_http_info(filter_org_group_id, opts = {
11531153
return data, status_code, headers
11541154
end
11551155

1156+
# List org group policy suggestions.
1157+
#
1158+
# @see #list_org_group_policy_suggestions_with_http_info
1159+
def list_org_group_policy_suggestions(filter_org_group_id, opts = {})
1160+
data, _status_code, _headers = list_org_group_policy_suggestions_with_http_info(filter_org_group_id, opts)
1161+
data
1162+
end
1163+
1164+
# List org group policy suggestions.
1165+
#
1166+
# List suggested organization group policies. Requires a filter on org group ID.
1167+
#
1168+
# @param filter_org_group_id [UUID] Filter policies by org group ID.
1169+
# @param opts [Hash] the optional parameters
1170+
# @return [Array<(OrgGroupPolicySuggestionListResponse, Integer, Hash)>] OrgGroupPolicySuggestionListResponse data, response status code and response headers
1171+
def list_org_group_policy_suggestions_with_http_info(filter_org_group_id, opts = {})
1172+
unstable_enabled = @api_client.config.unstable_operations["v2.list_org_group_policy_suggestions".to_sym]
1173+
if unstable_enabled
1174+
@api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_org_group_policy_suggestions")
1175+
else
1176+
raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_org_group_policy_suggestions"))
1177+
end
1178+
1179+
if @api_client.config.debugging
1180+
@api_client.config.logger.debug 'Calling API: OrgGroupsAPI.list_org_group_policy_suggestions ...'
1181+
end
1182+
# verify the required parameter 'filter_org_group_id' is set
1183+
if @api_client.config.client_side_validation && filter_org_group_id.nil?
1184+
fail ArgumentError, "Missing the required parameter 'filter_org_group_id' when calling OrgGroupsAPI.list_org_group_policy_suggestions"
1185+
end
1186+
# resource path
1187+
local_var_path = '/api/v2/org_group_policy_suggestions'
1188+
1189+
# query parameters
1190+
query_params = opts[:query_params] || {}
1191+
query_params[:'filter[org_group_id]'] = filter_org_group_id
1192+
1193+
# header parameters
1194+
header_params = opts[:header_params] || {}
1195+
# HTTP header 'Accept' (if needed)
1196+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1197+
1198+
# form parameters
1199+
form_params = opts[:form_params] || {}
1200+
1201+
# http body (model)
1202+
post_body = opts[:debug_body]
1203+
1204+
# return_type
1205+
return_type = opts[:debug_return_type] || 'OrgGroupPolicySuggestionListResponse'
1206+
1207+
# auth_names
1208+
auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]
1209+
1210+
new_options = opts.merge(
1211+
:operation => :list_org_group_policy_suggestions,
1212+
:header_params => header_params,
1213+
:query_params => query_params,
1214+
:form_params => form_params,
1215+
:body => post_body,
1216+
:auth_names => auth_names,
1217+
:return_type => return_type,
1218+
:api_version => "V2"
1219+
)
1220+
1221+
data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
1222+
if @api_client.config.debugging
1223+
@api_client.config.logger.debug "API called: OrgGroupsAPI#list_org_group_policy_suggestions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1224+
end
1225+
return data, status_code, headers
1226+
end
1227+
11561228
# List org groups.
11571229
#
11581230
# @see #list_org_groups_with_http_info

0 commit comments

Comments
 (0)