datadog_api_client 2.18.0 → 2.20.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.apigentools-info +4 -4
- data/.generator/conftest.py +1 -1
- data/.generator/poetry.lock +69 -69
- data/.generator/schemas/v1/openapi.yaml +286 -55
- data/.generator/schemas/v2/openapi.yaml +2021 -226
- data/.generator/src/generator/templates/api.j2 +5 -5
- data/.generator/src/generator/templates/model_generic.j2 +2 -2
- data/CHANGELOG.md +38 -0
- data/examples/v1/azure-integration/CreateAzureIntegration.rb +4 -4
- data/examples/v1/azure-integration/DeleteAzureIntegration.rb +2 -15
- data/examples/v1/azure-integration/UpdateAzureIntegration.rb +4 -4
- data/examples/v1/gcp-integration/CreateGCPIntegration.rb +4 -5
- data/examples/v1/gcp-integration/DeleteGCPIntegration.rb +2 -14
- data/examples/v1/gcp-integration/UpdateGCPIntegration.rb +4 -5
- data/examples/v1/logs-indexes/CreateLogsIndex.rb +5 -0
- data/examples/v1/logs-indexes/UpdateLogsIndex.rb +5 -0
- data/examples/v1/service-level-objectives/CreateSLO_3765703239.rb +46 -0
- data/examples/v1/synthetics/CreateSyntheticsAPITest.rb +1 -1
- data/examples/v1/synthetics/CreateSyntheticsBrowserTest.rb +1 -1
- data/examples/v1/synthetics/TriggerCITests.rb +1 -1
- data/examples/v1/synthetics/UpdateBrowserTest.rb +1 -1
- data/examples/v1/usage-metering/GetUsageLambda.rb +5 -2
- data/examples/v2/api-management/CreateOpenAPI.rb +11 -0
- data/examples/v2/api-management/DeleteOpenAPI.rb +11 -0
- data/examples/v2/api-management/GetOpenAPI.rb +11 -0
- data/examples/v2/api-management/UpdateOpenAPI.rb +14 -0
- data/examples/v2/ci-visibility-pipelines/CreateCIAppPipelineEvent.rb +0 -3
- data/examples/v2/ci-visibility-pipelines/CreateCIAppPipelineEvent_129899466.rb +0 -3
- data/examples/v2/cloud-cost-management/CreateCostAWSCURConfig.rb +18 -0
- data/examples/v2/cloud-cost-management/CreateCostAzureUCConfigs.rb +29 -0
- data/examples/v2/cloud-cost-management/DeleteCostAWSCURConfig.rb +5 -0
- data/examples/v2/cloud-cost-management/DeleteCostAzureUCConfig.rb +5 -0
- data/examples/v2/cloud-cost-management/GetCloudCostActivity.rb +5 -0
- data/examples/v2/cloud-cost-management/ListAWSRelatedAccounts.rb +5 -0
- data/examples/v2/cloud-cost-management/ListCostAWSCURConfigs.rb +5 -0
- data/examples/v2/cloud-cost-management/ListCostAzureUCConfigs.rb +5 -0
- data/examples/v2/cloud-cost-management/UpdateCostAWSCURConfig.rb +14 -0
- data/examples/v2/cloud-cost-management/UpdateCostAzureUCConfigs.rb +14 -0
- data/examples/v2/cloudflare-integration/CreateCloudflareAccount.rb +1 -1
- data/examples/v2/cloudflare-integration/UpdateCloudflareAccount.rb +4 -1
- data/examples/v2/downtimes/ListMonitorDowntimes_3316718253.rb +5 -0
- data/examples/v2/gcp-integration/CreateGCPSTSAccount_130557025.rb +16 -0
- data/examples/v2/gcp-integration/CreateGCPSTSAccount_2597004741.rb +16 -0
- data/examples/v2/gcp-integration/CreateGCPSTSAccount_4235664992.rb +17 -0
- data/examples/v2/gcp-integration/UpdateGCPSTSAccount_3205636354.rb +19 -0
- data/examples/v2/okta-integration/CreateOktaAccount.rb +1 -1
- data/examples/v2/security-monitoring/CreateSecurityMonitoringRule_3367706049.rb +46 -0
- data/examples/v2/security-monitoring/CreateSecurityMonitoringSuppression.rb +19 -0
- data/examples/v2/security-monitoring/DeleteSecurityMonitoringSuppression.rb +8 -0
- data/examples/v2/security-monitoring/GetSecurityMonitoringSuppression.rb +8 -0
- data/examples/v2/security-monitoring/ListSecurityMonitoringSuppressions.rb +5 -0
- data/examples/v2/security-monitoring/UpdateSecurityMonitoringSuppression.rb +17 -0
- data/examples/v2/sensitive-data-scanner/CreateScanningRule.rb +7 -0
- data/examples/v2/sensitive-data-scanner/UpdateScanningRule.rb +7 -10
- data/examples/v2/teams/CreateTeamMembership.rb +6 -0
- data/examples/v2/teams/GetTeamMemberships_3799131168.rb +8 -0
- data/examples/v2/usage-metering/GetUsageLambdaTracedInvocations.rb +1 -1
- data/lib/datadog_api_client/configuration.rb +4 -1
- data/lib/datadog_api_client/inflector.rb +74 -0
- data/lib/datadog_api_client/v1/api/downtimes_api.rb +28 -7
- data/lib/datadog_api_client/v1/api/monitors_api.rb +1 -1
- data/lib/datadog_api_client/v1/api/organizations_api.rb +1 -1
- data/lib/datadog_api_client/v1/api/usage_metering_api.rb +3 -3
- data/lib/datadog_api_client/v1/models/dashboard.rb +5 -1
- data/lib/datadog_api_client/v1/models/dashboard_summary_definition.rb +2 -0
- data/lib/datadog_api_client/v1/models/gcp_account.rb +22 -2
- data/lib/datadog_api_client/v1/models/log.rb +1 -1
- data/lib/datadog_api_client/v1/models/logs_daily_limit_reset.rb +90 -0
- data/lib/datadog_api_client/v1/models/logs_index.rb +36 -1
- data/lib/datadog_api_client/v1/models/logs_index_update_request.rb +36 -1
- data/lib/datadog_api_client/v1/models/metrics_payload.rb +1 -1
- data/lib/datadog_api_client/v1/models/metrics_query_metadata.rb +1 -1
- data/lib/datadog_api_client/v1/models/organization.rb +1 -1
- data/lib/datadog_api_client/v1/models/service_level_objective.rb +11 -1
- data/lib/datadog_api_client/v1/models/service_level_objective_request.rb +11 -1
- data/lib/datadog_api_client/v1/models/slo_correction_create_request_attributes.rb +1 -1
- data/lib/datadog_api_client/v1/models/slo_correction_response_attributes.rb +1 -1
- data/lib/datadog_api_client/v1/models/slo_correction_update_request_attributes.rb +1 -1
- data/lib/datadog_api_client/v1/models/slo_data_source_query_definition.rb +62 -0
- data/lib/datadog_api_client/v1/models/slo_formula.rb +98 -0
- data/lib/datadog_api_client/v1/models/slo_history_metrics.rb +2 -2
- data/lib/datadog_api_client/v1/models/slo_history_metrics_series.rb +1 -1
- data/lib/datadog_api_client/v1/models/slo_history_monitor.rb +1 -1
- data/lib/datadog_api_client/v1/models/slo_history_sli_data.rb +1 -1
- data/lib/datadog_api_client/v1/models/slo_response_data.rb +11 -1
- data/lib/datadog_api_client/v1/models/slo_sli_spec.rb +62 -0
- data/lib/datadog_api_client/v1/models/slo_time_slice_comparator.rb +29 -0
- data/lib/datadog_api_client/v1/models/slo_time_slice_condition.rb +141 -0
- data/lib/datadog_api_client/v1/models/slo_time_slice_query.rb +131 -0
- data/lib/datadog_api_client/v1/models/slo_time_slice_spec.rb +99 -0
- data/lib/datadog_api_client/v1/models/slo_type.rb +1 -0
- data/lib/datadog_api_client/v1/models/slo_type_numeric.rb +1 -0
- data/lib/datadog_api_client/v1/models/split_config.rb +6 -6
- data/lib/datadog_api_client/v1/models/synthetics_test_request.rb +11 -1
- data/lib/datadog_api_client/v1/models/usage_lambda_hour.rb +1 -1
- data/lib/datadog_api_client/v1/models/usage_lambda_response.rb +1 -1
- data/lib/datadog_api_client/v1/models/usage_summary_date.rb +11 -1
- data/lib/datadog_api_client/v1/models/usage_summary_date_org.rb +11 -1
- data/lib/datadog_api_client/v1/models/usage_summary_response.rb +11 -1
- data/lib/datadog_api_client/v2/api/api_management_api.rb +319 -0
- data/lib/datadog_api_client/v2/api/ci_visibility_pipelines_api.rb +0 -6
- data/lib/datadog_api_client/v2/api/cloud_cost_management_api.rb +680 -0
- data/lib/datadog_api_client/v2/api/downtimes_api.rb +25 -0
- data/lib/datadog_api_client/v2/api/metrics_api.rb +3 -2
- data/lib/datadog_api_client/v2/api/organizations_api.rb +1 -1
- data/lib/datadog_api_client/v2/api/security_monitoring_api.rb +329 -0
- data/lib/datadog_api_client/v2/api/teams_api.rb +22 -0
- data/lib/datadog_api_client/v2/api/usage_metering_api.rb +3 -3
- data/lib/datadog_api_client/v2/models/aws_cur_config.rb +129 -0
- data/lib/datadog_api_client/v2/models/aws_cur_config_attributes.rb +305 -0
- data/lib/datadog_api_client/v2/models/aws_cur_config_patch_data.rb +119 -0
- data/lib/datadog_api_client/v2/models/aws_cur_config_patch_request.rb +98 -0
- data/lib/datadog_api_client/v2/models/aws_cur_config_patch_request_attributes.rb +98 -0
- data/lib/datadog_api_client/v2/models/aws_cur_config_patch_request_type.rb +26 -0
- data/lib/datadog_api_client/v2/models/aws_cur_config_post_data.rb +119 -0
- data/lib/datadog_api_client/v2/models/aws_cur_config_post_request.rb +98 -0
- data/lib/datadog_api_client/v2/models/aws_cur_config_post_request_attributes.rb +202 -0
- data/lib/datadog_api_client/v2/models/aws_cur_config_post_request_type.rb +26 -0
- data/lib/datadog_api_client/v2/models/aws_cur_config_response.rb +80 -0
- data/lib/datadog_api_client/v2/models/aws_cur_config_type.rb +26 -0
- data/lib/datadog_api_client/v2/models/aws_cur_configs_response.rb +82 -0
- data/lib/datadog_api_client/v2/models/aws_related_account.rb +129 -0
- data/lib/datadog_api_client/v2/models/aws_related_account_attributes.rb +90 -0
- data/lib/datadog_api_client/v2/models/aws_related_account_type.rb +26 -0
- data/lib/datadog_api_client/v2/models/aws_related_accounts_response.rb +82 -0
- data/lib/datadog_api_client/v2/models/azure_uc_config.rb +378 -0
- data/lib/datadog_api_client/v2/models/azure_uc_config_pair.rb +129 -0
- data/lib/datadog_api_client/v2/models/azure_uc_config_pair_attributes.rb +110 -0
- data/lib/datadog_api_client/v2/models/azure_uc_config_pair_type.rb +26 -0
- data/lib/datadog_api_client/v2/models/azure_uc_config_pairs_response.rb +80 -0
- data/lib/datadog_api_client/v2/models/azure_uc_config_patch_data.rb +119 -0
- data/lib/datadog_api_client/v2/models/azure_uc_config_patch_request.rb +98 -0
- data/lib/datadog_api_client/v2/models/azure_uc_config_patch_request_attributes.rb +98 -0
- data/lib/datadog_api_client/v2/models/azure_uc_config_patch_request_type.rb +26 -0
- data/lib/datadog_api_client/v2/models/azure_uc_config_post_data.rb +119 -0
- data/lib/datadog_api_client/v2/models/azure_uc_config_post_request.rb +98 -0
- data/lib/datadog_api_client/v2/models/azure_uc_config_post_request_attributes.rb +192 -0
- data/lib/datadog_api_client/v2/models/azure_uc_config_post_request_type.rb +26 -0
- data/lib/datadog_api_client/v2/models/azure_uc_configs_response.rb +82 -0
- data/lib/datadog_api_client/v2/models/bill_config.rb +161 -0
- data/lib/datadog_api_client/v2/models/ci_app_git_info.rb +2 -2
- data/lib/datadog_api_client/v2/models/cloud_cost_activity.rb +119 -0
- data/lib/datadog_api_client/v2/models/cloud_cost_activity_attributes.rb +98 -0
- data/lib/datadog_api_client/v2/models/cloud_cost_activity_response.rb +80 -0
- data/lib/datadog_api_client/v2/models/cloud_cost_activity_type.rb +26 -0
- data/lib/datadog_api_client/v2/models/cloudflare_account_create_request_attributes.rb +28 -4
- data/lib/datadog_api_client/v2/models/cloudflare_account_response_attributes.rb +28 -4
- data/lib/datadog_api_client/v2/models/cloudflare_account_update_request_attributes.rb +28 -4
- data/lib/datadog_api_client/v2/models/create_open_api_response.rb +80 -0
- data/lib/datadog_api_client/v2/models/create_open_api_response_attributes.rb +82 -0
- data/lib/datadog_api_client/v2/models/create_open_api_response_data.rb +90 -0
- data/lib/datadog_api_client/v2/models/dora_deployment_request_attributes.rb +11 -1
- data/lib/datadog_api_client/v2/models/dora_git_info.rb +2 -2
- data/lib/datadog_api_client/v2/models/dora_incident_request_attributes.rb +11 -1
- data/lib/datadog_api_client/v2/models/gcpsts_service_account_attributes.rb +25 -5
- data/lib/datadog_api_client/v2/models/metric_payload.rb +1 -1
- data/lib/datadog_api_client/v2/models/open_api_endpoint.rb +90 -0
- data/lib/datadog_api_client/v2/models/open_api_file.rb +80 -0
- data/lib/datadog_api_client/v2/models/relationship_to_user_team_team.rb +98 -0
- data/lib/datadog_api_client/v2/models/relationship_to_user_team_team_data.rb +119 -0
- data/lib/datadog_api_client/v2/models/security_monitoring_rule_options.rb +14 -4
- data/lib/datadog_api_client/v2/models/security_monitoring_rule_third_party_options.rb +114 -0
- data/lib/datadog_api_client/v2/models/security_monitoring_rule_update_payload.rb +13 -1
- data/lib/datadog_api_client/v2/models/security_monitoring_standard_rule_create_payload.rb +13 -1
- data/lib/datadog_api_client/v2/models/security_monitoring_standard_rule_response.rb +13 -1
- data/lib/datadog_api_client/v2/models/security_monitoring_suppression.rb +100 -0
- data/lib/datadog_api_client/v2/models/security_monitoring_suppression_attributes.rb +198 -0
- data/lib/datadog_api_client/v2/models/security_monitoring_suppression_create_attributes.rb +181 -0
- data/lib/datadog_api_client/v2/models/security_monitoring_suppression_create_data.rb +119 -0
- data/lib/datadog_api_client/v2/models/security_monitoring_suppression_create_request.rb +98 -0
- data/lib/datadog_api_client/v2/models/security_monitoring_suppression_response.rb +80 -0
- data/lib/datadog_api_client/v2/models/security_monitoring_suppression_type.rb +26 -0
- data/lib/datadog_api_client/v2/models/security_monitoring_suppression_update_attributes.rb +166 -0
- data/lib/datadog_api_client/v2/models/security_monitoring_suppression_update_data.rb +119 -0
- data/lib/datadog_api_client/v2/models/security_monitoring_suppression_update_request.rb +98 -0
- data/lib/datadog_api_client/v2/models/security_monitoring_suppressions_response.rb +82 -0
- data/lib/datadog_api_client/v2/models/security_monitoring_third_party_root_query.rb +92 -0
- data/lib/datadog_api_client/v2/models/security_monitoring_third_party_rule_case.rb +112 -0
- data/lib/datadog_api_client/v2/models/security_monitoring_third_party_rule_case_create.rb +130 -0
- data/lib/datadog_api_client/v2/models/security_monitoring_user.rb +98 -0
- data/lib/datadog_api_client/v2/models/sensitive_data_scanner_included_keyword_configuration.rb +134 -0
- data/lib/datadog_api_client/v2/models/sensitive_data_scanner_rule_attributes.rb +46 -1
- data/lib/datadog_api_client/v2/models/sensitive_data_scanner_standard_pattern_attributes.rb +33 -1
- data/lib/datadog_api_client/v2/models/update_open_api_response.rb +80 -0
- data/lib/datadog_api_client/v2/models/update_open_api_response_attributes.rb +82 -0
- data/lib/datadog_api_client/v2/models/update_open_api_response_data.rb +90 -0
- data/lib/datadog_api_client/v2/models/user_team_attributes.rb +24 -1
- data/lib/datadog_api_client/v2/models/user_team_relationships.rb +11 -1
- data/lib/datadog_api_client/v2/models/user_team_team_type.rb +26 -0
- data/lib/datadog_api_client/version.rb +1 -1
- metadata +103 -3
- data/examples/v1/usage-metering/GetUsageLambda_3132428705.rb +0 -8
@@ -325,6 +325,8 @@ module DatadogAPIClient::V2
|
|
325
325
|
#
|
326
326
|
# @param monitor_id [Integer] The id of the monitor.
|
327
327
|
# @param opts [Hash] the optional parameters
|
328
|
+
# @option opts [Integer] :page_offset Specific offset to use as the beginning of the returned page.
|
329
|
+
# @option opts [Integer] :page_limit Maximum number of downtimes in the response.
|
328
330
|
# @return [Array<(MonitorDowntimeMatchResponse, Integer, Hash)>] MonitorDowntimeMatchResponse data, response status code and response headers
|
329
331
|
def list_monitor_downtimes_with_http_info(monitor_id, opts = {})
|
330
332
|
|
@@ -340,6 +342,8 @@ module DatadogAPIClient::V2
|
|
340
342
|
|
341
343
|
# query parameters
|
342
344
|
query_params = opts[:query_params] || {}
|
345
|
+
query_params[:'page[offset]'] = opts[:'page_offset'] if !opts[:'page_offset'].nil?
|
346
|
+
query_params[:'page[limit]'] = opts[:'page_limit'] if !opts[:'page_limit'].nil?
|
343
347
|
|
344
348
|
# header parameters
|
345
349
|
header_params = opts[:header_params] || {}
|
@@ -376,6 +380,27 @@ module DatadogAPIClient::V2
|
|
376
380
|
return data, status_code, headers
|
377
381
|
end
|
378
382
|
|
383
|
+
# Get active downtimes for a monitor.
|
384
|
+
#
|
385
|
+
# Provide a paginated version of {#list_monitor_downtimes}, returning all items.
|
386
|
+
#
|
387
|
+
# To use it you need to use a block: list_monitor_downtimes_with_pagination { |item| p item }
|
388
|
+
#
|
389
|
+
# @yield [MonitorDowntimeMatchResponseData] Paginated items
|
390
|
+
def list_monitor_downtimes_with_pagination(monitor_id, opts = {})
|
391
|
+
api_version = "V2"
|
392
|
+
page_size = @api_client.get_attribute_from_path(opts, "page_limit", 30)
|
393
|
+
@api_client.set_attribute_from_path(api_version, opts, "page_limit", Integer, page_size)
|
394
|
+
while true do
|
395
|
+
response = list_monitor_downtimes(monitor_id, opts)
|
396
|
+
@api_client.get_attribute_from_path(response, "data").each { |item| yield(item) }
|
397
|
+
if @api_client.get_attribute_from_path(response, "data").length < page_size
|
398
|
+
break
|
399
|
+
end
|
400
|
+
@api_client.set_attribute_from_path(api_version, opts, "page_offset", Integer, @api_client.get_attribute_from_path(opts, "page_offset", 0) + page_size)
|
401
|
+
end
|
402
|
+
end
|
403
|
+
|
379
404
|
# Update a downtime.
|
380
405
|
#
|
381
406
|
# @see #update_downtime_with_http_info
|
@@ -541,7 +541,7 @@ module DatadogAPIClient::V2
|
|
541
541
|
# @option opts [String] :filter_tags_configured Filter tag configurations by configured tags.
|
542
542
|
# @option opts [MetricTagConfigurationMetricTypes] :filter_metric_type Filter metrics by metric type.
|
543
543
|
# @option opts [Boolean] :filter_include_percentiles Filter distributions with additional percentile aggregations enabled or disabled.
|
544
|
-
# @option opts [Boolean] :filter_queried Filter custom metrics that have or have not been queried in the specified window[seconds]. If no window is provided or the window is less than 2 hours, a default of 2 hours will be applied.
|
544
|
+
# @option opts [Boolean] :filter_queried (Beta) Filter custom metrics that have or have not been queried in the specified window[seconds]. If no window is provided or the window is less than 2 hours, a default of 2 hours will be applied.
|
545
545
|
# @option opts [String] :filter_tags Filter metrics that have been submitted with the given tags. Supports boolean and wildcard expressions. Can only be combined with the filter[queried] filter.
|
546
546
|
# @option opts [Integer] :window_seconds The number of seconds of look back (from now) to apply to a filter[tag] or filter[queried] query. Default value is 3600 (1 hour), maximum value is 2,592,000 (30 days).
|
547
547
|
# @return [Array<(MetricsAndMetricTagConfigurationsResponse, Integer, Hash)>] MetricsAndMetricTagConfigurationsResponse data, response status code and response headers
|
@@ -980,7 +980,8 @@ module DatadogAPIClient::V2
|
|
980
980
|
# Update the tag configuration of a metric or percentile aggregations of a distribution metric or custom aggregations
|
981
981
|
# of a count, rate, or gauge metric. By setting `exclude_tags_mode` to true the behavior is changed
|
982
982
|
# from an allow-list to a deny-list, and tags in the defined list will not be queryable.
|
983
|
-
# Can only be used with application keys from users with the `Manage Tags for Metrics` permission.
|
983
|
+
# Can only be used with application keys from users with the `Manage Tags for Metrics` permission. This endpoint requires
|
984
|
+
# a tag configuration to be created first.
|
984
985
|
#
|
985
986
|
# @param metric_name [String] The name of the metric.
|
986
987
|
# @param body [MetricTagConfigurationUpdateRequest]
|
@@ -63,7 +63,7 @@ module DatadogAPIClient::V2
|
|
63
63
|
form_params['idp_file'] = opts[:'idp_file'] if !opts[:'idp_file'].nil?
|
64
64
|
|
65
65
|
# http body (model)
|
66
|
-
post_body = opts[:debug_body]
|
66
|
+
post_body = opts[:debug_body]
|
67
67
|
|
68
68
|
# return_type
|
69
69
|
return_type = opts[:debug_return_type]
|
@@ -160,6 +160,73 @@ module DatadogAPIClient::V2
|
|
160
160
|
return data, status_code, headers
|
161
161
|
end
|
162
162
|
|
163
|
+
# Create a suppression rule.
|
164
|
+
#
|
165
|
+
# @see #create_security_monitoring_suppression_with_http_info
|
166
|
+
def create_security_monitoring_suppression(body, opts = {})
|
167
|
+
data, _status_code, _headers = create_security_monitoring_suppression_with_http_info(body, opts)
|
168
|
+
data
|
169
|
+
end
|
170
|
+
|
171
|
+
# Create a suppression rule.
|
172
|
+
#
|
173
|
+
# Create a new suppression rule.
|
174
|
+
#
|
175
|
+
# @param body [SecurityMonitoringSuppressionCreateRequest] The definition of the new suppression rule.
|
176
|
+
# @param opts [Hash] the optional parameters
|
177
|
+
# @return [Array<(SecurityMonitoringSuppressionResponse, Integer, Hash)>] SecurityMonitoringSuppressionResponse data, response status code and response headers
|
178
|
+
def create_security_monitoring_suppression_with_http_info(body, opts = {})
|
179
|
+
|
180
|
+
if @api_client.config.debugging
|
181
|
+
@api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.create_security_monitoring_suppression ...'
|
182
|
+
end
|
183
|
+
# verify the required parameter 'body' is set
|
184
|
+
if @api_client.config.client_side_validation && body.nil?
|
185
|
+
fail ArgumentError, "Missing the required parameter 'body' when calling SecurityMonitoringAPI.create_security_monitoring_suppression"
|
186
|
+
end
|
187
|
+
# resource path
|
188
|
+
local_var_path = '/api/v2/security_monitoring/configuration/suppressions'
|
189
|
+
|
190
|
+
# query parameters
|
191
|
+
query_params = opts[:query_params] || {}
|
192
|
+
|
193
|
+
# header parameters
|
194
|
+
header_params = opts[:header_params] || {}
|
195
|
+
# HTTP header 'Accept' (if needed)
|
196
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
197
|
+
# HTTP header 'Content-Type'
|
198
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
199
|
+
|
200
|
+
# form parameters
|
201
|
+
form_params = opts[:form_params] || {}
|
202
|
+
|
203
|
+
# http body (model)
|
204
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
|
205
|
+
|
206
|
+
# return_type
|
207
|
+
return_type = opts[:debug_return_type] || 'SecurityMonitoringSuppressionResponse'
|
208
|
+
|
209
|
+
# auth_names
|
210
|
+
auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]
|
211
|
+
|
212
|
+
new_options = opts.merge(
|
213
|
+
:operation => :create_security_monitoring_suppression,
|
214
|
+
:header_params => header_params,
|
215
|
+
:query_params => query_params,
|
216
|
+
:form_params => form_params,
|
217
|
+
:body => post_body,
|
218
|
+
:auth_names => auth_names,
|
219
|
+
:return_type => return_type,
|
220
|
+
:api_version => "V2"
|
221
|
+
)
|
222
|
+
|
223
|
+
data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options)
|
224
|
+
if @api_client.config.debugging
|
225
|
+
@api_client.config.logger.debug "API called: SecurityMonitoringAPI#create_security_monitoring_suppression\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
226
|
+
end
|
227
|
+
return data, status_code, headers
|
228
|
+
end
|
229
|
+
|
163
230
|
# Delete a security filter.
|
164
231
|
#
|
165
232
|
# @see #delete_security_filter_with_http_info
|
@@ -290,6 +357,71 @@ module DatadogAPIClient::V2
|
|
290
357
|
return data, status_code, headers
|
291
358
|
end
|
292
359
|
|
360
|
+
# Delete a suppression rule.
|
361
|
+
#
|
362
|
+
# @see #delete_security_monitoring_suppression_with_http_info
|
363
|
+
def delete_security_monitoring_suppression(suppression_id, opts = {})
|
364
|
+
delete_security_monitoring_suppression_with_http_info(suppression_id, opts)
|
365
|
+
nil
|
366
|
+
end
|
367
|
+
|
368
|
+
# Delete a suppression rule.
|
369
|
+
#
|
370
|
+
# Delete a specific suppression rule.
|
371
|
+
#
|
372
|
+
# @param suppression_id [String] The ID of the suppression rule
|
373
|
+
# @param opts [Hash] the optional parameters
|
374
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
375
|
+
def delete_security_monitoring_suppression_with_http_info(suppression_id, opts = {})
|
376
|
+
|
377
|
+
if @api_client.config.debugging
|
378
|
+
@api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.delete_security_monitoring_suppression ...'
|
379
|
+
end
|
380
|
+
# verify the required parameter 'suppression_id' is set
|
381
|
+
if @api_client.config.client_side_validation && suppression_id.nil?
|
382
|
+
fail ArgumentError, "Missing the required parameter 'suppression_id' when calling SecurityMonitoringAPI.delete_security_monitoring_suppression"
|
383
|
+
end
|
384
|
+
# resource path
|
385
|
+
local_var_path = '/api/v2/security_monitoring/configuration/suppressions/{suppression_id}'.sub('{suppression_id}', CGI.escape(suppression_id.to_s).gsub('%2F', '/'))
|
386
|
+
|
387
|
+
# query parameters
|
388
|
+
query_params = opts[:query_params] || {}
|
389
|
+
|
390
|
+
# header parameters
|
391
|
+
header_params = opts[:header_params] || {}
|
392
|
+
# HTTP header 'Accept' (if needed)
|
393
|
+
header_params['Accept'] = @api_client.select_header_accept(['*/*'])
|
394
|
+
|
395
|
+
# form parameters
|
396
|
+
form_params = opts[:form_params] || {}
|
397
|
+
|
398
|
+
# http body (model)
|
399
|
+
post_body = opts[:debug_body]
|
400
|
+
|
401
|
+
# return_type
|
402
|
+
return_type = opts[:debug_return_type]
|
403
|
+
|
404
|
+
# auth_names
|
405
|
+
auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]
|
406
|
+
|
407
|
+
new_options = opts.merge(
|
408
|
+
:operation => :delete_security_monitoring_suppression,
|
409
|
+
:header_params => header_params,
|
410
|
+
:query_params => query_params,
|
411
|
+
:form_params => form_params,
|
412
|
+
:body => post_body,
|
413
|
+
:auth_names => auth_names,
|
414
|
+
:return_type => return_type,
|
415
|
+
:api_version => "V2"
|
416
|
+
)
|
417
|
+
|
418
|
+
data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options)
|
419
|
+
if @api_client.config.debugging
|
420
|
+
@api_client.config.logger.debug "API called: SecurityMonitoringAPI#delete_security_monitoring_suppression\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
421
|
+
end
|
422
|
+
return data, status_code, headers
|
423
|
+
end
|
424
|
+
|
293
425
|
# Modify the triage assignee of a security signal.
|
294
426
|
#
|
295
427
|
# @see #edit_security_monitoring_signal_assignee_with_http_info
|
@@ -780,6 +912,71 @@ module DatadogAPIClient::V2
|
|
780
912
|
return data, status_code, headers
|
781
913
|
end
|
782
914
|
|
915
|
+
# Get a suppression rule.
|
916
|
+
#
|
917
|
+
# @see #get_security_monitoring_suppression_with_http_info
|
918
|
+
def get_security_monitoring_suppression(suppression_id, opts = {})
|
919
|
+
data, _status_code, _headers = get_security_monitoring_suppression_with_http_info(suppression_id, opts)
|
920
|
+
data
|
921
|
+
end
|
922
|
+
|
923
|
+
# Get a suppression rule.
|
924
|
+
#
|
925
|
+
# Get the details of a specific suppression rule.
|
926
|
+
#
|
927
|
+
# @param suppression_id [String] The ID of the suppression rule
|
928
|
+
# @param opts [Hash] the optional parameters
|
929
|
+
# @return [Array<(SecurityMonitoringSuppressionResponse, Integer, Hash)>] SecurityMonitoringSuppressionResponse data, response status code and response headers
|
930
|
+
def get_security_monitoring_suppression_with_http_info(suppression_id, opts = {})
|
931
|
+
|
932
|
+
if @api_client.config.debugging
|
933
|
+
@api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.get_security_monitoring_suppression ...'
|
934
|
+
end
|
935
|
+
# verify the required parameter 'suppression_id' is set
|
936
|
+
if @api_client.config.client_side_validation && suppression_id.nil?
|
937
|
+
fail ArgumentError, "Missing the required parameter 'suppression_id' when calling SecurityMonitoringAPI.get_security_monitoring_suppression"
|
938
|
+
end
|
939
|
+
# resource path
|
940
|
+
local_var_path = '/api/v2/security_monitoring/configuration/suppressions/{suppression_id}'.sub('{suppression_id}', CGI.escape(suppression_id.to_s).gsub('%2F', '/'))
|
941
|
+
|
942
|
+
# query parameters
|
943
|
+
query_params = opts[:query_params] || {}
|
944
|
+
|
945
|
+
# header parameters
|
946
|
+
header_params = opts[:header_params] || {}
|
947
|
+
# HTTP header 'Accept' (if needed)
|
948
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
949
|
+
|
950
|
+
# form parameters
|
951
|
+
form_params = opts[:form_params] || {}
|
952
|
+
|
953
|
+
# http body (model)
|
954
|
+
post_body = opts[:debug_body]
|
955
|
+
|
956
|
+
# return_type
|
957
|
+
return_type = opts[:debug_return_type] || 'SecurityMonitoringSuppressionResponse'
|
958
|
+
|
959
|
+
# auth_names
|
960
|
+
auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]
|
961
|
+
|
962
|
+
new_options = opts.merge(
|
963
|
+
:operation => :get_security_monitoring_suppression,
|
964
|
+
:header_params => header_params,
|
965
|
+
:query_params => query_params,
|
966
|
+
:form_params => form_params,
|
967
|
+
:body => post_body,
|
968
|
+
:auth_names => auth_names,
|
969
|
+
:return_type => return_type,
|
970
|
+
:api_version => "V2"
|
971
|
+
)
|
972
|
+
|
973
|
+
data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
|
974
|
+
if @api_client.config.debugging
|
975
|
+
@api_client.config.logger.debug "API called: SecurityMonitoringAPI#get_security_monitoring_suppression\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
976
|
+
end
|
977
|
+
return data, status_code, headers
|
978
|
+
end
|
979
|
+
|
783
980
|
# List findings.
|
784
981
|
#
|
785
982
|
# @see #list_findings_with_http_info
|
@@ -1164,6 +1361,66 @@ module DatadogAPIClient::V2
|
|
1164
1361
|
end
|
1165
1362
|
end
|
1166
1363
|
|
1364
|
+
# Get all suppression rules.
|
1365
|
+
#
|
1366
|
+
# @see #list_security_monitoring_suppressions_with_http_info
|
1367
|
+
def list_security_monitoring_suppressions(opts = {})
|
1368
|
+
data, _status_code, _headers = list_security_monitoring_suppressions_with_http_info(opts)
|
1369
|
+
data
|
1370
|
+
end
|
1371
|
+
|
1372
|
+
# Get all suppression rules.
|
1373
|
+
#
|
1374
|
+
# Get the list of all suppression rules.
|
1375
|
+
#
|
1376
|
+
# @param opts [Hash] the optional parameters
|
1377
|
+
# @return [Array<(SecurityMonitoringSuppressionsResponse, Integer, Hash)>] SecurityMonitoringSuppressionsResponse data, response status code and response headers
|
1378
|
+
def list_security_monitoring_suppressions_with_http_info(opts = {})
|
1379
|
+
|
1380
|
+
if @api_client.config.debugging
|
1381
|
+
@api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.list_security_monitoring_suppressions ...'
|
1382
|
+
end
|
1383
|
+
# resource path
|
1384
|
+
local_var_path = '/api/v2/security_monitoring/configuration/suppressions'
|
1385
|
+
|
1386
|
+
# query parameters
|
1387
|
+
query_params = opts[:query_params] || {}
|
1388
|
+
|
1389
|
+
# header parameters
|
1390
|
+
header_params = opts[:header_params] || {}
|
1391
|
+
# HTTP header 'Accept' (if needed)
|
1392
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
1393
|
+
|
1394
|
+
# form parameters
|
1395
|
+
form_params = opts[:form_params] || {}
|
1396
|
+
|
1397
|
+
# http body (model)
|
1398
|
+
post_body = opts[:debug_body]
|
1399
|
+
|
1400
|
+
# return_type
|
1401
|
+
return_type = opts[:debug_return_type] || 'SecurityMonitoringSuppressionsResponse'
|
1402
|
+
|
1403
|
+
# auth_names
|
1404
|
+
auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]
|
1405
|
+
|
1406
|
+
new_options = opts.merge(
|
1407
|
+
:operation => :list_security_monitoring_suppressions,
|
1408
|
+
:header_params => header_params,
|
1409
|
+
:query_params => query_params,
|
1410
|
+
:form_params => form_params,
|
1411
|
+
:body => post_body,
|
1412
|
+
:auth_names => auth_names,
|
1413
|
+
:return_type => return_type,
|
1414
|
+
:api_version => "V2"
|
1415
|
+
)
|
1416
|
+
|
1417
|
+
data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
|
1418
|
+
if @api_client.config.debugging
|
1419
|
+
@api_client.config.logger.debug "API called: SecurityMonitoringAPI#list_security_monitoring_suppressions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
1420
|
+
end
|
1421
|
+
return data, status_code, headers
|
1422
|
+
end
|
1423
|
+
|
1167
1424
|
# Mute or unmute a batch of findings.
|
1168
1425
|
#
|
1169
1426
|
# @see #mute_findings_with_http_info
|
@@ -1469,5 +1726,77 @@ module DatadogAPIClient::V2
|
|
1469
1726
|
end
|
1470
1727
|
return data, status_code, headers
|
1471
1728
|
end
|
1729
|
+
|
1730
|
+
# Update a suppression rule.
|
1731
|
+
#
|
1732
|
+
# @see #update_security_monitoring_suppression_with_http_info
|
1733
|
+
def update_security_monitoring_suppression(suppression_id, body, opts = {})
|
1734
|
+
data, _status_code, _headers = update_security_monitoring_suppression_with_http_info(suppression_id, body, opts)
|
1735
|
+
data
|
1736
|
+
end
|
1737
|
+
|
1738
|
+
# Update a suppression rule.
|
1739
|
+
#
|
1740
|
+
# Update a specific suppression rule.
|
1741
|
+
#
|
1742
|
+
# @param suppression_id [String] The ID of the suppression rule
|
1743
|
+
# @param body [SecurityMonitoringSuppressionUpdateRequest] New definition of the suppression rule. Supports partial updates.
|
1744
|
+
# @param opts [Hash] the optional parameters
|
1745
|
+
# @return [Array<(SecurityMonitoringSuppressionResponse, Integer, Hash)>] SecurityMonitoringSuppressionResponse data, response status code and response headers
|
1746
|
+
def update_security_monitoring_suppression_with_http_info(suppression_id, body, opts = {})
|
1747
|
+
|
1748
|
+
if @api_client.config.debugging
|
1749
|
+
@api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.update_security_monitoring_suppression ...'
|
1750
|
+
end
|
1751
|
+
# verify the required parameter 'suppression_id' is set
|
1752
|
+
if @api_client.config.client_side_validation && suppression_id.nil?
|
1753
|
+
fail ArgumentError, "Missing the required parameter 'suppression_id' when calling SecurityMonitoringAPI.update_security_monitoring_suppression"
|
1754
|
+
end
|
1755
|
+
# verify the required parameter 'body' is set
|
1756
|
+
if @api_client.config.client_side_validation && body.nil?
|
1757
|
+
fail ArgumentError, "Missing the required parameter 'body' when calling SecurityMonitoringAPI.update_security_monitoring_suppression"
|
1758
|
+
end
|
1759
|
+
# resource path
|
1760
|
+
local_var_path = '/api/v2/security_monitoring/configuration/suppressions/{suppression_id}'.sub('{suppression_id}', CGI.escape(suppression_id.to_s).gsub('%2F', '/'))
|
1761
|
+
|
1762
|
+
# query parameters
|
1763
|
+
query_params = opts[:query_params] || {}
|
1764
|
+
|
1765
|
+
# header parameters
|
1766
|
+
header_params = opts[:header_params] || {}
|
1767
|
+
# HTTP header 'Accept' (if needed)
|
1768
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
1769
|
+
# HTTP header 'Content-Type'
|
1770
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
1771
|
+
|
1772
|
+
# form parameters
|
1773
|
+
form_params = opts[:form_params] || {}
|
1774
|
+
|
1775
|
+
# http body (model)
|
1776
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
|
1777
|
+
|
1778
|
+
# return_type
|
1779
|
+
return_type = opts[:debug_return_type] || 'SecurityMonitoringSuppressionResponse'
|
1780
|
+
|
1781
|
+
# auth_names
|
1782
|
+
auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]
|
1783
|
+
|
1784
|
+
new_options = opts.merge(
|
1785
|
+
:operation => :update_security_monitoring_suppression,
|
1786
|
+
:header_params => header_params,
|
1787
|
+
:query_params => query_params,
|
1788
|
+
:form_params => form_params,
|
1789
|
+
:body => post_body,
|
1790
|
+
:auth_names => auth_names,
|
1791
|
+
:return_type => return_type,
|
1792
|
+
:api_version => "V2"
|
1793
|
+
)
|
1794
|
+
|
1795
|
+
data, status_code, headers = @api_client.call_api(Net::HTTP::Patch, local_var_path, new_options)
|
1796
|
+
if @api_client.config.debugging
|
1797
|
+
@api_client.config.logger.debug "API called: SecurityMonitoringAPI#update_security_monitoring_suppression\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
1798
|
+
end
|
1799
|
+
return data, status_code, headers
|
1800
|
+
end
|
1472
1801
|
end
|
1473
1802
|
end
|
@@ -717,6 +717,28 @@ module DatadogAPIClient::V2
|
|
717
717
|
return data, status_code, headers
|
718
718
|
end
|
719
719
|
|
720
|
+
# Get team memberships.
|
721
|
+
#
|
722
|
+
# Provide a paginated version of {#get_team_memberships}, returning all items.
|
723
|
+
#
|
724
|
+
# To use it you need to use a block: get_team_memberships_with_pagination { |item| p item }
|
725
|
+
#
|
726
|
+
# @yield [UserTeam] Paginated items
|
727
|
+
def get_team_memberships_with_pagination(team_id, opts = {})
|
728
|
+
api_version = "V2"
|
729
|
+
page_size = @api_client.get_attribute_from_path(opts, "page_size", 10)
|
730
|
+
@api_client.set_attribute_from_path(api_version, opts, "page_size", Integer, page_size)
|
731
|
+
@api_client.set_attribute_from_path(api_version, opts, "page_number", Integer, 0)
|
732
|
+
while true do
|
733
|
+
response = get_team_memberships(team_id, opts)
|
734
|
+
@api_client.get_attribute_from_path(response, "data").each { |item| yield(item) }
|
735
|
+
if @api_client.get_attribute_from_path(response, "data").length < page_size
|
736
|
+
break
|
737
|
+
end
|
738
|
+
@api_client.set_attribute_from_path(api_version, opts, "page_number", Integer, @api_client.get_attribute_from_path(opts, "page_number", 0) + 1)
|
739
|
+
end
|
740
|
+
end
|
741
|
+
|
720
742
|
# Get permission settings for a team.
|
721
743
|
#
|
722
744
|
# @see #get_team_permission_settings_with_http_info
|
@@ -642,7 +642,7 @@ module DatadogAPIClient::V2
|
|
642
642
|
return data, status_code, headers
|
643
643
|
end
|
644
644
|
|
645
|
-
# Get hourly usage for
|
645
|
+
# Get hourly usage for Lambda traced invocations.
|
646
646
|
#
|
647
647
|
# @see #get_usage_lambda_traced_invocations_with_http_info
|
648
648
|
def get_usage_lambda_traced_invocations(start_hr, opts = {})
|
@@ -650,9 +650,9 @@ module DatadogAPIClient::V2
|
|
650
650
|
data
|
651
651
|
end
|
652
652
|
|
653
|
-
# Get hourly usage for
|
653
|
+
# Get hourly usage for Lambda traced invocations.
|
654
654
|
#
|
655
|
-
# Get hourly usage for
|
655
|
+
# Get hourly usage for Lambda traced invocations.
|
656
656
|
# **Note:** hourly usage data for all products is now available in the [Get hourly usage by product family API](https://docs.datadoghq.com/api/latest/usage-metering/#get-hourly-usage-by-product-family)
|
657
657
|
#
|
658
658
|
# @param start_hr [Time] Datetime in ISO-8601 format, UTC, precise to hour: `[YYYY-MM-DDThh]` for usage beginning at this hour.
|
@@ -0,0 +1,129 @@
|
|
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
|
+
# AWS CUR config.
|
21
|
+
class AwsCURConfig
|
22
|
+
include BaseGenericModel
|
23
|
+
|
24
|
+
# Attributes for An AWS CUR config.
|
25
|
+
attr_reader :attributes
|
26
|
+
|
27
|
+
# The ID of the AWS CUR config.
|
28
|
+
attr_accessor :id
|
29
|
+
|
30
|
+
# Type of AWS CUR config.
|
31
|
+
attr_reader :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' => :'AwsCURConfigAttributes',
|
48
|
+
:'id' => :'Integer',
|
49
|
+
:'type' => :'AwsCURConfigType'
|
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::AwsCURConfig` 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::AwsCURConfig`. 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
|
+
# Check to see if the all the properties in the model are valid
|
83
|
+
# @return true if the model is valid
|
84
|
+
# @!visibility private
|
85
|
+
def valid?
|
86
|
+
return false if @attributes.nil?
|
87
|
+
return false if @type.nil?
|
88
|
+
true
|
89
|
+
end
|
90
|
+
|
91
|
+
# Custom attribute writer method with validation
|
92
|
+
# @param attributes [Object] Object to be assigned
|
93
|
+
# @!visibility private
|
94
|
+
def attributes=(attributes)
|
95
|
+
if attributes.nil?
|
96
|
+
fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.'
|
97
|
+
end
|
98
|
+
@attributes = attributes
|
99
|
+
end
|
100
|
+
|
101
|
+
# Custom attribute writer method with validation
|
102
|
+
# @param type [Object] Object to be assigned
|
103
|
+
# @!visibility private
|
104
|
+
def type=(type)
|
105
|
+
if type.nil?
|
106
|
+
fail ArgumentError, 'invalid value for "type", type cannot be nil.'
|
107
|
+
end
|
108
|
+
@type = type
|
109
|
+
end
|
110
|
+
|
111
|
+
# Checks equality by comparing each attribute.
|
112
|
+
# @param o [Object] Object to be compared
|
113
|
+
# @!visibility private
|
114
|
+
def ==(o)
|
115
|
+
return true if self.equal?(o)
|
116
|
+
self.class == o.class &&
|
117
|
+
attributes == o.attributes &&
|
118
|
+
id == o.id &&
|
119
|
+
type == o.type
|
120
|
+
end
|
121
|
+
|
122
|
+
# Calculates hash code according to all attributes.
|
123
|
+
# @return [Integer] Hash code
|
124
|
+
# @!visibility private
|
125
|
+
def hash
|
126
|
+
[attributes, id, type].hash
|
127
|
+
end
|
128
|
+
end
|
129
|
+
end
|