datadog_api_client 1.0.0.beta.3 → 1.0.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/.azure-pipelines/all.yml +0 -1
- data/.rubocop.yml +1 -1
- data/CHANGELOG.md +23 -0
- data/Gemfile +1 -1
- data/LICENSE-3rdparty.csv +0 -1
- data/check-examples.sh +7 -2
- data/data/v1/openapi.yaml +1963 -245
- data/data/v2/openapi.yaml +67 -13
- data/docs/v1/DashboardsAPI.md +10 -5
- data/docs/v1/DistributionWidgetDefinition.md +9 -3
- data/docs/v1/DistributionWidgetXAxis.md +24 -0
- data/docs/v1/DistributionWidgetYAxis.md +26 -0
- data/docs/v1/EventsAPI.md +7 -3
- data/docs/v1/GroupWidgetDefinition.md +8 -0
- data/docs/v1/ImageWidgetDefinition.md +11 -1
- data/docs/v1/LogsByRetention.md +22 -0
- data/docs/v1/LogsByRetentionMonthlyUsage.md +20 -0
- data/docs/v1/LogsByRetentionOrgUsage.md +18 -0
- data/docs/v1/LogsByRetentionOrgs.md +18 -0
- data/docs/v1/LogsRetentionAggSumUsage.md +24 -0
- data/docs/v1/LogsRetentionSumUsage.md +24 -0
- data/docs/v1/MonitorsAPI.md +1 -1
- data/docs/v1/NoteWidgetDefinition.md +5 -1
- data/docs/v1/NotebookAbsoluteTime.md +22 -0
- data/docs/v1/NotebookAuthor.md +34 -0
- data/docs/v1/NotebookCellCreateRequest.md +20 -0
- data/docs/v1/NotebookCellCreateRequestAttributes.md +57 -0
- data/docs/v1/NotebookCellResourceType.md +15 -0
- data/docs/v1/NotebookCellResponse.md +22 -0
- data/docs/v1/NotebookCellResponseAttributes.md +57 -0
- data/docs/v1/NotebookCellTime.md +49 -0
- data/docs/v1/NotebookCellUpdateRequest.md +22 -0
- data/docs/v1/NotebookCellUpdateRequestAttributes.md +57 -0
- data/docs/v1/NotebookCreateData.md +20 -0
- data/docs/v1/NotebookCreateDataAttributes.md +24 -0
- data/docs/v1/NotebookCreateRequest.md +18 -0
- data/docs/v1/NotebookDistributionCellAttributes.md +24 -0
- data/docs/v1/NotebookGlobalTime.md +49 -0
- data/docs/v1/NotebookGraphSize.md +15 -0
- data/docs/v1/NotebookHeatMapCellAttributes.md +24 -0
- data/docs/v1/NotebookLogStreamCellAttributes.md +22 -0
- data/docs/v1/NotebookMarkdownCellAttributes.md +18 -0
- data/docs/v1/NotebookMarkdownCellDefinition.md +21 -0
- data/docs/v1/NotebookMarkdownCellDefinitionType.md +15 -0
- data/docs/v1/NotebookRelativeTime.md +18 -0
- data/docs/v1/NotebookResourceType.md +15 -0
- data/docs/v1/NotebookResponse.md +18 -0
- data/docs/v1/NotebookResponseData.md +22 -0
- data/docs/v1/NotebookResponseDataAttributes.md +30 -0
- data/docs/v1/NotebookSplitBy.md +20 -0
- data/docs/v1/NotebookStatus.md +15 -0
- data/docs/v1/NotebookTimeseriesCellAttributes.md +24 -0
- data/docs/v1/NotebookToplistCellAttributes.md +24 -0
- data/docs/v1/NotebookUpdateCell.md +49 -0
- data/docs/v1/NotebookUpdateData.md +20 -0
- data/docs/v1/NotebookUpdateDataAttributes.md +24 -0
- data/docs/v1/NotebookUpdateRequest.md +18 -0
- data/docs/v1/NotebooksAPI.md +339 -0
- data/docs/v1/NotebooksResponse.md +20 -0
- data/docs/v1/NotebooksResponseMeta.md +18 -0
- data/docs/v1/NotebooksResponsePage.md +20 -0
- data/docs/v1/README.md +66 -9
- data/docs/v1/SLOListResponse.md +3 -1
- data/docs/v1/SLOListResponseMetadata.md +18 -0
- data/docs/v1/SLOListResponseMetadataPage.md +20 -0
- data/docs/v1/SLOResponse.md +1 -1
- data/docs/v1/SLOResponseData.md +44 -0
- data/docs/v1/ServiceLevelObjectivesAPI.md +8 -4
- data/docs/v1/SyntheticsAPI.md +28 -156
- data/docs/v1/SyntheticsAPIStep.md +4 -0
- data/docs/v1/SyntheticsBrowserTestConfig.md +2 -0
- data/docs/v1/SyntheticsTestConfig.md +1 -1
- data/docs/v1/SyntheticsTestOptions.md +1 -1
- data/docs/v1/SyntheticsTestRequest.md +6 -0
- data/docs/v1/UsageAttributionSupportedMetrics.md +15 -0
- data/docs/v1/UsageAttributionValues.md +8 -0
- data/docs/v1/UsageHostHour.md +3 -1
- data/docs/v1/UsageIoTHour.md +1 -1
- data/docs/v1/UsageLogsByRetentionHour.md +24 -0
- data/docs/v1/UsageLogsByRetentionResponse.md +18 -0
- data/docs/v1/UsageMeteringAPI.md +69 -2
- data/docs/v1/UsageSummaryDate.md +11 -9
- data/docs/v1/UsageSummaryDateOrg.md +3 -1
- data/docs/v1/UsageSummaryResponse.md +5 -1
- data/docs/v1/WidgetHorizontalAlign.md +15 -0
- data/docs/v1/WidgetLayout.md +2 -0
- data/docs/v1/WidgetMarker.md +1 -1
- data/docs/v1/WidgetVerticalAlign.md +15 -0
- data/docs/v2/IncidentServiceUpdateData.md +1 -1
- data/docs/v2/IncidentServicesAPI.md +1 -1
- data/docs/v2/IncidentTeamUpdateData.md +1 -1
- data/docs/v2/IncidentTeamsAPI.md +1 -1
- data/docs/v2/MetricsAPI.md +1 -11
- data/extract-code-blocks.sh +6 -2
- data/lib/datadog_api_client/v1.rb +54 -0
- data/lib/datadog_api_client/v1/api/dashboards_api.rb +3 -0
- data/lib/datadog_api_client/v1/api/events_api.rb +14 -4
- data/lib/datadog_api_client/v1/api/monitors_api.rb +2 -2
- data/lib/datadog_api_client/v1/api/notebooks_api.rb +418 -0
- data/lib/datadog_api_client/v1/api/service_level_objectives_api.rb +3 -0
- data/lib/datadog_api_client/v1/api/synthetics_api.rb +14 -170
- data/lib/datadog_api_client/v1/api/usage_metering_api.rb +79 -2
- data/lib/datadog_api_client/v1/models/distribution_widget_definition.rb +36 -6
- data/lib/datadog_api_client/v1/models/distribution_widget_x_axis.rb +259 -0
- data/lib/datadog_api_client/v1/models/distribution_widget_y_axis.rb +269 -0
- data/lib/datadog_api_client/v1/models/group_widget_definition.rb +42 -1
- data/lib/datadog_api_client/v1/models/image_widget_definition.rb +56 -4
- data/lib/datadog_api_client/v1/models/logs_by_retention.rb +243 -0
- data/lib/datadog_api_client/v1/models/logs_by_retention_monthly_usage.rb +235 -0
- data/lib/datadog_api_client/v1/models/logs_by_retention_org_usage.rb +225 -0
- data/lib/datadog_api_client/v1/models/logs_by_retention_orgs.rb +225 -0
- data/lib/datadog_api_client/v1/models/logs_retention_agg_sum_usage.rb +253 -0
- data/lib/datadog_api_client/v1/models/logs_retention_sum_usage.rb +253 -0
- data/lib/datadog_api_client/v1/models/note_widget_definition.rb +25 -4
- data/lib/datadog_api_client/v1/models/notebook_absolute_time.rb +253 -0
- data/lib/datadog_api_client/v1/models/notebook_author.rb +303 -0
- data/lib/datadog_api_client/v1/models/notebook_cell_create_request.rb +243 -0
- data/lib/datadog_api_client/v1/models/notebook_cell_create_request_attributes.rb +113 -0
- data/lib/datadog_api_client/v1/models/notebook_cell_resource_type.rb +39 -0
- data/lib/datadog_api_client/v1/models/notebook_cell_response.rb +258 -0
- data/lib/datadog_api_client/v1/models/notebook_cell_response_attributes.rb +113 -0
- data/lib/datadog_api_client/v1/models/notebook_cell_time.rb +109 -0
- data/lib/datadog_api_client/v1/models/notebook_cell_update_request.rb +258 -0
- data/lib/datadog_api_client/v1/models/notebook_cell_update_request_attributes.rb +113 -0
- data/lib/datadog_api_client/v1/models/notebook_create_data.rb +243 -0
- data/lib/datadog_api_client/v1/models/notebook_create_data_attributes.rb +298 -0
- data/lib/datadog_api_client/v1/models/notebook_create_request.rb +227 -0
- data/lib/datadog_api_client/v1/models/notebook_distribution_cell_attributes.rb +255 -0
- data/lib/datadog_api_client/v1/models/notebook_global_time.rb +109 -0
- data/lib/datadog_api_client/v1/models/notebook_graph_size.rb +43 -0
- data/lib/datadog_api_client/v1/models/notebook_heat_map_cell_attributes.rb +255 -0
- data/lib/datadog_api_client/v1/models/notebook_log_stream_cell_attributes.rb +246 -0
- data/lib/datadog_api_client/v1/models/notebook_markdown_cell_attributes.rb +227 -0
- data/lib/datadog_api_client/v1/models/notebook_markdown_cell_definition.rb +244 -0
- data/lib/datadog_api_client/v1/models/notebook_markdown_cell_definition_type.rb +39 -0
- data/lib/datadog_api_client/v1/models/notebook_relative_time.rb +227 -0
- data/lib/datadog_api_client/v1/models/notebook_resource_type.rb +39 -0
- data/lib/datadog_api_client/v1/models/notebook_response.rb +222 -0
- data/lib/datadog_api_client/v1/models/notebook_response_data.rb +258 -0
- data/lib/datadog_api_client/v1/models/notebook_response_data_attributes.rb +327 -0
- data/lib/datadog_api_client/v1/models/notebook_split_by.rb +247 -0
- data/lib/datadog_api_client/v1/models/notebook_status.rb +39 -0
- data/lib/datadog_api_client/v1/models/notebook_timeseries_cell_attributes.rb +255 -0
- data/lib/datadog_api_client/v1/models/notebook_toplist_cell_attributes.rb +255 -0
- data/lib/datadog_api_client/v1/models/notebook_update_cell.rb +109 -0
- data/lib/datadog_api_client/v1/models/notebook_update_data.rb +243 -0
- data/lib/datadog_api_client/v1/models/notebook_update_data_attributes.rb +298 -0
- data/lib/datadog_api_client/v1/models/notebook_update_request.rb +227 -0
- data/lib/datadog_api_client/v1/models/notebooks_response.rb +234 -0
- data/lib/datadog_api_client/v1/models/notebooks_response_meta.rb +222 -0
- data/lib/datadog_api_client/v1/models/notebooks_response_page.rb +233 -0
- data/lib/datadog_api_client/v1/models/slo_list_response.rb +13 -4
- data/lib/datadog_api_client/v1/models/slo_list_response_metadata.rb +222 -0
- data/lib/datadog_api_client/v1/models/slo_list_response_metadata_page.rb +233 -0
- data/lib/datadog_api_client/v1/models/slo_response.rb +1 -1
- data/lib/datadog_api_client/v1/models/slo_response_data.rb +363 -0
- data/lib/datadog_api_client/v1/models/synthetics_api_step.rb +21 -1
- data/lib/datadog_api_client/v1/models/synthetics_assertion_type.rb +4 -0
- data/lib/datadog_api_client/v1/models/synthetics_browser_test_config.rb +11 -1
- data/lib/datadog_api_client/v1/models/synthetics_test_config.rb +0 -5
- data/lib/datadog_api_client/v1/models/synthetics_test_details_sub_type.rb +1 -0
- data/lib/datadog_api_client/v1/models/synthetics_test_options.rb +1 -1
- data/lib/datadog_api_client/v1/models/synthetics_test_request.rb +79 -1
- data/lib/datadog_api_client/v1/models/synthetics_tick_interval.rb +1 -0
- data/lib/datadog_api_client/v1/models/usage_attribution_supported_metrics.rb +67 -0
- data/lib/datadog_api_client/v1/models/usage_attribution_values.rb +41 -1
- data/lib/datadog_api_client/v1/models/usage_host_hour.rb +14 -4
- data/lib/datadog_api_client/v1/models/usage_io_t_hour.rb +1 -1
- data/lib/datadog_api_client/v1/models/usage_logs_by_retention_hour.rb +253 -0
- data/lib/datadog_api_client/v1/models/usage_logs_by_retention_response.rb +225 -0
- data/lib/datadog_api_client/v1/models/usage_summary_date.rb +38 -28
- data/lib/datadog_api_client/v1/models/usage_summary_date_org.rb +14 -4
- data/lib/datadog_api_client/v1/models/usage_summary_response.rb +23 -4
- data/lib/datadog_api_client/v1/models/widget.rb +1 -1
- data/lib/datadog_api_client/v1/models/widget_horizontal_align.rb +41 -0
- data/lib/datadog_api_client/v1/models/widget_image_sizing.rb +5 -0
- data/lib/datadog_api_client/v1/models/widget_layout.rb +12 -2
- data/lib/datadog_api_client/v1/models/widget_margin.rb +3 -0
- data/lib/datadog_api_client/v1/models/widget_marker.rb +1 -1
- data/lib/datadog_api_client/v1/models/widget_vertical_align.rb +41 -0
- data/lib/datadog_api_client/v2/api/metrics_api.rb +2 -2
- data/lib/datadog_api_client/v2/configuration.rb +0 -2
- data/lib/datadog_api_client/v2/models/incident_service_update_data.rb +0 -5
- data/lib/datadog_api_client/v2/models/incident_team_update_data.rb +0 -5
- data/lib/datadog_api_client/v2/models/metric_tag_configuration_metric_types.rb +1 -0
- data/lib/datadog_api_client/v2/models/security_monitoring_rule_detection_method.rb +1 -0
- data/lib/datadog_api_client/version.rb +1 -1
- data/run-tests.sh +0 -6
- data/spec/v1/api/notebooks_api_spec.rb +106 -0
- data/spec/v1/models/distribution_widget_x_axis_spec.rb +55 -0
- data/spec/v1/models/distribution_widget_y_axis_spec.rb +61 -0
- data/spec/v1/models/logs_by_retention_monthly_usage_spec.rb +43 -0
- data/spec/v1/models/logs_by_retention_org_usage_spec.rb +37 -0
- data/spec/v1/models/logs_by_retention_orgs_spec.rb +37 -0
- data/spec/v1/models/logs_by_retention_spec.rb +49 -0
- data/spec/v1/models/logs_retention_agg_sum_usage_spec.rb +55 -0
- data/spec/v1/models/logs_retention_sum_usage_spec.rb +55 -0
- data/spec/v1/models/notebook_absolute_time_spec.rb +49 -0
- data/spec/v1/models/notebook_author_spec.rb +85 -0
- data/spec/v1/models/notebook_cell_create_request_attributes_spec.rb +34 -0
- data/spec/v1/models/notebook_cell_create_request_spec.rb +43 -0
- data/spec/v1/models/notebook_cell_resource_type_spec.rb +31 -0
- data/spec/v1/models/notebook_cell_response_attributes_spec.rb +34 -0
- data/spec/v1/models/notebook_cell_response_spec.rb +49 -0
- data/spec/v1/models/notebook_cell_time_spec.rb +34 -0
- data/spec/v1/models/notebook_cell_update_request_attributes_spec.rb +34 -0
- data/spec/v1/models/notebook_cell_update_request_spec.rb +49 -0
- data/spec/v1/models/notebook_create_data_attributes_spec.rb +55 -0
- data/spec/v1/models/notebook_create_data_spec.rb +43 -0
- data/spec/v1/models/notebook_create_request_spec.rb +37 -0
- data/spec/v1/models/notebook_distribution_cell_attributes_spec.rb +55 -0
- data/spec/v1/models/notebook_global_time_spec.rb +34 -0
- data/spec/v1/models/notebook_graph_size_spec.rb +31 -0
- data/spec/v1/models/notebook_heat_map_cell_attributes_spec.rb +55 -0
- data/spec/v1/models/notebook_log_stream_cell_attributes_spec.rb +49 -0
- data/spec/v1/models/notebook_markdown_cell_attributes_spec.rb +37 -0
- data/spec/v1/models/notebook_markdown_cell_definition_spec.rb +43 -0
- data/spec/v1/models/notebook_markdown_cell_definition_type_spec.rb +31 -0
- data/spec/v1/models/notebook_relative_time_spec.rb +37 -0
- data/spec/v1/models/notebook_resource_type_spec.rb +31 -0
- data/spec/v1/models/notebook_response_data_attributes_spec.rb +73 -0
- data/spec/v1/models/notebook_response_data_spec.rb +49 -0
- data/spec/v1/models/notebook_response_spec.rb +37 -0
- data/spec/v1/models/notebook_split_by_spec.rb +43 -0
- data/spec/v1/models/notebook_status_spec.rb +31 -0
- data/spec/v1/models/notebook_timeseries_cell_attributes_spec.rb +55 -0
- data/spec/v1/models/notebook_toplist_cell_attributes_spec.rb +55 -0
- data/spec/v1/models/notebook_update_cell_spec.rb +34 -0
- data/spec/v1/models/notebook_update_data_attributes_spec.rb +55 -0
- data/spec/v1/models/notebook_update_data_spec.rb +43 -0
- data/spec/v1/models/notebook_update_request_spec.rb +37 -0
- data/spec/v1/models/notebooks_response_meta_spec.rb +37 -0
- data/spec/v1/models/notebooks_response_page_spec.rb +43 -0
- data/spec/v1/models/notebooks_response_spec.rb +43 -0
- data/spec/v1/models/slo_list_response_metadata_page_spec.rb +43 -0
- data/spec/v1/models/slo_list_response_metadata_spec.rb +37 -0
- data/spec/v1/models/slo_response_data_spec.rb +115 -0
- data/spec/v1/models/usage_attribution_supported_metrics_spec.rb +31 -0
- data/spec/v1/models/usage_logs_by_retention_hour_spec.rb +55 -0
- data/spec/v1/models/usage_logs_by_retention_response_spec.rb +37 -0
- data/spec/v1/models/widget_horizontal_align_spec.rb +31 -0
- data/spec/v1/models/widget_vertical_align_spec.rb +31 -0
- metadata +220 -4
@@ -0,0 +1,234 @@
|
|
1
|
+
=begin
|
2
|
+
#Datadog API V1 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://openapi-generator.tech
|
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::V1
|
20
|
+
# Notebooks get all response.
|
21
|
+
class NotebooksResponse
|
22
|
+
# List of notebook definitions.
|
23
|
+
attr_accessor :data
|
24
|
+
|
25
|
+
attr_accessor :meta
|
26
|
+
|
27
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
28
|
+
def self.attribute_map
|
29
|
+
{
|
30
|
+
:'data' => :'data',
|
31
|
+
:'meta' => :'meta'
|
32
|
+
}
|
33
|
+
end
|
34
|
+
|
35
|
+
# Returns all the JSON keys this model knows about
|
36
|
+
def self.acceptable_attributes
|
37
|
+
attribute_map.values
|
38
|
+
end
|
39
|
+
|
40
|
+
# Attribute type mapping.
|
41
|
+
def self.openapi_types
|
42
|
+
{
|
43
|
+
:'data' => :'Array<NotebookResponseData>',
|
44
|
+
:'meta' => :'NotebooksResponseMeta'
|
45
|
+
}
|
46
|
+
end
|
47
|
+
|
48
|
+
# List of attributes with nullable: true
|
49
|
+
def self.openapi_nullable
|
50
|
+
Set.new([
|
51
|
+
])
|
52
|
+
end
|
53
|
+
|
54
|
+
# Initializes the object
|
55
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
56
|
+
def initialize(attributes = {})
|
57
|
+
if (!attributes.is_a?(Hash))
|
58
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V1::NotebooksResponse` 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::V1::NotebooksResponse`. 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?(:'data')
|
70
|
+
if (value = attributes[:'data']).is_a?(Array)
|
71
|
+
self.data = value
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
if attributes.key?(:'meta')
|
76
|
+
self.meta = attributes[:'meta']
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
80
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
81
|
+
# @return Array for valid properties with the reasons
|
82
|
+
def list_invalid_properties
|
83
|
+
invalid_properties = Array.new
|
84
|
+
invalid_properties
|
85
|
+
end
|
86
|
+
|
87
|
+
# Check to see if the all the properties in the model are valid
|
88
|
+
# @return true if the model is valid
|
89
|
+
def valid?
|
90
|
+
true
|
91
|
+
end
|
92
|
+
|
93
|
+
# Checks equality by comparing each attribute.
|
94
|
+
# @param [Object] Object to be compared
|
95
|
+
def ==(o)
|
96
|
+
return true if self.equal?(o)
|
97
|
+
self.class == o.class &&
|
98
|
+
data == o.data &&
|
99
|
+
meta == o.meta
|
100
|
+
end
|
101
|
+
|
102
|
+
# @see the `==` method
|
103
|
+
# @param [Object] Object to be compared
|
104
|
+
def eql?(o)
|
105
|
+
self == o
|
106
|
+
end
|
107
|
+
|
108
|
+
# Calculates hash code according to all attributes.
|
109
|
+
# @return [Integer] Hash code
|
110
|
+
def hash
|
111
|
+
[data, meta].hash
|
112
|
+
end
|
113
|
+
|
114
|
+
# Builds the object from hash
|
115
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
116
|
+
# @return [Object] Returns the model itself
|
117
|
+
def self.build_from_hash(attributes)
|
118
|
+
new.build_from_hash(attributes)
|
119
|
+
end
|
120
|
+
|
121
|
+
# Builds the object from hash
|
122
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
123
|
+
# @return [Object] Returns the model itself
|
124
|
+
def build_from_hash(attributes)
|
125
|
+
return nil unless attributes.is_a?(Hash)
|
126
|
+
self.class.openapi_types.each_pair do |key, type|
|
127
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
128
|
+
self.send("#{key}=", nil)
|
129
|
+
elsif type =~ /\AArray<(.*)>/i
|
130
|
+
# check to ensure the input is an array given that the attribute
|
131
|
+
# is documented as an array but the input is not
|
132
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
133
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
134
|
+
end
|
135
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
136
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
137
|
+
end
|
138
|
+
end
|
139
|
+
|
140
|
+
self
|
141
|
+
end
|
142
|
+
|
143
|
+
# Deserializes the data based on type
|
144
|
+
# @param string type Data type
|
145
|
+
# @param string value Value to be deserialized
|
146
|
+
# @return [Object] Deserialized data
|
147
|
+
def _deserialize(type, value)
|
148
|
+
case type.to_sym
|
149
|
+
when :Time
|
150
|
+
Time.parse(value)
|
151
|
+
when :Date
|
152
|
+
Date.parse(value)
|
153
|
+
when :String
|
154
|
+
value.to_s
|
155
|
+
when :Integer
|
156
|
+
value.to_i
|
157
|
+
when :Float
|
158
|
+
value.to_f
|
159
|
+
when :Boolean
|
160
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
161
|
+
true
|
162
|
+
else
|
163
|
+
false
|
164
|
+
end
|
165
|
+
when :Object
|
166
|
+
# generic object (usually a Hash), return directly
|
167
|
+
value
|
168
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
169
|
+
inner_type = Regexp.last_match[:inner_type]
|
170
|
+
value.map { |v| _deserialize(inner_type, v) }
|
171
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
172
|
+
k_type = Regexp.last_match[:k_type]
|
173
|
+
v_type = Regexp.last_match[:v_type]
|
174
|
+
{}.tap do |hash|
|
175
|
+
value.each do |k, v|
|
176
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
177
|
+
end
|
178
|
+
end
|
179
|
+
else # model
|
180
|
+
# models (e.g. Pet) or oneOf
|
181
|
+
klass = DatadogAPIClient::V1.const_get(type)
|
182
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
183
|
+
end
|
184
|
+
end
|
185
|
+
|
186
|
+
# Returns the string representation of the object
|
187
|
+
# @return [String] String presentation of the object
|
188
|
+
def to_s
|
189
|
+
to_hash.to_s
|
190
|
+
end
|
191
|
+
|
192
|
+
# to_body is an alias to to_hash (backward compatibility)
|
193
|
+
# @return [Hash] Returns the object in the form of hash
|
194
|
+
def to_body
|
195
|
+
to_hash
|
196
|
+
end
|
197
|
+
|
198
|
+
# Returns the object in the form of hash
|
199
|
+
# @return [Hash] Returns the object in the form of hash
|
200
|
+
def to_hash
|
201
|
+
hash = {}
|
202
|
+
self.class.attribute_map.each_pair do |attr, param|
|
203
|
+
value = self.send(attr)
|
204
|
+
if value.nil?
|
205
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
206
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
207
|
+
end
|
208
|
+
|
209
|
+
hash[param] = _to_hash(value)
|
210
|
+
end
|
211
|
+
hash
|
212
|
+
end
|
213
|
+
|
214
|
+
# Outputs non-array value in the form of hash
|
215
|
+
# For object, use to_hash. Otherwise, just return the value
|
216
|
+
# @param [Object] value Any valid value
|
217
|
+
# @return [Hash] Returns the value in the form of hash
|
218
|
+
def _to_hash(value)
|
219
|
+
if value.is_a?(Array)
|
220
|
+
value.compact.map { |v| _to_hash(v) }
|
221
|
+
elsif value.is_a?(Hash)
|
222
|
+
{}.tap do |hash|
|
223
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
224
|
+
end
|
225
|
+
elsif value.respond_to? :to_hash
|
226
|
+
value.to_hash
|
227
|
+
else
|
228
|
+
value
|
229
|
+
end
|
230
|
+
end
|
231
|
+
|
232
|
+
end
|
233
|
+
|
234
|
+
end
|
@@ -0,0 +1,222 @@
|
|
1
|
+
=begin
|
2
|
+
#Datadog API V1 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://openapi-generator.tech
|
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::V1
|
20
|
+
# Metadata returned by the API.
|
21
|
+
class NotebooksResponseMeta
|
22
|
+
attr_accessor :page
|
23
|
+
|
24
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
25
|
+
def self.attribute_map
|
26
|
+
{
|
27
|
+
:'page' => :'page'
|
28
|
+
}
|
29
|
+
end
|
30
|
+
|
31
|
+
# Returns all the JSON keys this model knows about
|
32
|
+
def self.acceptable_attributes
|
33
|
+
attribute_map.values
|
34
|
+
end
|
35
|
+
|
36
|
+
# Attribute type mapping.
|
37
|
+
def self.openapi_types
|
38
|
+
{
|
39
|
+
:'page' => :'NotebooksResponsePage'
|
40
|
+
}
|
41
|
+
end
|
42
|
+
|
43
|
+
# List of attributes with nullable: true
|
44
|
+
def self.openapi_nullable
|
45
|
+
Set.new([
|
46
|
+
])
|
47
|
+
end
|
48
|
+
|
49
|
+
# Initializes the object
|
50
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
51
|
+
def initialize(attributes = {})
|
52
|
+
if (!attributes.is_a?(Hash))
|
53
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V1::NotebooksResponseMeta` 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::V1::NotebooksResponseMeta`. 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?(:'page')
|
65
|
+
self.page = attributes[:'page']
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
70
|
+
# @return Array for valid properties with the reasons
|
71
|
+
def list_invalid_properties
|
72
|
+
invalid_properties = Array.new
|
73
|
+
invalid_properties
|
74
|
+
end
|
75
|
+
|
76
|
+
# Check to see if the all the properties in the model are valid
|
77
|
+
# @return true if the model is valid
|
78
|
+
def valid?
|
79
|
+
true
|
80
|
+
end
|
81
|
+
|
82
|
+
# Checks equality by comparing each attribute.
|
83
|
+
# @param [Object] Object to be compared
|
84
|
+
def ==(o)
|
85
|
+
return true if self.equal?(o)
|
86
|
+
self.class == o.class &&
|
87
|
+
page == o.page
|
88
|
+
end
|
89
|
+
|
90
|
+
# @see the `==` method
|
91
|
+
# @param [Object] Object to be compared
|
92
|
+
def eql?(o)
|
93
|
+
self == o
|
94
|
+
end
|
95
|
+
|
96
|
+
# Calculates hash code according to all attributes.
|
97
|
+
# @return [Integer] Hash code
|
98
|
+
def hash
|
99
|
+
[page].hash
|
100
|
+
end
|
101
|
+
|
102
|
+
# Builds the object from hash
|
103
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
104
|
+
# @return [Object] Returns the model itself
|
105
|
+
def self.build_from_hash(attributes)
|
106
|
+
new.build_from_hash(attributes)
|
107
|
+
end
|
108
|
+
|
109
|
+
# Builds the object from hash
|
110
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
111
|
+
# @return [Object] Returns the model itself
|
112
|
+
def build_from_hash(attributes)
|
113
|
+
return nil unless attributes.is_a?(Hash)
|
114
|
+
self.class.openapi_types.each_pair do |key, type|
|
115
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
116
|
+
self.send("#{key}=", nil)
|
117
|
+
elsif type =~ /\AArray<(.*)>/i
|
118
|
+
# check to ensure the input is an array given that the attribute
|
119
|
+
# is documented as an array but the input is not
|
120
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
121
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
122
|
+
end
|
123
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
124
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
125
|
+
end
|
126
|
+
end
|
127
|
+
|
128
|
+
self
|
129
|
+
end
|
130
|
+
|
131
|
+
# Deserializes the data based on type
|
132
|
+
# @param string type Data type
|
133
|
+
# @param string value Value to be deserialized
|
134
|
+
# @return [Object] Deserialized data
|
135
|
+
def _deserialize(type, value)
|
136
|
+
case type.to_sym
|
137
|
+
when :Time
|
138
|
+
Time.parse(value)
|
139
|
+
when :Date
|
140
|
+
Date.parse(value)
|
141
|
+
when :String
|
142
|
+
value.to_s
|
143
|
+
when :Integer
|
144
|
+
value.to_i
|
145
|
+
when :Float
|
146
|
+
value.to_f
|
147
|
+
when :Boolean
|
148
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
149
|
+
true
|
150
|
+
else
|
151
|
+
false
|
152
|
+
end
|
153
|
+
when :Object
|
154
|
+
# generic object (usually a Hash), return directly
|
155
|
+
value
|
156
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
157
|
+
inner_type = Regexp.last_match[:inner_type]
|
158
|
+
value.map { |v| _deserialize(inner_type, v) }
|
159
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
160
|
+
k_type = Regexp.last_match[:k_type]
|
161
|
+
v_type = Regexp.last_match[:v_type]
|
162
|
+
{}.tap do |hash|
|
163
|
+
value.each do |k, v|
|
164
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
165
|
+
end
|
166
|
+
end
|
167
|
+
else # model
|
168
|
+
# models (e.g. Pet) or oneOf
|
169
|
+
klass = DatadogAPIClient::V1.const_get(type)
|
170
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
171
|
+
end
|
172
|
+
end
|
173
|
+
|
174
|
+
# Returns the string representation of the object
|
175
|
+
# @return [String] String presentation of the object
|
176
|
+
def to_s
|
177
|
+
to_hash.to_s
|
178
|
+
end
|
179
|
+
|
180
|
+
# to_body is an alias to to_hash (backward compatibility)
|
181
|
+
# @return [Hash] Returns the object in the form of hash
|
182
|
+
def to_body
|
183
|
+
to_hash
|
184
|
+
end
|
185
|
+
|
186
|
+
# Returns the object in the form of hash
|
187
|
+
# @return [Hash] Returns the object in the form of hash
|
188
|
+
def to_hash
|
189
|
+
hash = {}
|
190
|
+
self.class.attribute_map.each_pair do |attr, param|
|
191
|
+
value = self.send(attr)
|
192
|
+
if value.nil?
|
193
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
194
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
195
|
+
end
|
196
|
+
|
197
|
+
hash[param] = _to_hash(value)
|
198
|
+
end
|
199
|
+
hash
|
200
|
+
end
|
201
|
+
|
202
|
+
# Outputs non-array value in the form of hash
|
203
|
+
# For object, use to_hash. Otherwise, just return the value
|
204
|
+
# @param [Object] value Any valid value
|
205
|
+
# @return [Hash] Returns the value in the form of hash
|
206
|
+
def _to_hash(value)
|
207
|
+
if value.is_a?(Array)
|
208
|
+
value.compact.map { |v| _to_hash(v) }
|
209
|
+
elsif value.is_a?(Hash)
|
210
|
+
{}.tap do |hash|
|
211
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
212
|
+
end
|
213
|
+
elsif value.respond_to? :to_hash
|
214
|
+
value.to_hash
|
215
|
+
else
|
216
|
+
value
|
217
|
+
end
|
218
|
+
end
|
219
|
+
|
220
|
+
end
|
221
|
+
|
222
|
+
end
|