datadog_api_client 2.13.0 → 2.15.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (148) hide show
  1. checksums.yaml +4 -4
  2. data/.apigentools-info +4 -4
  3. data/.generator/schemas/v1/openapi.yaml +346 -36
  4. data/.generator/schemas/v2/openapi.yaml +436 -174
  5. data/.generator/src/generator/formatter.py +34 -29
  6. data/.generator/src/generator/openapi.py +3 -1
  7. data/.generator/src/generator/templates/api.j2 +8 -2
  8. data/.generator/src/generator/templates/api_client.j2 +81 -53
  9. data/.generator/src/generator/templates/configuration.j2 +21 -0
  10. data/.pre-commit-config.yaml +2 -2
  11. data/CHANGELOG.md +57 -0
  12. data/README.md +23 -0
  13. data/examples/v1/azure-integration/CreateAzureIntegration.rb +3 -0
  14. data/examples/v1/azure-integration/DeleteAzureIntegration.rb +3 -0
  15. data/examples/v1/azure-integration/UpdateAzureHostFilters.rb +3 -0
  16. data/examples/v1/azure-integration/UpdateAzureIntegration.rb +3 -0
  17. data/examples/v1/dashboards/CreateDashboard_252716965.rb +6 -0
  18. data/examples/v1/dashboards/CreateDashboard_2618036642.rb +36 -0
  19. data/examples/v1/dashboards/CreateDashboard_2705593938.rb +3 -0
  20. data/examples/v1/dashboards/CreateDashboard_3777304439.rb +50 -0
  21. data/examples/v1/dashboards/DeletePublicDashboardInvitation.rb +3 -3
  22. data/examples/v1/dashboards/ListDashboards_1062671515.rb +8 -0
  23. data/examples/v1/monitors/ListMonitors_2966492814.rb +8 -0
  24. data/examples/v1/notebooks/ListNotebooks_788665428.rb +8 -0
  25. data/examples/v1/service-level-objective-corrections/ListSLOCorrection_2647266873.rb +8 -0
  26. data/examples/v1/service-level-objectives/ListSLOs_3036942817.rb +8 -0
  27. data/examples/v1/synthetics/CreateSyntheticsAPITest_1487281163.rb +2 -0
  28. data/examples/v1/synthetics/ListTests_1938827783.rb +8 -0
  29. data/examples/v2/ci-visibility-pipelines/CreateCIAppPipelineEvent.rb +3 -0
  30. data/examples/v2/ci-visibility-pipelines/CreateCIAppPipelineEvent_129899466.rb +3 -0
  31. data/examples/v2/downtimes/CancelDowntime.rb +0 -3
  32. data/examples/v2/downtimes/CreateDowntime.rb +0 -3
  33. data/examples/v2/downtimes/GetDowntime.rb +0 -3
  34. data/examples/v2/downtimes/ListDowntimes.rb +0 -3
  35. data/examples/v2/downtimes/ListDowntimes_805770330.rb +8 -0
  36. data/examples/v2/downtimes/ListMonitorDowntimes.rb +0 -3
  37. data/examples/v2/downtimes/ListMonitorDowntimes_128979780.rb +0 -3
  38. data/examples/v2/downtimes/UpdateDowntime.rb +0 -3
  39. data/examples/v2/logs/AggregateLogs_2955613758.rb +1 -1
  40. data/examples/v2/security-monitoring/CreateSecurityMonitoringRule_1092490364.rb +1 -1
  41. data/examples/v2/security-monitoring/UpdateSecurityMonitoringRule_428087276.rb +1 -1
  42. data/examples/v2/teams/CreateTeam.rb +2 -2
  43. data/examples/v2/teams/CreateTeam_252121814.rb +24 -0
  44. data/examples/v2/teams/GetUserMemberships.rb +8 -0
  45. data/examples/v2/teams/ListTeams_3592098458.rb +8 -0
  46. data/examples/v2/teams/UpdateTeam.rb +9 -0
  47. data/examples/v2/users/ListUsers_4075885358.rb +8 -0
  48. data/lib/datadog_api_client/api_client.rb +81 -53
  49. data/lib/datadog_api_client/configuration.rb +22 -6
  50. data/lib/datadog_api_client/inflector.rb +11 -1
  51. data/lib/datadog_api_client/v1/api/dashboards_api.rb +25 -0
  52. data/lib/datadog_api_client/v1/api/monitors_api.rb +22 -0
  53. data/lib/datadog_api_client/v1/api/notebooks_api.rb +21 -0
  54. data/lib/datadog_api_client/v1/api/service_level_objective_corrections_api.rb +23 -2
  55. data/lib/datadog_api_client/v1/api/service_level_objectives_api.rb +31 -10
  56. data/lib/datadog_api_client/v1/api/synthetics_api.rb +25 -3
  57. data/lib/datadog_api_client/v1/api/usage_metering_api.rb +3 -3
  58. data/lib/datadog_api_client/v1/models/azure_account.rb +32 -1
  59. data/lib/datadog_api_client/v1/models/distribution_widget_definition.rb +13 -1
  60. data/lib/datadog_api_client/v1/models/heat_map_widget_request.rb +35 -1
  61. data/lib/datadog_api_client/v1/models/hourly_usage_attribution_usage_type.rb +4 -0
  62. data/lib/datadog_api_client/v1/models/list_stream_source.rb +1 -0
  63. data/lib/datadog_api_client/v1/models/monitor.rb +1 -1
  64. data/lib/datadog_api_client/v1/models/monitor_options.rb +1 -1
  65. data/lib/datadog_api_client/v1/models/monthly_usage_attribution_supported_metrics.rb +8 -0
  66. data/lib/datadog_api_client/v1/models/monthly_usage_attribution_values.rb +81 -1
  67. data/lib/datadog_api_client/v1/models/sunburst_widget_request.rb +14 -4
  68. data/lib/datadog_api_client/v1/models/synthetics_assertion_target.rb +11 -1
  69. data/lib/datadog_api_client/v1/models/synthetics_assertion_timings_scope.rb +27 -0
  70. data/lib/datadog_api_client/v1/models/synthetics_test_request.rb +11 -1
  71. data/lib/datadog_api_client/v1/models/usage_ci_visibility_hour.rb +12 -1
  72. data/lib/datadog_api_client/v1/models/usage_profiling_hour.rb +12 -1
  73. data/lib/datadog_api_client/v1/models/usage_summary_date.rb +44 -4
  74. data/lib/datadog_api_client/v1/models/usage_summary_date_org.rb +44 -4
  75. data/lib/datadog_api_client/v1/models/usage_summary_response.rb +44 -4
  76. data/lib/datadog_api_client/v1/models/widget_comparator.rb +1 -0
  77. data/lib/datadog_api_client/v2/api/audit_api.rb +1 -1
  78. data/lib/datadog_api_client/v2/api/ci_visibility_pipelines_api.rb +11 -7
  79. data/lib/datadog_api_client/v2/api/ci_visibility_tests_api.rb +1 -1
  80. data/lib/datadog_api_client/v2/api/downtimes_api.rb +25 -36
  81. data/lib/datadog_api_client/v2/api/events_api.rb +1 -1
  82. data/lib/datadog_api_client/v2/api/ip_allowlist_api.rb +2 -2
  83. data/lib/datadog_api_client/v2/api/logs_api.rb +1 -1
  84. data/lib/datadog_api_client/v2/api/metrics_api.rb +1 -1
  85. data/lib/datadog_api_client/v2/api/processes_api.rb +1 -1
  86. data/lib/datadog_api_client/v2/api/rum_api.rb +1 -1
  87. data/lib/datadog_api_client/v2/api/security_monitoring_api.rb +6 -6
  88. data/lib/datadog_api_client/v2/api/service_definition_api.rb +2 -2
  89. data/lib/datadog_api_client/v2/api/spans_api.rb +1 -1
  90. data/lib/datadog_api_client/v2/api/spans_metrics_api.rb +2 -2
  91. data/lib/datadog_api_client/v2/api/teams_api.rb +87 -0
  92. data/lib/datadog_api_client/v2/api/usage_metering_api.rb +1 -1
  93. data/lib/datadog_api_client/v2/api/users_api.rb +22 -0
  94. data/lib/datadog_api_client/v2/models/application_key_create_attributes.rb +1 -1
  95. data/lib/datadog_api_client/v2/models/application_key_update_attributes.rb +1 -1
  96. data/lib/datadog_api_client/v2/models/audit_logs_event_attributes.rb +11 -1
  97. data/lib/datadog_api_client/v2/models/ci_app_event_attributes.rb +9 -21
  98. data/lib/datadog_api_client/v2/models/ci_app_pipeline_event.rb +1 -1
  99. data/lib/datadog_api_client/v2/models/{team_data.rb → ci_app_pipeline_event_attributes.rb} +24 -62
  100. data/lib/datadog_api_client/v2/models/ci_app_pipeline_level.rb +30 -0
  101. data/lib/datadog_api_client/v2/models/ci_app_pipelines_query_filter.rb +1 -1
  102. data/lib/datadog_api_client/v2/models/ci_app_test_level.rb +29 -0
  103. data/lib/datadog_api_client/v2/models/ci_app_tests_analytics_aggregate_response.rb +1 -1
  104. data/lib/datadog_api_client/v2/models/ci_app_tests_query_filter.rb +1 -1
  105. data/lib/datadog_api_client/v2/models/cloud_configuration_rule_compliance_signal_options.rb +25 -1
  106. data/lib/datadog_api_client/v2/models/dashboard_list_item.rb +25 -1
  107. data/lib/datadog_api_client/v2/models/downtime_relationships_monitor_data.rb +1 -1
  108. data/lib/datadog_api_client/v2/models/downtime_schedule_one_time_response.rb +19 -1
  109. data/lib/datadog_api_client/v2/models/formula_limit.rb +1 -0
  110. data/lib/datadog_api_client/v2/models/full_application_key_attributes.rb +1 -1
  111. data/lib/datadog_api_client/v2/models/logs_aggregate_request.rb +1 -1
  112. data/lib/datadog_api_client/v2/models/logs_aggregate_request_page.rb +1 -1
  113. data/lib/datadog_api_client/v2/models/logs_group_by.rb +3 -2
  114. data/lib/datadog_api_client/v2/models/logs_group_by_histogram.rb +1 -1
  115. data/lib/datadog_api_client/v2/models/logs_list_request.rb +1 -1
  116. data/lib/datadog_api_client/v2/models/logs_query_options.rb +1 -1
  117. data/lib/datadog_api_client/v2/models/logs_response_metadata_page.rb +1 -1
  118. data/lib/datadog_api_client/v2/models/on_demand_concurrency_cap.rb +14 -4
  119. data/lib/datadog_api_client/v2/models/on_demand_concurrency_cap_type.rb +26 -0
  120. data/lib/datadog_api_client/v2/models/partial_application_key_attributes.rb +1 -1
  121. data/lib/datadog_api_client/v2/models/query_formula.rb +1 -0
  122. data/lib/datadog_api_client/v2/models/relationship_to_team_links.rb +14 -4
  123. data/lib/datadog_api_client/v2/models/relationship_to_user_team_permission.rb +14 -4
  124. data/lib/datadog_api_client/v2/models/security_monitoring_signal_metadata_type.rb +26 -0
  125. data/lib/datadog_api_client/v2/models/security_monitoring_signal_response.rb +80 -0
  126. data/lib/datadog_api_client/v2/models/security_monitoring_signal_rule_response_query.rb +26 -2
  127. data/lib/datadog_api_client/v2/models/security_monitoring_signal_state_update_data.rb +24 -4
  128. data/lib/datadog_api_client/v2/models/security_monitoring_signal_triage_update_data.rb +24 -4
  129. data/lib/datadog_api_client/v2/models/security_monitoring_standard_rule_query.rb +1 -19
  130. data/lib/datadog_api_client/v2/models/security_monitoring_triage_user.rb +11 -1
  131. data/lib/datadog_api_client/v2/models/sensitive_data_scanner_get_config_response_data.rb +11 -1
  132. data/lib/datadog_api_client/v2/models/sensitive_data_scanner_meta.rb +11 -1
  133. data/lib/datadog_api_client/v2/models/sensitive_data_scanner_standard_pattern_attributes.rb +11 -1
  134. data/lib/datadog_api_client/v2/models/team_attributes.rb +50 -4
  135. data/lib/datadog_api_client/v2/models/team_create_attributes.rb +57 -4
  136. data/lib/datadog_api_client/v2/models/team_relationships_links.rb +80 -0
  137. data/lib/datadog_api_client/v2/models/team_response.rb +1 -1
  138. data/lib/datadog_api_client/v2/models/team_update_attributes.rb +57 -4
  139. data/lib/datadog_api_client/v2/models/teams_response.rb +24 -4
  140. data/lib/datadog_api_client/v2/models/teams_response_links.rb +129 -0
  141. data/lib/datadog_api_client/v2/models/teams_response_meta.rb +80 -0
  142. data/lib/datadog_api_client/v2/models/teams_response_meta_pagination.rb +150 -0
  143. data/lib/datadog_api_client/v2/models/usage_attributes_object.rb +11 -1
  144. data/lib/datadog_api_client/v2/models/user_teams_response.rb +24 -4
  145. data/lib/datadog_api_client/version.rb +1 -1
  146. data/spec/configuration_spec.rb +17 -0
  147. data/spec/retry_spec.rb +44 -0
  148. metadata +28 -3
@@ -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
+ # Teams response links.
21
+ class TeamsResponseLinks
22
+ include BaseGenericModel
23
+
24
+ # First link.
25
+ attr_accessor :first
26
+
27
+ # Last link.
28
+ attr_accessor :last
29
+
30
+ # Next link.
31
+ attr_accessor :_next
32
+
33
+ # Previous link.
34
+ attr_accessor :prev
35
+
36
+ # Current link.
37
+ attr_accessor :_self
38
+
39
+ # Attribute mapping from ruby-style variable name to JSON key.
40
+ # @!visibility private
41
+ def self.attribute_map
42
+ {
43
+ :'first' => :'first',
44
+ :'last' => :'last',
45
+ :'_next' => :'next',
46
+ :'prev' => :'prev',
47
+ :'_self' => :'self'
48
+ }
49
+ end
50
+
51
+ # Attribute type mapping.
52
+ # @!visibility private
53
+ def self.openapi_types
54
+ {
55
+ :'first' => :'String',
56
+ :'last' => :'String',
57
+ :'_next' => :'String',
58
+ :'prev' => :'String',
59
+ :'_self' => :'String'
60
+ }
61
+ end
62
+
63
+ # List of attributes with nullable: true
64
+ # @!visibility private
65
+ def self.openapi_nullable
66
+ Set.new([
67
+ :'last',
68
+ :'prev',
69
+ ])
70
+ end
71
+
72
+ # Initializes the object
73
+ # @param attributes [Hash] Model attributes in the form of hash
74
+ # @!visibility private
75
+ def initialize(attributes = {})
76
+ if (!attributes.is_a?(Hash))
77
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::TeamsResponseLinks` initialize method"
78
+ end
79
+
80
+ # check to see if the attribute exists and convert string to symbol for hash key
81
+ attributes = attributes.each_with_object({}) { |(k, v), h|
82
+ if (!self.class.attribute_map.key?(k.to_sym))
83
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::TeamsResponseLinks`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
84
+ end
85
+ h[k.to_sym] = v
86
+ }
87
+
88
+ if attributes.key?(:'first')
89
+ self.first = attributes[:'first']
90
+ end
91
+
92
+ if attributes.key?(:'last')
93
+ self.last = attributes[:'last']
94
+ end
95
+
96
+ if attributes.key?(:'_next')
97
+ self._next = attributes[:'_next']
98
+ end
99
+
100
+ if attributes.key?(:'prev')
101
+ self.prev = attributes[:'prev']
102
+ end
103
+
104
+ if attributes.key?(:'_self')
105
+ self._self = attributes[:'_self']
106
+ end
107
+ end
108
+
109
+ # Checks equality by comparing each attribute.
110
+ # @param o [Object] Object to be compared
111
+ # @!visibility private
112
+ def ==(o)
113
+ return true if self.equal?(o)
114
+ self.class == o.class &&
115
+ first == o.first &&
116
+ last == o.last &&
117
+ _next == o._next &&
118
+ prev == o.prev &&
119
+ _self == o._self
120
+ end
121
+
122
+ # Calculates hash code according to all attributes.
123
+ # @return [Integer] Hash code
124
+ # @!visibility private
125
+ def hash
126
+ [first, last, _next, prev, _self].hash
127
+ end
128
+ end
129
+ 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
+ # Teams response metadata.
21
+ class TeamsResponseMeta
22
+ include BaseGenericModel
23
+
24
+ # Teams response metadata.
25
+ attr_accessor :pagination
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ # @!visibility private
29
+ def self.attribute_map
30
+ {
31
+ :'pagination' => :'pagination'
32
+ }
33
+ end
34
+
35
+ # Attribute type mapping.
36
+ # @!visibility private
37
+ def self.openapi_types
38
+ {
39
+ :'pagination' => :'TeamsResponseMetaPagination'
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::TeamsResponseMeta` 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::TeamsResponseMeta`. 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?(:'pagination')
60
+ self.pagination = attributes[:'pagination']
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
+ pagination == o.pagination
71
+ end
72
+
73
+ # Calculates hash code according to all attributes.
74
+ # @return [Integer] Hash code
75
+ # @!visibility private
76
+ def hash
77
+ [pagination].hash
78
+ end
79
+ end
80
+ end
@@ -0,0 +1,150 @@
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
+ # Teams response metadata.
21
+ class TeamsResponseMetaPagination
22
+ include BaseGenericModel
23
+
24
+ # The first offset.
25
+ attr_accessor :first_offset
26
+
27
+ # The last offset.
28
+ attr_accessor :last_offset
29
+
30
+ # Pagination limit.
31
+ attr_accessor :limit
32
+
33
+ # The next offset.
34
+ attr_accessor :next_offset
35
+
36
+ # The offset.
37
+ attr_accessor :offset
38
+
39
+ # The previous offset.
40
+ attr_accessor :prev_offset
41
+
42
+ # Total results.
43
+ attr_accessor :total
44
+
45
+ # Offset type.
46
+ attr_accessor :type
47
+
48
+ # Attribute mapping from ruby-style variable name to JSON key.
49
+ # @!visibility private
50
+ def self.attribute_map
51
+ {
52
+ :'first_offset' => :'first_offset',
53
+ :'last_offset' => :'last_offset',
54
+ :'limit' => :'limit',
55
+ :'next_offset' => :'next_offset',
56
+ :'offset' => :'offset',
57
+ :'prev_offset' => :'prev_offset',
58
+ :'total' => :'total',
59
+ :'type' => :'type'
60
+ }
61
+ end
62
+
63
+ # Attribute type mapping.
64
+ # @!visibility private
65
+ def self.openapi_types
66
+ {
67
+ :'first_offset' => :'Integer',
68
+ :'last_offset' => :'Integer',
69
+ :'limit' => :'Integer',
70
+ :'next_offset' => :'Integer',
71
+ :'offset' => :'Integer',
72
+ :'prev_offset' => :'Integer',
73
+ :'total' => :'Integer',
74
+ :'type' => :'String'
75
+ }
76
+ end
77
+
78
+ # Initializes the object
79
+ # @param attributes [Hash] Model attributes in the form of hash
80
+ # @!visibility private
81
+ def initialize(attributes = {})
82
+ if (!attributes.is_a?(Hash))
83
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::TeamsResponseMetaPagination` initialize method"
84
+ end
85
+
86
+ # check to see if the attribute exists and convert string to symbol for hash key
87
+ attributes = attributes.each_with_object({}) { |(k, v), h|
88
+ if (!self.class.attribute_map.key?(k.to_sym))
89
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::TeamsResponseMetaPagination`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
90
+ end
91
+ h[k.to_sym] = v
92
+ }
93
+
94
+ if attributes.key?(:'first_offset')
95
+ self.first_offset = attributes[:'first_offset']
96
+ end
97
+
98
+ if attributes.key?(:'last_offset')
99
+ self.last_offset = attributes[:'last_offset']
100
+ end
101
+
102
+ if attributes.key?(:'limit')
103
+ self.limit = attributes[:'limit']
104
+ end
105
+
106
+ if attributes.key?(:'next_offset')
107
+ self.next_offset = attributes[:'next_offset']
108
+ end
109
+
110
+ if attributes.key?(:'offset')
111
+ self.offset = attributes[:'offset']
112
+ end
113
+
114
+ if attributes.key?(:'prev_offset')
115
+ self.prev_offset = attributes[:'prev_offset']
116
+ end
117
+
118
+ if attributes.key?(:'total')
119
+ self.total = attributes[:'total']
120
+ end
121
+
122
+ if attributes.key?(:'type')
123
+ self.type = attributes[:'type']
124
+ end
125
+ end
126
+
127
+ # Checks equality by comparing each attribute.
128
+ # @param o [Object] Object to be compared
129
+ # @!visibility private
130
+ def ==(o)
131
+ return true if self.equal?(o)
132
+ self.class == o.class &&
133
+ first_offset == o.first_offset &&
134
+ last_offset == o.last_offset &&
135
+ limit == o.limit &&
136
+ next_offset == o.next_offset &&
137
+ offset == o.offset &&
138
+ prev_offset == o.prev_offset &&
139
+ total == o.total &&
140
+ type == o.type
141
+ end
142
+
143
+ # Calculates hash code according to all attributes.
144
+ # @return [Integer] Hash code
145
+ # @!visibility private
146
+ def hash
147
+ [first_offset, last_offset, limit, next_offset, offset, prev_offset, total, type].hash
148
+ end
149
+ end
150
+ end
@@ -30,6 +30,9 @@ module DatadogAPIClient::V2
30
30
  # The organization public ID.
31
31
  attr_accessor :public_id
32
32
 
33
+ # The region of the Datadog instance that the organization belongs to.
34
+ attr_accessor :region
35
+
33
36
  # List of usage data reported for each requested hour.
34
37
  attr_accessor :timeseries
35
38
 
@@ -43,6 +46,7 @@ module DatadogAPIClient::V2
43
46
  :'org_name' => :'org_name',
44
47
  :'product_family' => :'product_family',
45
48
  :'public_id' => :'public_id',
49
+ :'region' => :'region',
46
50
  :'timeseries' => :'timeseries',
47
51
  :'usage_type' => :'usage_type'
48
52
  }
@@ -55,6 +59,7 @@ module DatadogAPIClient::V2
55
59
  :'org_name' => :'String',
56
60
  :'product_family' => :'String',
57
61
  :'public_id' => :'String',
62
+ :'region' => :'String',
58
63
  :'timeseries' => :'Array<UsageTimeSeriesObject>',
59
64
  :'usage_type' => :'HourlyUsageType'
60
65
  }
@@ -88,6 +93,10 @@ module DatadogAPIClient::V2
88
93
  self.public_id = attributes[:'public_id']
89
94
  end
90
95
 
96
+ if attributes.key?(:'region')
97
+ self.region = attributes[:'region']
98
+ end
99
+
91
100
  if attributes.key?(:'timeseries')
92
101
  if (value = attributes[:'timeseries']).is_a?(Array)
93
102
  self.timeseries = value
@@ -108,6 +117,7 @@ module DatadogAPIClient::V2
108
117
  org_name == o.org_name &&
109
118
  product_family == o.product_family &&
110
119
  public_id == o.public_id &&
120
+ region == o.region &&
111
121
  timeseries == o.timeseries &&
112
122
  usage_type == o.usage_type
113
123
  end
@@ -116,7 +126,7 @@ module DatadogAPIClient::V2
116
126
  # @return [Integer] Hash code
117
127
  # @!visibility private
118
128
  def hash
119
- [org_name, product_family, public_id, timeseries, usage_type].hash
129
+ [org_name, product_family, public_id, region, timeseries, usage_type].hash
120
130
  end
121
131
  end
122
132
  end
@@ -24,11 +24,19 @@ module DatadogAPIClient::V2
24
24
  # Team memberships response data
25
25
  attr_accessor :data
26
26
 
27
+ # Teams response links.
28
+ attr_accessor :links
29
+
30
+ # Teams response metadata.
31
+ attr_accessor :meta
32
+
27
33
  # Attribute mapping from ruby-style variable name to JSON key.
28
34
  # @!visibility private
29
35
  def self.attribute_map
30
36
  {
31
- :'data' => :'data'
37
+ :'data' => :'data',
38
+ :'links' => :'links',
39
+ :'meta' => :'meta'
32
40
  }
33
41
  end
34
42
 
@@ -36,7 +44,9 @@ module DatadogAPIClient::V2
36
44
  # @!visibility private
37
45
  def self.openapi_types
38
46
  {
39
- :'data' => :'Array<UserTeam>'
47
+ :'data' => :'Array<UserTeam>',
48
+ :'links' => :'TeamsResponseLinks',
49
+ :'meta' => :'TeamsResponseMeta'
40
50
  }
41
51
  end
42
52
 
@@ -61,6 +71,14 @@ module DatadogAPIClient::V2
61
71
  self.data = value
62
72
  end
63
73
  end
74
+
75
+ if attributes.key?(:'links')
76
+ self.links = attributes[:'links']
77
+ end
78
+
79
+ if attributes.key?(:'meta')
80
+ self.meta = attributes[:'meta']
81
+ end
64
82
  end
65
83
 
66
84
  # Checks equality by comparing each attribute.
@@ -69,14 +87,16 @@ module DatadogAPIClient::V2
69
87
  def ==(o)
70
88
  return true if self.equal?(o)
71
89
  self.class == o.class &&
72
- data == o.data
90
+ data == o.data &&
91
+ links == o.links &&
92
+ meta == o.meta
73
93
  end
74
94
 
75
95
  # Calculates hash code according to all attributes.
76
96
  # @return [Integer] Hash code
77
97
  # @!visibility private
78
98
  def hash
79
- [data].hash
99
+ [data, links, meta].hash
80
100
  end
81
101
  end
82
102
  end
@@ -1,5 +1,5 @@
1
1
  # Define library version.
2
2
 
3
3
  module DatadogAPIClient
4
- VERSION = '2.13.0'
4
+ VERSION = '2.15.0'
5
5
  end
@@ -42,4 +42,21 @@ describe DatadogAPIClient::Configuration do
42
42
  end
43
43
  end
44
44
  end
45
+
46
+ describe '#backoff_base' do
47
+ context 'when setting a valid backoff_base value > 2' do
48
+ it 'sets the backoff_base attribute' do
49
+ config.backoff_base = 3
50
+ expect(config.backoff_base).to eq(3)
51
+ end
52
+ end
53
+ end
54
+
55
+ context 'when setting an invalid backoff_base value < 2' do
56
+ it 'raises an ArgumentError' do
57
+ expect { config.backoff_base = 1 }.to raise_error(ArgumentError, 'backoff_base cannot be smaller than 2')
58
+ end
59
+ end
60
+
61
+
45
62
  end
@@ -0,0 +1,44 @@
1
+ require 'spec_helper'
2
+
3
+ describe 'logs_archive retry test' do
4
+ before do
5
+ DatadogAPIClient.configure do |c|
6
+ c.enable_retry = true
7
+ c.backoff_base = 2
8
+ end
9
+ @api_instance = DatadogAPIClient::V2::LogsArchivesAPI.new
10
+ @base_path = @api_instance.api_client.build_request_url('')
11
+ @body = DatadogAPIClient::V2::LogsArchiveCreateRequest.new
12
+ allow_any_instance_of(DatadogAPIClient::APIClient).to receive(:sleep)
13
+ end
14
+ it 'should retry 3 times and sleep for the value of X-Ratelimit-Reset' do
15
+ fixture = File.read('spec/fixtures/logs_archive_unknown_nested_oneof.json')
16
+ stub_request(:post, "#{@base_path}api/v2/logs/config/archives")
17
+ .to_return(
18
+ {:body => fixture, :headers => {"Content-Type": "application/json", "X-Ratelimit-Reset" => "1"}, :status => 429},
19
+ {:body => fixture, :headers => {"Content-Type": "application/json", "X-Ratelimit-Reset" => "1"}, :status => 429},
20
+ {:body => fixture, :headers => {"Content-Type": "application/json", "X-Ratelimit-Reset" => "1"}, :status => 429},
21
+ {:body => fixture, :headers => {"Content-Type": "application/json"}, :status => 299}
22
+ )
23
+ data = @api_instance.create_logs_archive(@body)
24
+ expect(@api_instance::api_client).to have_received(:sleep).exactly(3).times.with(1)
25
+ expect(WebMock).to have_requested(:post, "#{@base_path}api/v2/logs/config/archives").times(4)
26
+ end
27
+
28
+ it 'should retry 3 times and sleep for 2,4,8 seconds' do
29
+ fixture = File.read('spec/fixtures/logs_archive_unknown_nested_oneof.json')
30
+ stub_request(:post, "#{@base_path}api/v2/logs/config/archives")
31
+ .to_return(
32
+ {:body => fixture, :headers => {"Content-Type": "application/json"}, :status => 500},
33
+ {:body => fixture, :headers => {"Content-Type": "application/json"}, :status => 500},
34
+ {:body => fixture, :headers => {"Content-Type": "application/json"}, :status => 500},
35
+ {:body => fixture, :headers => {"Content-Type": "application/json"}, :status => 299}
36
+ )
37
+
38
+ data = @api_instance.create_logs_archive(@body)
39
+ expect(@api_instance::api_client).to have_received(:sleep).exactly(1).times.with(2)
40
+ expect(@api_instance::api_client).to have_received(:sleep).exactly(1).times.with(4)
41
+ expect(@api_instance::api_client).to have_received(:sleep).exactly(1).times.with(8)
42
+ expect(WebMock).to have_requested(:post, "#{@base_path}api/v2/logs/config/archives").times(4)
43
+ end
44
+ end