datadog_api_client 2.17.0 → 2.18.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (132) hide show
  1. checksums.yaml +4 -4
  2. data/.apigentools-info +4 -4
  3. data/.generator/schemas/v1/openapi.yaml +145 -5
  4. data/.generator/schemas/v2/openapi.yaml +1306 -45
  5. data/.generator/src/generator/cli.py +5 -0
  6. data/.generator/src/generator/templates/datadog_api_client.j2 +19 -0
  7. data/.pre-commit-config.yaml +1 -1
  8. data/CHANGELOG.md +25 -0
  9. data/examples/v1/aws-integration/CreateAWSAccount.rb +2 -2
  10. data/examples/v1/aws-integration/DeleteAWSAccount.rb +1 -1
  11. data/examples/v1/aws-integration/UpdateAWSAccount.rb +6 -6
  12. data/examples/v1/azure-integration/CreateAzureIntegration.rb +1 -0
  13. data/examples/v1/azure-integration/DeleteAzureIntegration.rb +1 -0
  14. data/examples/v1/azure-integration/UpdateAzureHostFilters.rb +1 -0
  15. data/examples/v1/azure-integration/UpdateAzureIntegration.rb +1 -0
  16. data/examples/v1/dashboards/CreateDashboard_1284514532.rb +3 -0
  17. data/examples/v1/synthetics/PatchTest.rb +22 -0
  18. data/examples/v2/container-images/ListContainerImages.rb +0 -3
  19. data/examples/v2/container-images/ListContainerImages_3088586393.rb +0 -3
  20. data/examples/v2/container-images/ListContainerImages_3974828736.rb +0 -3
  21. data/examples/v2/containers/ListContainers.rb +0 -3
  22. data/examples/v2/containers/ListContainers_2175733917.rb +0 -3
  23. data/examples/v2/containers/ListContainers_931009654.rb +0 -3
  24. data/examples/v2/dora-metrics/CreateDORADeployment.rb +23 -0
  25. data/examples/v2/dora-metrics/CreateDORAIncident.rb +25 -0
  26. data/examples/v2/events/ListEvents.rb +0 -3
  27. data/examples/v2/events/ListEvents_1527584014.rb +0 -3
  28. data/examples/v2/events/ListEvents_2663715109.rb +0 -3
  29. data/examples/v2/events/SearchEvents.rb +0 -3
  30. data/examples/v2/events/SearchEvents_3856995058.rb +0 -3
  31. data/examples/v2/okta-integration/CreateOktaAccount.rb +19 -0
  32. data/examples/v2/okta-integration/DeleteOktaAccount.rb +5 -0
  33. data/examples/v2/okta-integration/GetOktaAccount.rb +8 -0
  34. data/examples/v2/okta-integration/ListOktaAccounts.rb +5 -0
  35. data/examples/v2/okta-integration/UpdateOktaAccount.rb +20 -0
  36. data/examples/v2/usage-metering/GetActiveBillingDimensions.rb +8 -0
  37. data/examples/v2/usage-metering/GetMonthlyCostAttribution.rb +8 -0
  38. data/examples/v2/usage-metering/GetProjectedCost.rb +8 -0
  39. data/lib/datadog_api_client/configuration.rb +4 -4
  40. data/lib/datadog_api_client/inflector.rb +61 -0
  41. data/lib/datadog_api_client/v1/api/hosts_api.rb +1 -1
  42. data/lib/datadog_api_client/v1/api/synthetics_api.rb +73 -1
  43. data/lib/datadog_api_client/v1/models/azure_account.rb +13 -2
  44. data/lib/datadog_api_client/v1/models/synthetics_patch_test_body.rb +82 -0
  45. data/lib/datadog_api_client/v1/models/synthetics_patch_test_operation.rb +100 -0
  46. data/lib/datadog_api_client/v1/models/synthetics_patch_test_operation_name.rb +31 -0
  47. data/lib/datadog_api_client/v1/models/usage_summary_date_org.rb +21 -1
  48. data/lib/datadog_api_client/v1/models/usage_summary_response.rb +21 -1
  49. data/lib/datadog_api_client/v1/models/widget_live_span.rb +2 -0
  50. data/lib/datadog_api_client/v2/api/container_images_api.rb +0 -6
  51. data/lib/datadog_api_client/v2/api/containers_api.rb +0 -6
  52. data/lib/datadog_api_client/v2/api/dora_metrics_api.rb +181 -0
  53. data/lib/datadog_api_client/v2/api/events_api.rb +0 -12
  54. data/lib/datadog_api_client/v2/api/okta_integration_api.rb +355 -0
  55. data/lib/datadog_api_client/v2/api/usage_metering_api.rb +241 -0
  56. data/lib/datadog_api_client/v2/models/active_billing_dimensions_attributes.rb +92 -0
  57. data/lib/datadog_api_client/v2/models/active_billing_dimensions_body.rb +100 -0
  58. data/lib/datadog_api_client/v2/models/active_billing_dimensions_response.rb +80 -0
  59. data/lib/datadog_api_client/v2/models/active_billing_dimensions_type.rb +26 -0
  60. data/lib/datadog_api_client/v2/models/api_keys_response.rb +14 -4
  61. data/lib/datadog_api_client/v2/models/api_keys_response_meta.rb +90 -0
  62. data/lib/datadog_api_client/v2/models/api_keys_response_meta_page.rb +80 -0
  63. data/lib/datadog_api_client/v2/models/application_key_response_meta.rb +90 -0
  64. data/lib/datadog_api_client/v2/models/application_key_response_meta_page.rb +80 -0
  65. data/lib/datadog_api_client/v2/models/cloud_workload_security_agent_rule_attributes.rb +13 -1
  66. data/lib/datadog_api_client/v2/models/cost_attribution_aggregates_body.rb +100 -0
  67. data/lib/datadog_api_client/v2/models/cost_attribution_type.rb +26 -0
  68. data/lib/datadog_api_client/v2/models/dora_deployment_request.rb +98 -0
  69. data/lib/datadog_api_client/v2/models/dora_deployment_request_attributes.rb +170 -0
  70. data/lib/datadog_api_client/v2/models/dora_deployment_request_data.rb +98 -0
  71. data/lib/datadog_api_client/v2/models/dora_deployment_response.rb +98 -0
  72. data/lib/datadog_api_client/v2/models/dora_deployment_response_data.rb +108 -0
  73. data/lib/datadog_api_client/v2/models/dora_deployment_type.rb +26 -0
  74. data/lib/datadog_api_client/v2/models/dora_git_info.rb +125 -0
  75. data/lib/datadog_api_client/v2/models/dora_incident_request.rb +98 -0
  76. data/lib/datadog_api_client/v2/models/dora_incident_request_attributes.rb +179 -0
  77. data/lib/datadog_api_client/v2/models/dora_incident_request_data.rb +98 -0
  78. data/lib/datadog_api_client/v2/models/dora_incident_response.rb +98 -0
  79. data/lib/datadog_api_client/v2/models/dora_incident_response_data.rb +108 -0
  80. data/lib/datadog_api_client/v2/models/dora_incident_type.rb +26 -0
  81. data/lib/datadog_api_client/v2/models/full_api_key_attributes.rb +24 -4
  82. data/lib/datadog_api_client/v2/models/incident_attachment_link_attributes.rb +14 -4
  83. data/lib/datadog_api_client/v2/models/incident_create_relationships.rb +9 -19
  84. data/lib/datadog_api_client/v2/models/incident_impacts_type.rb +26 -0
  85. data/lib/datadog_api_client/v2/models/incident_integration_metadata_attributes.rb +21 -1
  86. data/lib/datadog_api_client/v2/models/incident_integration_metadata_response_data.rb +11 -1
  87. data/lib/datadog_api_client/v2/models/incident_integration_relationships.rb +90 -0
  88. data/lib/datadog_api_client/v2/models/incident_non_datadog_creator.rb +90 -0
  89. data/lib/datadog_api_client/v2/models/incident_responders_type.rb +26 -0
  90. data/lib/datadog_api_client/v2/models/incident_response_attributes.rb +69 -4
  91. data/lib/datadog_api_client/v2/models/incident_response_relationships.rb +42 -4
  92. data/lib/datadog_api_client/v2/models/incident_severity.rb +31 -0
  93. data/lib/datadog_api_client/v2/models/incident_todo_attributes.rb +24 -4
  94. data/lib/datadog_api_client/v2/models/incident_todo_relationships.rb +90 -0
  95. data/lib/datadog_api_client/v2/models/incident_todo_response_data.rb +11 -1
  96. data/lib/datadog_api_client/v2/models/incident_update_relationships.rb +8 -0
  97. data/lib/datadog_api_client/v2/models/incident_user_defined_field_type.rb +26 -0
  98. data/lib/datadog_api_client/v2/models/list_application_keys_response.rb +14 -4
  99. data/lib/datadog_api_client/v2/models/monthly_cost_attribution_attributes.rb +151 -0
  100. data/lib/datadog_api_client/v2/models/monthly_cost_attribution_body.rb +100 -0
  101. data/lib/datadog_api_client/v2/models/monthly_cost_attribution_meta.rb +92 -0
  102. data/lib/datadog_api_client/v2/models/monthly_cost_attribution_pagination.rb +88 -0
  103. data/lib/datadog_api_client/v2/models/monthly_cost_attribution_response.rb +92 -0
  104. data/lib/datadog_api_client/v2/models/okta_account.rb +129 -0
  105. data/lib/datadog_api_client/v2/models/okta_account_attributes.rb +170 -0
  106. data/lib/datadog_api_client/v2/models/okta_account_request.rb +98 -0
  107. data/lib/datadog_api_client/v2/models/okta_account_response.rb +80 -0
  108. data/lib/datadog_api_client/v2/models/okta_account_response_data.rb +140 -0
  109. data/lib/datadog_api_client/v2/models/okta_account_type.rb +26 -0
  110. data/lib/datadog_api_client/v2/models/okta_account_update_request.rb +98 -0
  111. data/lib/datadog_api_client/v2/models/okta_account_update_request_attributes.rb +149 -0
  112. data/lib/datadog_api_client/v2/models/okta_account_update_request_data.rb +90 -0
  113. data/lib/datadog_api_client/v2/models/okta_accounts_response.rb +82 -0
  114. data/lib/datadog_api_client/v2/models/partial_api_key_attributes.rb +24 -4
  115. data/lib/datadog_api_client/v2/models/powerpack_relationships.rb +2 -2
  116. data/lib/datadog_api_client/v2/models/powerpacks_response_meta_pagination.rb +8 -0
  117. data/lib/datadog_api_client/v2/models/projected_cost.rb +100 -0
  118. data/lib/datadog_api_client/v2/models/projected_cost_attributes.rb +132 -0
  119. data/lib/datadog_api_client/v2/models/projected_cost_response.rb +82 -0
  120. data/lib/datadog_api_client/v2/models/projected_cost_type.rb +26 -0
  121. data/lib/datadog_api_client/v2/models/relationship_to_incident_impact_data.rb +119 -0
  122. data/lib/datadog_api_client/v2/models/relationship_to_incident_impacts.rb +100 -0
  123. data/lib/datadog_api_client/v2/models/relationship_to_incident_responder_data.rb +119 -0
  124. data/lib/datadog_api_client/v2/models/relationship_to_incident_responders.rb +100 -0
  125. data/lib/datadog_api_client/v2/models/relationship_to_incident_user_defined_field_data.rb +119 -0
  126. data/lib/datadog_api_client/v2/models/relationship_to_incident_user_defined_fields.rb +100 -0
  127. data/lib/datadog_api_client/v2/models/security_monitoring_rule_type_create.rb +1 -0
  128. data/lib/datadog_api_client/v2/models/sensitive_data_scanner_standard_pattern_attributes.rb +13 -1
  129. data/lib/datadog_api_client/v2/models/sort_direction.rb +27 -0
  130. data/lib/datadog_api_client/version.rb +1 -1
  131. data/lib/datadog_api_client.rb +16 -1
  132. metadata +75 -2
@@ -23,6 +23,72 @@ module DatadogAPIClient::V2
23
23
  @api_client = api_client
24
24
  end
25
25
 
26
+ # Get active billing dimensions for cost attribution.
27
+ #
28
+ # @see #get_active_billing_dimensions_with_http_info
29
+ def get_active_billing_dimensions(opts = {})
30
+ data, _status_code, _headers = get_active_billing_dimensions_with_http_info(opts)
31
+ data
32
+ end
33
+
34
+ # Get active billing dimensions for cost attribution.
35
+ #
36
+ # Get active billing dimensions for cost attribution. Cost data for a given month becomes available no later than the 17th of the following month.
37
+ #
38
+ # @param opts [Hash] the optional parameters
39
+ # @return [Array<(ActiveBillingDimensionsResponse, Integer, Hash)>] ActiveBillingDimensionsResponse data, response status code and response headers
40
+ def get_active_billing_dimensions_with_http_info(opts = {})
41
+ unstable_enabled = @api_client.config.unstable_operations["v2.get_active_billing_dimensions".to_sym]
42
+ if unstable_enabled
43
+ @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_active_billing_dimensions")
44
+ else
45
+ raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_active_billing_dimensions"))
46
+ end
47
+
48
+ if @api_client.config.debugging
49
+ @api_client.config.logger.debug 'Calling API: UsageMeteringAPI.get_active_billing_dimensions ...'
50
+ end
51
+ # resource path
52
+ local_var_path = '/api/v2/cost_by_tag/active_billing_dimensions'
53
+
54
+ # query parameters
55
+ query_params = opts[:query_params] || {}
56
+
57
+ # header parameters
58
+ header_params = opts[:header_params] || {}
59
+ # HTTP header 'Accept' (if needed)
60
+ header_params['Accept'] = @api_client.select_header_accept(['application/json;datetime-format=rfc3339'])
61
+
62
+ # form parameters
63
+ form_params = opts[:form_params] || {}
64
+
65
+ # http body (model)
66
+ post_body = opts[:debug_body]
67
+
68
+ # return_type
69
+ return_type = opts[:debug_return_type] || 'ActiveBillingDimensionsResponse'
70
+
71
+ # auth_names
72
+ auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]
73
+
74
+ new_options = opts.merge(
75
+ :operation => :get_active_billing_dimensions,
76
+ :header_params => header_params,
77
+ :query_params => query_params,
78
+ :form_params => form_params,
79
+ :body => post_body,
80
+ :auth_names => auth_names,
81
+ :return_type => return_type,
82
+ :api_version => "V2"
83
+ )
84
+
85
+ data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
86
+ if @api_client.config.debugging
87
+ @api_client.config.logger.debug "API called: UsageMeteringAPI#get_active_billing_dimensions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
88
+ end
89
+ return data, status_code, headers
90
+ end
91
+
26
92
  # Get cost across multi-org account.
27
93
  #
28
94
  # @see #get_cost_by_org_with_http_info
@@ -332,6 +398,181 @@ module DatadogAPIClient::V2
332
398
  return data, status_code, headers
333
399
  end
334
400
 
401
+ # Get Monthly Cost Attribution.
402
+ #
403
+ # @see #get_monthly_cost_attribution_with_http_info
404
+ def get_monthly_cost_attribution(start_month, end_month, fields, opts = {})
405
+ data, _status_code, _headers = get_monthly_cost_attribution_with_http_info(start_month, end_month, fields, opts)
406
+ data
407
+ end
408
+
409
+ # Get Monthly Cost Attribution.
410
+ #
411
+ # Get monthly cost attribution by tag across multi-org and single root-org accounts.
412
+ # Cost Attribution data for a given month becomes available no later than the 17th of the following month.
413
+ # This API endpoint is paginated. To make sure you receive all records, check if the value of `next_record_id` is
414
+ # set in the response. If it is, make another request and pass `next_record_id` as a parameter.
415
+ # Pseudo code example:
416
+ # ```
417
+ # response := GetMonthlyCostAttribution(start_month, end_month)
418
+ # cursor := response.metadata.pagination.next_record_id
419
+ # WHILE cursor != null BEGIN
420
+ # sleep(5 seconds) # Avoid running into rate limit
421
+ # response := GetMonthlyCostAttribution(start_month, end_month, next_record_id=cursor)
422
+ # cursor := response.metadata.pagination.next_record_id
423
+ # END
424
+ # ```
425
+ #
426
+ # @param start_month [Time] Datetime in ISO-8601 format, UTC, precise to month: `[YYYY-MM]` for cost beginning in this month.
427
+ # @param end_month [Time] Datetime in ISO-8601 format, UTC, precise to month: `[YYYY-MM]` for cost ending this month.
428
+ # @param fields [String] Comma-separated list specifying cost types (e.g., `<billing_dimension>_on_demand_cost`, `<billing_dimension>_committed_cost`, `<billing_dimension>_total_cost`) and the proportions (`<billing_dimension>_percentage_in_org`, `<billing_dimension>_percentage_in_account`). Use `*` to retrieve all fields. Example: `infra_host_on_demand_cost,infra_host_percentage_in_account` To obtain the complete list of active billing dimensions that can be used to replace `<billing_dimension>` in the field names, make a request to the [Get active billing dimensions API](https://docs.datadoghq.com/api/latest/usage-metering/#get-active-billing-dimensions-for-cost-attribution).
429
+ # @param opts [Hash] the optional parameters
430
+ # @option opts [SortDirection] :sort_direction The direction to sort by: `[desc, asc]`.
431
+ # @option opts [String] :sort_name The billing dimension to sort by. Always sorted by total cost. Example: `infra_host`.
432
+ # @option opts [String] :tag_breakdown_keys Comma separated list of tag keys used to group cost. If no value is provided the cost will not be broken down by tags. To see which tags are available, look for the value of `tag_config_source` in the API response.
433
+ # @option opts [String] :next_record_id List following results with a next_record_id provided in the previous query.
434
+ # @option opts [Boolean] :include_descendants Include child org cost in the response. Defaults to `true`.
435
+ # @return [Array<(MonthlyCostAttributionResponse, Integer, Hash)>] MonthlyCostAttributionResponse data, response status code and response headers
436
+ def get_monthly_cost_attribution_with_http_info(start_month, end_month, fields, opts = {})
437
+ unstable_enabled = @api_client.config.unstable_operations["v2.get_monthly_cost_attribution".to_sym]
438
+ if unstable_enabled
439
+ @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_monthly_cost_attribution")
440
+ else
441
+ raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_monthly_cost_attribution"))
442
+ end
443
+
444
+ if @api_client.config.debugging
445
+ @api_client.config.logger.debug 'Calling API: UsageMeteringAPI.get_monthly_cost_attribution ...'
446
+ end
447
+ # verify the required parameter 'start_month' is set
448
+ if @api_client.config.client_side_validation && start_month.nil?
449
+ fail ArgumentError, "Missing the required parameter 'start_month' when calling UsageMeteringAPI.get_monthly_cost_attribution"
450
+ end
451
+ # verify the required parameter 'end_month' is set
452
+ if @api_client.config.client_side_validation && end_month.nil?
453
+ fail ArgumentError, "Missing the required parameter 'end_month' when calling UsageMeteringAPI.get_monthly_cost_attribution"
454
+ end
455
+ # verify the required parameter 'fields' is set
456
+ if @api_client.config.client_side_validation && fields.nil?
457
+ fail ArgumentError, "Missing the required parameter 'fields' when calling UsageMeteringAPI.get_monthly_cost_attribution"
458
+ end
459
+ allowable_values = ['desc', 'asc']
460
+ if @api_client.config.client_side_validation && opts[:'sort_direction'] && !allowable_values.include?(opts[:'sort_direction'])
461
+ fail ArgumentError, "invalid value for \"sort_direction\", must be one of #{allowable_values}"
462
+ end
463
+ # resource path
464
+ local_var_path = '/api/v2/cost_by_tag/monthly_cost_attribution'
465
+
466
+ # query parameters
467
+ query_params = opts[:query_params] || {}
468
+ query_params[:'start_month'] = start_month
469
+ query_params[:'end_month'] = end_month
470
+ query_params[:'fields'] = fields
471
+ query_params[:'sort_direction'] = opts[:'sort_direction'] if !opts[:'sort_direction'].nil?
472
+ query_params[:'sort_name'] = opts[:'sort_name'] if !opts[:'sort_name'].nil?
473
+ query_params[:'tag_breakdown_keys'] = opts[:'tag_breakdown_keys'] if !opts[:'tag_breakdown_keys'].nil?
474
+ query_params[:'next_record_id'] = opts[:'next_record_id'] if !opts[:'next_record_id'].nil?
475
+ query_params[:'include_descendants'] = opts[:'include_descendants'] if !opts[:'include_descendants'].nil?
476
+
477
+ # header parameters
478
+ header_params = opts[:header_params] || {}
479
+ # HTTP header 'Accept' (if needed)
480
+ header_params['Accept'] = @api_client.select_header_accept(['application/json;datetime-format=rfc3339'])
481
+
482
+ # form parameters
483
+ form_params = opts[:form_params] || {}
484
+
485
+ # http body (model)
486
+ post_body = opts[:debug_body]
487
+
488
+ # return_type
489
+ return_type = opts[:debug_return_type] || 'MonthlyCostAttributionResponse'
490
+
491
+ # auth_names
492
+ auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]
493
+
494
+ new_options = opts.merge(
495
+ :operation => :get_monthly_cost_attribution,
496
+ :header_params => header_params,
497
+ :query_params => query_params,
498
+ :form_params => form_params,
499
+ :body => post_body,
500
+ :auth_names => auth_names,
501
+ :return_type => return_type,
502
+ :api_version => "V2"
503
+ )
504
+
505
+ data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
506
+ if @api_client.config.debugging
507
+ @api_client.config.logger.debug "API called: UsageMeteringAPI#get_monthly_cost_attribution\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
508
+ end
509
+ return data, status_code, headers
510
+ end
511
+
512
+ # Get projected cost across your account.
513
+ #
514
+ # @see #get_projected_cost_with_http_info
515
+ def get_projected_cost(opts = {})
516
+ data, _status_code, _headers = get_projected_cost_with_http_info(opts)
517
+ data
518
+ end
519
+
520
+ # Get projected cost across your account.
521
+ #
522
+ # Get projected cost across multi-org and single root-org accounts.
523
+ # Projected cost data is only available for the current month and becomes available around the 12th of the month.
524
+ # This endpoint requires the usage_read authorization scope.
525
+ #
526
+ # @param opts [Hash] the optional parameters
527
+ # @option opts [String] :view String to specify whether cost is broken down at a parent-org level or at the sub-org level. Available views are `summary` and `sub-org`. Defaults to `summary`.
528
+ # @return [Array<(ProjectedCostResponse, Integer, Hash)>] ProjectedCostResponse data, response status code and response headers
529
+ def get_projected_cost_with_http_info(opts = {})
530
+
531
+ if @api_client.config.debugging
532
+ @api_client.config.logger.debug 'Calling API: UsageMeteringAPI.get_projected_cost ...'
533
+ end
534
+ # resource path
535
+ local_var_path = '/api/v2/usage/projected_cost'
536
+
537
+ # query parameters
538
+ query_params = opts[:query_params] || {}
539
+ query_params[:'view'] = opts[:'view'] if !opts[:'view'].nil?
540
+
541
+ # header parameters
542
+ header_params = opts[:header_params] || {}
543
+ # HTTP header 'Accept' (if needed)
544
+ header_params['Accept'] = @api_client.select_header_accept(['application/json;datetime-format=rfc3339'])
545
+
546
+ # form parameters
547
+ form_params = opts[:form_params] || {}
548
+
549
+ # http body (model)
550
+ post_body = opts[:debug_body]
551
+
552
+ # return_type
553
+ return_type = opts[:debug_return_type] || 'ProjectedCostResponse'
554
+
555
+ # auth_names
556
+ auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]
557
+
558
+ new_options = opts.merge(
559
+ :operation => :get_projected_cost,
560
+ :header_params => header_params,
561
+ :query_params => query_params,
562
+ :form_params => form_params,
563
+ :body => post_body,
564
+ :auth_names => auth_names,
565
+ :return_type => return_type,
566
+ :api_version => "V2"
567
+ )
568
+
569
+ data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
570
+ if @api_client.config.debugging
571
+ @api_client.config.logger.debug "API called: UsageMeteringAPI#get_projected_cost\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
572
+ end
573
+ return data, status_code, headers
574
+ end
575
+
335
576
  # Get hourly usage for application security.
336
577
  #
337
578
  # @see #get_usage_application_security_monitoring_with_http_info
@@ -0,0 +1,92 @@
1
+ =begin
2
+ #Datadog API V2 Collection
3
+
4
+ #Collection of all Datadog Public endpoints.
5
+
6
+ The version of the OpenAPI document: 1.0
7
+ Contact: support@datadoghq.com
8
+ Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator
9
+
10
+ Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
11
+ This product includes software developed at Datadog (https://www.datadoghq.com/).
12
+ Copyright 2020-Present Datadog, Inc.
13
+
14
+ =end
15
+
16
+ require 'date'
17
+ require 'time'
18
+
19
+ module DatadogAPIClient::V2
20
+ # List of active billing dimensions.
21
+ class ActiveBillingDimensionsAttributes
22
+ include BaseGenericModel
23
+
24
+ # Datetime in ISO-8601 format, UTC, precise to hour: `[YYYY-MM-DDThh]`.
25
+ attr_accessor :month
26
+
27
+ # List of active billing dimensions. Example: `[infra_host, apm_host, serverless_infra]`.
28
+ attr_accessor :values
29
+
30
+ # Attribute mapping from ruby-style variable name to JSON key.
31
+ # @!visibility private
32
+ def self.attribute_map
33
+ {
34
+ :'month' => :'month',
35
+ :'values' => :'values'
36
+ }
37
+ end
38
+
39
+ # Attribute type mapping.
40
+ # @!visibility private
41
+ def self.openapi_types
42
+ {
43
+ :'month' => :'Time',
44
+ :'values' => :'Array<String>'
45
+ }
46
+ end
47
+
48
+ # Initializes the object
49
+ # @param attributes [Hash] Model attributes in the form of hash
50
+ # @!visibility private
51
+ def initialize(attributes = {})
52
+ if (!attributes.is_a?(Hash))
53
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ActiveBillingDimensionsAttributes` initialize method"
54
+ end
55
+
56
+ # check to see if the attribute exists and convert string to symbol for hash key
57
+ attributes = attributes.each_with_object({}) { |(k, v), h|
58
+ if (!self.class.attribute_map.key?(k.to_sym))
59
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::ActiveBillingDimensionsAttributes`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
60
+ end
61
+ h[k.to_sym] = v
62
+ }
63
+
64
+ if attributes.key?(:'month')
65
+ self.month = attributes[:'month']
66
+ end
67
+
68
+ if attributes.key?(:'values')
69
+ if (value = attributes[:'values']).is_a?(Array)
70
+ self.values = value
71
+ end
72
+ end
73
+ end
74
+
75
+ # Checks equality by comparing each attribute.
76
+ # @param o [Object] Object to be compared
77
+ # @!visibility private
78
+ def ==(o)
79
+ return true if self.equal?(o)
80
+ self.class == o.class &&
81
+ month == o.month &&
82
+ values == o.values
83
+ end
84
+
85
+ # Calculates hash code according to all attributes.
86
+ # @return [Integer] Hash code
87
+ # @!visibility private
88
+ def hash
89
+ [month, values].hash
90
+ end
91
+ end
92
+ end
@@ -0,0 +1,100 @@
1
+ =begin
2
+ #Datadog API V2 Collection
3
+
4
+ #Collection of all Datadog Public endpoints.
5
+
6
+ The version of the OpenAPI document: 1.0
7
+ Contact: support@datadoghq.com
8
+ Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator
9
+
10
+ Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
11
+ This product includes software developed at Datadog (https://www.datadoghq.com/).
12
+ Copyright 2020-Present Datadog, Inc.
13
+
14
+ =end
15
+
16
+ require 'date'
17
+ require 'time'
18
+
19
+ module DatadogAPIClient::V2
20
+ # Active billing dimensions data.
21
+ class ActiveBillingDimensionsBody
22
+ include BaseGenericModel
23
+
24
+ # List of active billing dimensions.
25
+ attr_accessor :attributes
26
+
27
+ # Unique ID of the response.
28
+ attr_accessor :id
29
+
30
+ # Type of active billing dimensions data.
31
+ attr_accessor :type
32
+
33
+ # Attribute mapping from ruby-style variable name to JSON key.
34
+ # @!visibility private
35
+ def self.attribute_map
36
+ {
37
+ :'attributes' => :'attributes',
38
+ :'id' => :'id',
39
+ :'type' => :'type'
40
+ }
41
+ end
42
+
43
+ # Attribute type mapping.
44
+ # @!visibility private
45
+ def self.openapi_types
46
+ {
47
+ :'attributes' => :'ActiveBillingDimensionsAttributes',
48
+ :'id' => :'String',
49
+ :'type' => :'ActiveBillingDimensionsType'
50
+ }
51
+ end
52
+
53
+ # Initializes the object
54
+ # @param attributes [Hash] Model attributes in the form of hash
55
+ # @!visibility private
56
+ def initialize(attributes = {})
57
+ if (!attributes.is_a?(Hash))
58
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ActiveBillingDimensionsBody` initialize method"
59
+ end
60
+
61
+ # check to see if the attribute exists and convert string to symbol for hash key
62
+ attributes = attributes.each_with_object({}) { |(k, v), h|
63
+ if (!self.class.attribute_map.key?(k.to_sym))
64
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::ActiveBillingDimensionsBody`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
65
+ end
66
+ h[k.to_sym] = v
67
+ }
68
+
69
+ if attributes.key?(:'attributes')
70
+ self.attributes = attributes[:'attributes']
71
+ end
72
+
73
+ if attributes.key?(:'id')
74
+ self.id = attributes[:'id']
75
+ end
76
+
77
+ if attributes.key?(:'type')
78
+ self.type = attributes[:'type']
79
+ end
80
+ end
81
+
82
+ # Checks equality by comparing each attribute.
83
+ # @param o [Object] Object to be compared
84
+ # @!visibility private
85
+ def ==(o)
86
+ return true if self.equal?(o)
87
+ self.class == o.class &&
88
+ attributes == o.attributes &&
89
+ id == o.id &&
90
+ type == o.type
91
+ end
92
+
93
+ # Calculates hash code according to all attributes.
94
+ # @return [Integer] Hash code
95
+ # @!visibility private
96
+ def hash
97
+ [attributes, id, type].hash
98
+ end
99
+ end
100
+ end
@@ -0,0 +1,80 @@
1
+ =begin
2
+ #Datadog API V2 Collection
3
+
4
+ #Collection of all Datadog Public endpoints.
5
+
6
+ The version of the OpenAPI document: 1.0
7
+ Contact: support@datadoghq.com
8
+ Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator
9
+
10
+ Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
11
+ This product includes software developed at Datadog (https://www.datadoghq.com/).
12
+ Copyright 2020-Present Datadog, Inc.
13
+
14
+ =end
15
+
16
+ require 'date'
17
+ require 'time'
18
+
19
+ module DatadogAPIClient::V2
20
+ # Active billing dimensions response.
21
+ class ActiveBillingDimensionsResponse
22
+ include BaseGenericModel
23
+
24
+ # Active billing dimensions data.
25
+ attr_accessor :data
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ # @!visibility private
29
+ def self.attribute_map
30
+ {
31
+ :'data' => :'data'
32
+ }
33
+ end
34
+
35
+ # Attribute type mapping.
36
+ # @!visibility private
37
+ def self.openapi_types
38
+ {
39
+ :'data' => :'ActiveBillingDimensionsBody'
40
+ }
41
+ end
42
+
43
+ # Initializes the object
44
+ # @param attributes [Hash] Model attributes in the form of hash
45
+ # @!visibility private
46
+ def initialize(attributes = {})
47
+ if (!attributes.is_a?(Hash))
48
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ActiveBillingDimensionsResponse` initialize method"
49
+ end
50
+
51
+ # check to see if the attribute exists and convert string to symbol for hash key
52
+ attributes = attributes.each_with_object({}) { |(k, v), h|
53
+ if (!self.class.attribute_map.key?(k.to_sym))
54
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::ActiveBillingDimensionsResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
55
+ end
56
+ h[k.to_sym] = v
57
+ }
58
+
59
+ if attributes.key?(:'data')
60
+ self.data = attributes[:'data']
61
+ end
62
+ end
63
+
64
+ # Checks equality by comparing each attribute.
65
+ # @param o [Object] Object to be compared
66
+ # @!visibility private
67
+ def ==(o)
68
+ return true if self.equal?(o)
69
+ self.class == o.class &&
70
+ data == o.data
71
+ end
72
+
73
+ # Calculates hash code according to all attributes.
74
+ # @return [Integer] Hash code
75
+ # @!visibility private
76
+ def hash
77
+ [data].hash
78
+ end
79
+ end
80
+ end
@@ -0,0 +1,26 @@
1
+ =begin
2
+ #Datadog API V2 Collection
3
+
4
+ #Collection of all Datadog Public endpoints.
5
+
6
+ The version of the OpenAPI document: 1.0
7
+ Contact: support@datadoghq.com
8
+ Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator
9
+
10
+ Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
11
+ This product includes software developed at Datadog (https://www.datadoghq.com/).
12
+ Copyright 2020-Present Datadog, Inc.
13
+
14
+ =end
15
+
16
+ require 'date'
17
+ require 'time'
18
+
19
+ module DatadogAPIClient::V2
20
+ # Type of active billing dimensions data.
21
+ class ActiveBillingDimensionsType
22
+ include BaseEnumModel
23
+
24
+ BILLING_DIMENSIONS = "billing_dimensions".freeze
25
+ end
26
+ end
@@ -27,12 +27,16 @@ module DatadogAPIClient::V2
27
27
  # Array of objects related to the API key.
28
28
  attr_accessor :included
29
29
 
30
+ # Additional information related to api keys response.
31
+ attr_accessor :meta
32
+
30
33
  # Attribute mapping from ruby-style variable name to JSON key.
31
34
  # @!visibility private
32
35
  def self.attribute_map
33
36
  {
34
37
  :'data' => :'data',
35
- :'included' => :'included'
38
+ :'included' => :'included',
39
+ :'meta' => :'meta'
36
40
  }
37
41
  end
38
42
 
@@ -41,7 +45,8 @@ module DatadogAPIClient::V2
41
45
  def self.openapi_types
42
46
  {
43
47
  :'data' => :'Array<PartialAPIKey>',
44
- :'included' => :'Array<APIKeyResponseIncludedItem>'
48
+ :'included' => :'Array<APIKeyResponseIncludedItem>',
49
+ :'meta' => :'APIKeysResponseMeta'
45
50
  }
46
51
  end
47
52
 
@@ -72,6 +77,10 @@ module DatadogAPIClient::V2
72
77
  self.included = value
73
78
  end
74
79
  end
80
+
81
+ if attributes.key?(:'meta')
82
+ self.meta = attributes[:'meta']
83
+ end
75
84
  end
76
85
 
77
86
  # Checks equality by comparing each attribute.
@@ -81,14 +90,15 @@ module DatadogAPIClient::V2
81
90
  return true if self.equal?(o)
82
91
  self.class == o.class &&
83
92
  data == o.data &&
84
- included == o.included
93
+ included == o.included &&
94
+ meta == o.meta
85
95
  end
86
96
 
87
97
  # Calculates hash code according to all attributes.
88
98
  # @return [Integer] Hash code
89
99
  # @!visibility private
90
100
  def hash
91
- [data, included].hash
101
+ [data, included, meta].hash
92
102
  end
93
103
  end
94
104
  end