diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 76247abeacc..2f29c0ae8f4 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -21612,6 +21612,207 @@ components: - ASSIGNEE - CASE - TEAM_OWNERS + GetMultipleRulesetsRequest: + properties: + data: + $ref: '#/components/schemas/GetMultipleRulesetsRequestData' + type: object + GetMultipleRulesetsRequestData: + properties: + attributes: + $ref: '#/components/schemas/GetMultipleRulesetsRequestDataAttributes' + id: + type: string + type: + $ref: '#/components/schemas/GetMultipleRulesetsRequestDataType' + required: + - type + type: object + GetMultipleRulesetsRequestDataAttributes: + properties: + include_testing_rules: + type: boolean + include_tests: + type: boolean + rulesets: + items: + type: string + type: array + type: object + GetMultipleRulesetsRequestDataType: + default: get_multiple_rulesets_request + description: Get multiple rulesets request resource type. + enum: + - get_multiple_rulesets_request + example: get_multiple_rulesets_request + type: string + x-enum-varnames: + - GET_MULTIPLE_RULESETS_REQUEST + GetMultipleRulesetsResponse: + properties: + data: + $ref: '#/components/schemas/GetMultipleRulesetsResponseData' + type: object + GetMultipleRulesetsResponseData: + properties: + attributes: + $ref: '#/components/schemas/GetMultipleRulesetsResponseDataAttributes' + id: + type: string + type: + $ref: '#/components/schemas/GetMultipleRulesetsResponseDataType' + required: + - type + type: object + GetMultipleRulesetsResponseDataAttributes: + properties: + rulesets: + items: + $ref: '#/components/schemas/GetMultipleRulesetsResponseDataAttributesRulesetsItems' + type: array + type: object + GetMultipleRulesetsResponseDataAttributesRulesetsItems: + properties: + data: + $ref: '#/components/schemas/GetMultipleRulesetsResponseDataAttributesRulesetsItemsData' + description: + type: string + name: + type: string + rules: + items: + $ref: '#/components/schemas/GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItems' + type: array + short_description: + type: string + required: + - data + type: object + GetMultipleRulesetsResponseDataAttributesRulesetsItemsData: + properties: + id: + type: string + type: + $ref: '#/components/schemas/GetMultipleRulesetsResponseDataAttributesRulesetsItemsDataType' + required: + - type + type: object + GetMultipleRulesetsResponseDataAttributesRulesetsItemsDataType: + default: rulesets + description: Rulesets resource type. + enum: + - rulesets + example: rulesets + type: string + x-enum-varnames: + - RULESETS + GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItems: + properties: + arguments: + items: + $ref: '#/components/schemas/GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsArgumentsItems' + type: array + category: + type: string + checksum: + type: string + code: + type: string + created_at: + format: date-time + type: string + created_by: + type: string + cve: + type: string + cwe: + type: string + data: + $ref: '#/components/schemas/GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsData' + description: + type: string + documentation_url: + type: string + entity_checked: + type: string + is_published: + type: boolean + is_testing: + type: boolean + language: + type: string + last_updated_at: + format: date-time + type: string + last_updated_by: + type: string + name: + type: string + regex: + type: string + severity: + type: string + short_description: + type: string + should_use_ai_fix: + type: boolean + tests: + items: + $ref: '#/components/schemas/GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsTestsItems' + type: array + tree_sitter_query: + type: string + type: + type: string + required: + - data + type: object + GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsArgumentsItems: + properties: + description: + type: string + name: + type: string + type: object + GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsData: + properties: + id: + type: string + type: + $ref: '#/components/schemas/GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsDataType' + required: + - type + type: object + GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsDataType: + default: rules + description: Rules resource type. + enum: + - rules + example: rules + type: string + x-enum-varnames: + - RULES + GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsTestsItems: + properties: + annotation_count: + format: int64 + maximum: 65535 + minimum: 0 + type: integer + code: + type: string + filename: + type: string + type: object + GetMultipleRulesetsResponseDataType: + default: get_multiple_rulesets_response + description: Get multiple rulesets response resource type. + enum: + - get_multiple_rulesets_response + example: get_multiple_rulesets_response + type: string + x-enum-varnames: + - GET_MULTIPLE_RULESETS_RESPONSE GetResourceEvaluationFiltersResponse: description: The definition of `GetResourceEvaluationFiltersResponse` object. properties: @@ -42844,6 +43045,116 @@ components: - ISSUE_ASSIGNEE - ISSUE_CASE - ISSUE_TEAM_OWNERS + SecretRuleArray: + properties: + data: + items: + $ref: '#/components/schemas/SecretRuleData' + type: array + required: + - data + type: object + SecretRuleData: + properties: + attributes: + $ref: '#/components/schemas/SecretRuleDataAttributes' + id: + type: string + type: + $ref: '#/components/schemas/SecretRuleDataType' + required: + - type + type: object + SecretRuleDataAttributes: + properties: + default_included_keywords: + items: + type: string + type: array + description: + type: string + license: + type: string + match_validation: + $ref: '#/components/schemas/SecretRuleDataAttributesMatchValidation' + name: + type: string + pattern: + type: string + priority: + type: string + sds_id: + type: string + validators: + items: + type: string + type: array + type: object + SecretRuleDataAttributesMatchValidation: + properties: + endpoint: + type: string + hosts: + items: + type: string + type: array + http_method: + type: string + invalid_http_status_code: + items: + $ref: '#/components/schemas/SecretRuleDataAttributesMatchValidationInvalidHttpStatusCodeItems' + type: array + request_headers: + additionalProperties: + type: string + type: object + timeout_seconds: + format: int64 + maximum: 1.8446744073709552e+19 + minimum: 0 + type: integer + type: + type: string + valid_http_status_code: + items: + $ref: '#/components/schemas/SecretRuleDataAttributesMatchValidationValidHttpStatusCodeItems' + type: array + type: object + SecretRuleDataAttributesMatchValidationInvalidHttpStatusCodeItems: + properties: + end: + format: int64 + maximum: 1.8446744073709552e+19 + minimum: 0 + type: integer + start: + format: int64 + maximum: 1.8446744073709552e+19 + minimum: 0 + type: integer + type: object + SecretRuleDataAttributesMatchValidationValidHttpStatusCodeItems: + properties: + end: + format: int64 + maximum: 1.8446744073709552e+19 + minimum: 0 + type: integer + start: + format: int64 + maximum: 1.8446744073709552e+19 + minimum: 0 + type: integer + type: object + SecretRuleDataType: + default: secret_rule + description: Secret rule resource type. + enum: + - secret_rule + example: secret_rule + type: string + x-enum-varnames: + - SECRET_RULE SecurityFilter: description: The security filter's properties. properties: @@ -77328,6 +77639,57 @@ paths: tags: - Static Analysis x-unstable: '**Note**: This endpoint may be subject to changes.' + /api/v2/static-analysis/rulesets: + post: + description: Get rules for multiple rulesets in batch. + operationId: ListMultipleRulesets + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GetMultipleRulesetsRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/GetMultipleRulesetsResponse' + description: OK + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - code_analysis_read + summary: Ruleset get multiple + tags: + - Security Monitoring + x-unstable: '**Note**: This endpoint may be subject to changes.' + /api/v2/static-analysis/secrets/rules: + get: + description: Returns list of Secrets rules with ID, Pattern, Description, Priority, + and SDS ID + operationId: GetSecretsRules + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/SecretRuleArray' + description: OK + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - code_analysis_read + summary: Returns list of Secrets rules + tags: + - Security Monitoring + x-unstable: '**Note**: This endpoint may be subject to changes.' /api/v2/synthetics/settings/on_demand_concurrency_cap: get: description: Get the on-demand concurrency cap. diff --git a/examples/v2/security-monitoring/GetSecretsRules.rb b/examples/v2/security-monitoring/GetSecretsRules.rb new file mode 100644 index 00000000000..8618c0801d5 --- /dev/null +++ b/examples/v2/security-monitoring/GetSecretsRules.rb @@ -0,0 +1,8 @@ +# Returns list of Secrets rules returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.get_secrets_rules".to_sym] = true +end +api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new +p api_instance.get_secrets_rules() diff --git a/examples/v2/security-monitoring/ListMultipleRulesets.rb b/examples/v2/security-monitoring/ListMultipleRulesets.rb new file mode 100644 index 00000000000..d0a108eb775 --- /dev/null +++ b/examples/v2/security-monitoring/ListMultipleRulesets.rb @@ -0,0 +1,17 @@ +# Ruleset get multiple returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.list_multiple_rulesets".to_sym] = true +end +api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new + +body = DatadogAPIClient::V2::GetMultipleRulesetsRequest.new({ + data: DatadogAPIClient::V2::GetMultipleRulesetsRequestData.new({ + attributes: DatadogAPIClient::V2::GetMultipleRulesetsRequestDataAttributes.new({ + rulesets: [], + }), + type: DatadogAPIClient::V2::GetMultipleRulesetsRequestDataType::GET_MULTIPLE_RULESETS_REQUEST, + }), +}) +p api_instance.list_multiple_rulesets(body) diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index 612eaa0f8aa..0b8d07a0d33 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -1610,6 +1610,9 @@ "page_cursor" => "String", "page_limit" => "Integer", }, + "v2.ListMultipleRulesets" => { + "body" => "GetMultipleRulesetsRequest", + }, "v2.ListContainerImages" => { "filter_tags" => "String", "group_by" => "String", diff --git a/features/v2/security_monitoring.feature b/features/v2/security_monitoring.feature index 703fc3e460f..2937151efb2 100644 --- a/features/v2/security_monitoring.feature +++ b/features/v2/security_monitoring.feature @@ -5,9 +5,9 @@ Feature: Security Monitoring information. Background: - Given a valid "apiKeyAuth" key in the system + Given an instance of "SecurityMonitoring" API + And a valid "apiKeyAuth" key in the system And a valid "appKeyAuth" key in the system - And an instance of "SecurityMonitoring" API @team:DataDog/k9-cloud-security-platform Scenario: Cancel a historical job returns "Bad Request" response @@ -1295,6 +1295,21 @@ Feature: Security Monitoring When the request is sent Then the response status is 422 The server cannot process the request because it contains invalid data. + @generated @skip @team:DataDog/asm-vm + Scenario: Returns list of Secrets rules returns "OK" response + Given operation "GetSecretsRules" enabled + And new "GetSecretsRules" request + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/asm-vm + Scenario: Ruleset get multiple returns "OK" response + Given operation "ListMultipleRulesets" enabled + And new "ListMultipleRulesets" request + And body with value {"data": {"attributes": {"rulesets": []}, "type": "get_multiple_rulesets_request"}} + When the request is sent + Then the response status is 200 OK + @team:DataDog/k9-cloud-security-platform Scenario: Run a threat hunting job returns "Bad Request" response Given operation "RunThreatHuntingJob" enabled diff --git a/features/v2/undo.json b/features/v2/undo.json index eb1380ab6b8..cd58e7f6da4 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -4005,6 +4005,20 @@ "type": "safe" } }, + "ListMultipleRulesets": { + "tag": "Security Monitoring", + "undo": { + "operationId": "TODO", + "parameters": [], + "type": "unsafe" + } + }, + "GetSecretsRules": { + "tag": "Security Monitoring", + "undo": { + "type": "safe" + } + }, "GetOnDemandConcurrencyCap": { "tag": "Synthetics", "undo": { diff --git a/lib/datadog_api_client/configuration.rb b/lib/datadog_api_client/configuration.rb index c398248b2a0..fdc24843a85 100644 --- a/lib/datadog_api_client/configuration.rb +++ b/lib/datadog_api_client/configuration.rb @@ -204,11 +204,13 @@ def initialize "v2.get_finding": false, "v2.get_rule_version_history": false, "v2.get_sbom": false, + "v2.get_secrets_rules": false, "v2.get_security_monitoring_histsignal": false, "v2.get_security_monitoring_histsignals_by_job_id": false, "v2.get_threat_hunting_job": false, "v2.list_assets_sbo_ms": false, "v2.list_findings": false, + "v2.list_multiple_rulesets": false, "v2.list_scanned_assets_metadata": false, "v2.list_security_monitoring_histsignals": false, "v2.list_threat_hunting_jobs": false, diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index e43e80707bc..8314bbd66ba 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -2231,6 +2231,22 @@ def overrides "v2.get_interfaces_data" => "GetInterfacesData", "v2.get_interfaces_response" => "GetInterfacesResponse", "v2.get_issue_include_query_parameter_item" => "GetIssueIncludeQueryParameterItem", + "v2.get_multiple_rulesets_request" => "GetMultipleRulesetsRequest", + "v2.get_multiple_rulesets_request_data" => "GetMultipleRulesetsRequestData", + "v2.get_multiple_rulesets_request_data_attributes" => "GetMultipleRulesetsRequestDataAttributes", + "v2.get_multiple_rulesets_request_data_type" => "GetMultipleRulesetsRequestDataType", + "v2.get_multiple_rulesets_response" => "GetMultipleRulesetsResponse", + "v2.get_multiple_rulesets_response_data" => "GetMultipleRulesetsResponseData", + "v2.get_multiple_rulesets_response_data_attributes" => "GetMultipleRulesetsResponseDataAttributes", + "v2.get_multiple_rulesets_response_data_attributes_rulesets_items" => "GetMultipleRulesetsResponseDataAttributesRulesetsItems", + "v2.get_multiple_rulesets_response_data_attributes_rulesets_items_data" => "GetMultipleRulesetsResponseDataAttributesRulesetsItemsData", + "v2.get_multiple_rulesets_response_data_attributes_rulesets_items_data_type" => "GetMultipleRulesetsResponseDataAttributesRulesetsItemsDataType", + "v2.get_multiple_rulesets_response_data_attributes_rulesets_items_rules_items" => "GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItems", + "v2.get_multiple_rulesets_response_data_attributes_rulesets_items_rules_items_arguments_items" => "GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsArgumentsItems", + "v2.get_multiple_rulesets_response_data_attributes_rulesets_items_rules_items_data" => "GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsData", + "v2.get_multiple_rulesets_response_data_attributes_rulesets_items_rules_items_data_type" => "GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsDataType", + "v2.get_multiple_rulesets_response_data_attributes_rulesets_items_rules_items_tests_items" => "GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsTestsItems", + "v2.get_multiple_rulesets_response_data_type" => "GetMultipleRulesetsResponseDataType", "v2.get_resource_evaluation_filters_response" => "GetResourceEvaluationFiltersResponse", "v2.get_resource_evaluation_filters_response_data" => "GetResourceEvaluationFiltersResponseData", "v2.get_rule_version_history_data" => "GetRuleVersionHistoryData", @@ -3645,6 +3661,13 @@ def overrides "v2.schedule_user_type" => "ScheduleUserType", "v2.scorecard_type" => "ScorecardType", "v2.search_issues_include_query_parameter_item" => "SearchIssuesIncludeQueryParameterItem", + "v2.secret_rule_array" => "SecretRuleArray", + "v2.secret_rule_data" => "SecretRuleData", + "v2.secret_rule_data_attributes" => "SecretRuleDataAttributes", + "v2.secret_rule_data_attributes_match_validation" => "SecretRuleDataAttributesMatchValidation", + "v2.secret_rule_data_attributes_match_validation_invalid_http_status_code_items" => "SecretRuleDataAttributesMatchValidationInvalidHttpStatusCodeItems", + "v2.secret_rule_data_attributes_match_validation_valid_http_status_code_items" => "SecretRuleDataAttributesMatchValidationValidHttpStatusCodeItems", + "v2.secret_rule_data_type" => "SecretRuleDataType", "v2.security_filter" => "SecurityFilter", "v2.security_filter_attributes" => "SecurityFilterAttributes", "v2.security_filter_create_attributes" => "SecurityFilterCreateAttributes", diff --git a/lib/datadog_api_client/v2/api/security_monitoring_api.rb b/lib/datadog_api_client/v2/api/security_monitoring_api.rb index e970d68446c..7aba8f848f7 100644 --- a/lib/datadog_api_client/v2/api/security_monitoring_api.rb +++ b/lib/datadog_api_client/v2/api/security_monitoring_api.rb @@ -1765,6 +1765,72 @@ def get_sbom_with_http_info(asset_type, filter_asset_name, opts = {}) return data, status_code, headers end + # Returns list of Secrets rules. + # + # @see #get_secrets_rules_with_http_info + def get_secrets_rules(opts = {}) + data, _status_code, _headers = get_secrets_rules_with_http_info(opts) + data + end + + # Returns list of Secrets rules. + # + # Returns list of Secrets rules with ID, Pattern, Description, Priority, and SDS ID + # + # @param opts [Hash] the optional parameters + # @return [Array<(SecretRuleArray, Integer, Hash)>] SecretRuleArray data, response status code and response headers + def get_secrets_rules_with_http_info(opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.get_secrets_rules".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_secrets_rules") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_secrets_rules")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.get_secrets_rules ...' + end + # resource path + local_var_path = '/api/v2/static-analysis/secrets/rules' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'SecretRuleArray' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :get_secrets_rules, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SecurityMonitoringAPI#get_secrets_rules\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Get a security filter. # # @see #get_security_filter_with_http_info @@ -2925,6 +2991,79 @@ def list_findings_with_pagination(opts = {}) end end + # Ruleset get multiple. + # + # @see #list_multiple_rulesets_with_http_info + def list_multiple_rulesets(body, opts = {}) + data, _status_code, _headers = list_multiple_rulesets_with_http_info(body, opts) + data + end + + # Ruleset get multiple. + # + # Get rules for multiple rulesets in batch. + # + # @param body [GetMultipleRulesetsRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(GetMultipleRulesetsResponse, Integer, Hash)>] GetMultipleRulesetsResponse data, response status code and response headers + def list_multiple_rulesets_with_http_info(body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.list_multiple_rulesets".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_multiple_rulesets") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_multiple_rulesets")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.list_multiple_rulesets ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling SecurityMonitoringAPI.list_multiple_rulesets" + end + # resource path + local_var_path = '/api/v2/static-analysis/rulesets' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'GetMultipleRulesetsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :list_multiple_rulesets, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SecurityMonitoringAPI#list_multiple_rulesets\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # List scanned assets metadata. # # @see #list_scanned_assets_metadata_with_http_info diff --git a/lib/datadog_api_client/v2/models/get_multiple_rulesets_request.rb b/lib/datadog_api_client/v2/models/get_multiple_rulesets_request.rb new file mode 100644 index 00000000000..d8bcda85f02 --- /dev/null +++ b/lib/datadog_api_client/v2/models/get_multiple_rulesets_request.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # + class GetMultipleRulesetsRequest + include BaseGenericModel + + # + attr_accessor :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'GetMultipleRulesetsRequestData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::GetMultipleRulesetsRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/get_multiple_rulesets_request_data.rb b/lib/datadog_api_client/v2/models/get_multiple_rulesets_request_data.rb new file mode 100644 index 00000000000..9f7d282c8a1 --- /dev/null +++ b/lib/datadog_api_client/v2/models/get_multiple_rulesets_request_data.rb @@ -0,0 +1,143 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # + class GetMultipleRulesetsRequestData + include BaseGenericModel + + # + attr_accessor :attributes + + # + attr_accessor :id + + # Get multiple rulesets request resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'GetMultipleRulesetsRequestDataAttributes', + :'id' => :'String', + :'type' => :'GetMultipleRulesetsRequestDataType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::GetMultipleRulesetsRequestData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/get_multiple_rulesets_request_data_attributes.rb b/lib/datadog_api_client/v2/models/get_multiple_rulesets_request_data_attributes.rb new file mode 100644 index 00000000000..2aaf6108e02 --- /dev/null +++ b/lib/datadog_api_client/v2/models/get_multiple_rulesets_request_data_attributes.rb @@ -0,0 +1,127 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # + class GetMultipleRulesetsRequestDataAttributes + include BaseGenericModel + + # + attr_accessor :include_testing_rules + + # + attr_accessor :include_tests + + # + attr_accessor :rulesets + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'include_testing_rules' => :'include_testing_rules', + :'include_tests' => :'include_tests', + :'rulesets' => :'rulesets' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'include_testing_rules' => :'Boolean', + :'include_tests' => :'Boolean', + :'rulesets' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::GetMultipleRulesetsRequestDataAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'include_testing_rules') + self.include_testing_rules = attributes[:'include_testing_rules'] + end + + if attributes.key?(:'include_tests') + self.include_tests = attributes[:'include_tests'] + end + + if attributes.key?(:'rulesets') + if (value = attributes[:'rulesets']).is_a?(Array) + self.rulesets = value + end + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + include_testing_rules == o.include_testing_rules && + include_tests == o.include_tests && + rulesets == o.rulesets && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [include_testing_rules, include_tests, rulesets, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/get_multiple_rulesets_request_data_type.rb b/lib/datadog_api_client/v2/models/get_multiple_rulesets_request_data_type.rb new file mode 100644 index 00000000000..b80ddc83f85 --- /dev/null +++ b/lib/datadog_api_client/v2/models/get_multiple_rulesets_request_data_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Get multiple rulesets request resource type. + class GetMultipleRulesetsRequestDataType + include BaseEnumModel + + GET_MULTIPLE_RULESETS_REQUEST = "get_multiple_rulesets_request".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/get_multiple_rulesets_response.rb b/lib/datadog_api_client/v2/models/get_multiple_rulesets_response.rb new file mode 100644 index 00000000000..4a0936ffcb5 --- /dev/null +++ b/lib/datadog_api_client/v2/models/get_multiple_rulesets_response.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # + class GetMultipleRulesetsResponse + include BaseGenericModel + + # + attr_accessor :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'GetMultipleRulesetsResponseData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::GetMultipleRulesetsResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/get_multiple_rulesets_response_data.rb b/lib/datadog_api_client/v2/models/get_multiple_rulesets_response_data.rb new file mode 100644 index 00000000000..04723842919 --- /dev/null +++ b/lib/datadog_api_client/v2/models/get_multiple_rulesets_response_data.rb @@ -0,0 +1,143 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # + class GetMultipleRulesetsResponseData + include BaseGenericModel + + # + attr_accessor :attributes + + # + attr_accessor :id + + # Get multiple rulesets response resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'GetMultipleRulesetsResponseDataAttributes', + :'id' => :'String', + :'type' => :'GetMultipleRulesetsResponseDataType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::GetMultipleRulesetsResponseData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/get_multiple_rulesets_response_data_attributes.rb b/lib/datadog_api_client/v2/models/get_multiple_rulesets_response_data_attributes.rb new file mode 100644 index 00000000000..f1d9aa505cc --- /dev/null +++ b/lib/datadog_api_client/v2/models/get_multiple_rulesets_response_data_attributes.rb @@ -0,0 +1,107 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # + class GetMultipleRulesetsResponseDataAttributes + include BaseGenericModel + + # + attr_accessor :rulesets + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'rulesets' => :'rulesets' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'rulesets' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::GetMultipleRulesetsResponseDataAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'rulesets') + if (value = attributes[:'rulesets']).is_a?(Array) + self.rulesets = value + end + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + rulesets == o.rulesets && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [rulesets, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/get_multiple_rulesets_response_data_attributes_rulesets_items.rb b/lib/datadog_api_client/v2/models/get_multiple_rulesets_response_data_attributes_rulesets_items.rb new file mode 100644 index 00000000000..7ba97bef90a --- /dev/null +++ b/lib/datadog_api_client/v2/models/get_multiple_rulesets_response_data_attributes_rulesets_items.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # + class GetMultipleRulesetsResponseDataAttributesRulesetsItems + include BaseGenericModel + + # + attr_reader :data + + # + attr_accessor :description + + # + attr_accessor :name + + # + attr_accessor :rules + + # + attr_accessor :short_description + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data', + :'description' => :'description', + :'name' => :'name', + :'rules' => :'rules', + :'short_description' => :'short_description' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'GetMultipleRulesetsResponseDataAttributesRulesetsItemsData', + :'description' => :'String', + :'name' => :'String', + :'rules' => :'Array', + :'short_description' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::GetMultipleRulesetsResponseDataAttributesRulesetsItems` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'rules') + if (value = attributes[:'rules']).is_a?(Array) + self.rules = value + end + end + + if attributes.key?(:'short_description') + self.short_description = attributes[:'short_description'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + description == o.description && + name == o.name && + rules == o.rules && + short_description == o.short_description && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, description, name, rules, short_description, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/get_multiple_rulesets_response_data_attributes_rulesets_items_data.rb b/lib/datadog_api_client/v2/models/get_multiple_rulesets_response_data_attributes_rulesets_items_data.rb new file mode 100644 index 00000000000..456d97388a8 --- /dev/null +++ b/lib/datadog_api_client/v2/models/get_multiple_rulesets_response_data_attributes_rulesets_items_data.rb @@ -0,0 +1,133 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # + class GetMultipleRulesetsResponseDataAttributesRulesetsItemsData + include BaseGenericModel + + # + attr_accessor :id + + # Rulesets resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'id' => :'String', + :'type' => :'GetMultipleRulesetsResponseDataAttributesRulesetsItemsDataType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::GetMultipleRulesetsResponseDataAttributesRulesetsItemsData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/get_multiple_rulesets_response_data_attributes_rulesets_items_data_type.rb b/lib/datadog_api_client/v2/models/get_multiple_rulesets_response_data_attributes_rulesets_items_data_type.rb new file mode 100644 index 00000000000..a2a3d4b975c --- /dev/null +++ b/lib/datadog_api_client/v2/models/get_multiple_rulesets_response_data_attributes_rulesets_items_data_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Rulesets resource type. + class GetMultipleRulesetsResponseDataAttributesRulesetsItemsDataType + include BaseEnumModel + + RULESETS = "rulesets".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/get_multiple_rulesets_response_data_attributes_rulesets_items_rules_items.rb b/lib/datadog_api_client/v2/models/get_multiple_rulesets_response_data_attributes_rulesets_items_rules_items.rb new file mode 100644 index 00000000000..439088fae57 --- /dev/null +++ b/lib/datadog_api_client/v2/models/get_multiple_rulesets_response_data_attributes_rulesets_items_rules_items.rb @@ -0,0 +1,367 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # + class GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItems + include BaseGenericModel + + # + attr_accessor :arguments + + # + attr_accessor :category + + # + attr_accessor :checksum + + # + attr_accessor :code + + # + attr_accessor :created_at + + # + attr_accessor :created_by + + # + attr_accessor :cve + + # + attr_accessor :cwe + + # + attr_reader :data + + # + attr_accessor :description + + # + attr_accessor :documentation_url + + # + attr_accessor :entity_checked + + # + attr_accessor :is_published + + # + attr_accessor :is_testing + + # + attr_accessor :language + + # + attr_accessor :last_updated_at + + # + attr_accessor :last_updated_by + + # + attr_accessor :name + + # + attr_accessor :regex + + # + attr_accessor :severity + + # + attr_accessor :short_description + + # + attr_accessor :should_use_ai_fix + + # + attr_accessor :tests + + # + attr_accessor :tree_sitter_query + + # + attr_accessor :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'arguments' => :'arguments', + :'category' => :'category', + :'checksum' => :'checksum', + :'code' => :'code', + :'created_at' => :'created_at', + :'created_by' => :'created_by', + :'cve' => :'cve', + :'cwe' => :'cwe', + :'data' => :'data', + :'description' => :'description', + :'documentation_url' => :'documentation_url', + :'entity_checked' => :'entity_checked', + :'is_published' => :'is_published', + :'is_testing' => :'is_testing', + :'language' => :'language', + :'last_updated_at' => :'last_updated_at', + :'last_updated_by' => :'last_updated_by', + :'name' => :'name', + :'regex' => :'regex', + :'severity' => :'severity', + :'short_description' => :'short_description', + :'should_use_ai_fix' => :'should_use_ai_fix', + :'tests' => :'tests', + :'tree_sitter_query' => :'tree_sitter_query', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'arguments' => :'Array', + :'category' => :'String', + :'checksum' => :'String', + :'code' => :'String', + :'created_at' => :'Time', + :'created_by' => :'String', + :'cve' => :'String', + :'cwe' => :'String', + :'data' => :'GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsData', + :'description' => :'String', + :'documentation_url' => :'String', + :'entity_checked' => :'String', + :'is_published' => :'Boolean', + :'is_testing' => :'Boolean', + :'language' => :'String', + :'last_updated_at' => :'Time', + :'last_updated_by' => :'String', + :'name' => :'String', + :'regex' => :'String', + :'severity' => :'String', + :'short_description' => :'String', + :'should_use_ai_fix' => :'Boolean', + :'tests' => :'Array', + :'tree_sitter_query' => :'String', + :'type' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItems` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'arguments') + if (value = attributes[:'arguments']).is_a?(Array) + self.arguments = value + end + end + + if attributes.key?(:'category') + self.category = attributes[:'category'] + end + + if attributes.key?(:'checksum') + self.checksum = attributes[:'checksum'] + end + + if attributes.key?(:'code') + self.code = attributes[:'code'] + end + + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.key?(:'created_by') + self.created_by = attributes[:'created_by'] + end + + if attributes.key?(:'cve') + self.cve = attributes[:'cve'] + end + + if attributes.key?(:'cwe') + self.cwe = attributes[:'cwe'] + end + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'documentation_url') + self.documentation_url = attributes[:'documentation_url'] + end + + if attributes.key?(:'entity_checked') + self.entity_checked = attributes[:'entity_checked'] + end + + if attributes.key?(:'is_published') + self.is_published = attributes[:'is_published'] + end + + if attributes.key?(:'is_testing') + self.is_testing = attributes[:'is_testing'] + end + + if attributes.key?(:'language') + self.language = attributes[:'language'] + end + + if attributes.key?(:'last_updated_at') + self.last_updated_at = attributes[:'last_updated_at'] + end + + if attributes.key?(:'last_updated_by') + self.last_updated_by = attributes[:'last_updated_by'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'regex') + self.regex = attributes[:'regex'] + end + + if attributes.key?(:'severity') + self.severity = attributes[:'severity'] + end + + if attributes.key?(:'short_description') + self.short_description = attributes[:'short_description'] + end + + if attributes.key?(:'should_use_ai_fix') + self.should_use_ai_fix = attributes[:'should_use_ai_fix'] + end + + if attributes.key?(:'tests') + if (value = attributes[:'tests']).is_a?(Array) + self.tests = value + end + end + + if attributes.key?(:'tree_sitter_query') + self.tree_sitter_query = attributes[:'tree_sitter_query'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + arguments == o.arguments && + category == o.category && + checksum == o.checksum && + code == o.code && + created_at == o.created_at && + created_by == o.created_by && + cve == o.cve && + cwe == o.cwe && + data == o.data && + description == o.description && + documentation_url == o.documentation_url && + entity_checked == o.entity_checked && + is_published == o.is_published && + is_testing == o.is_testing && + language == o.language && + last_updated_at == o.last_updated_at && + last_updated_by == o.last_updated_by && + name == o.name && + regex == o.regex && + severity == o.severity && + short_description == o.short_description && + should_use_ai_fix == o.should_use_ai_fix && + tests == o.tests && + tree_sitter_query == o.tree_sitter_query && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [arguments, category, checksum, code, created_at, created_by, cve, cwe, data, description, documentation_url, entity_checked, is_published, is_testing, language, last_updated_at, last_updated_by, name, regex, severity, short_description, should_use_ai_fix, tests, tree_sitter_query, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/get_multiple_rulesets_response_data_attributes_rulesets_items_rules_items_arguments_items.rb b/lib/datadog_api_client/v2/models/get_multiple_rulesets_response_data_attributes_rulesets_items_rules_items_arguments_items.rb new file mode 100644 index 00000000000..7a171e8a445 --- /dev/null +++ b/lib/datadog_api_client/v2/models/get_multiple_rulesets_response_data_attributes_rulesets_items_rules_items_arguments_items.rb @@ -0,0 +1,115 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # + class GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsArgumentsItems + include BaseGenericModel + + # + attr_accessor :description + + # + attr_accessor :name + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'description' => :'description', + :'name' => :'name' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'description' => :'String', + :'name' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsArgumentsItems` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + description == o.description && + name == o.name && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [description, name, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/get_multiple_rulesets_response_data_attributes_rulesets_items_rules_items_data.rb b/lib/datadog_api_client/v2/models/get_multiple_rulesets_response_data_attributes_rulesets_items_rules_items_data.rb new file mode 100644 index 00000000000..a83c8d7f18a --- /dev/null +++ b/lib/datadog_api_client/v2/models/get_multiple_rulesets_response_data_attributes_rulesets_items_rules_items_data.rb @@ -0,0 +1,133 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # + class GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsData + include BaseGenericModel + + # + attr_accessor :id + + # Rules resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'id' => :'String', + :'type' => :'GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsDataType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/get_multiple_rulesets_response_data_attributes_rulesets_items_rules_items_data_type.rb b/lib/datadog_api_client/v2/models/get_multiple_rulesets_response_data_attributes_rulesets_items_rules_items_data_type.rb new file mode 100644 index 00000000000..f107b68ec81 --- /dev/null +++ b/lib/datadog_api_client/v2/models/get_multiple_rulesets_response_data_attributes_rulesets_items_rules_items_data_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Rules resource type. + class GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsDataType + include BaseEnumModel + + RULES = "rules".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/get_multiple_rulesets_response_data_attributes_rulesets_items_rules_items_tests_items.rb b/lib/datadog_api_client/v2/models/get_multiple_rulesets_response_data_attributes_rulesets_items_rules_items_tests_items.rb new file mode 100644 index 00000000000..92d010220de --- /dev/null +++ b/lib/datadog_api_client/v2/models/get_multiple_rulesets_response_data_attributes_rulesets_items_rules_items_tests_items.rb @@ -0,0 +1,147 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # + class GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsTestsItems + include BaseGenericModel + + # + attr_reader :annotation_count + + # + attr_accessor :code + + # + attr_accessor :filename + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'annotation_count' => :'annotation_count', + :'code' => :'code', + :'filename' => :'filename' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'annotation_count' => :'Integer', + :'code' => :'String', + :'filename' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItemsTestsItems` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'annotation_count') + self.annotation_count = attributes[:'annotation_count'] + end + + if attributes.key?(:'code') + self.code = attributes[:'code'] + end + + if attributes.key?(:'filename') + self.filename = attributes[:'filename'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if !@annotation_count.nil? && @annotation_count > 65535 + return false if !@annotation_count.nil? && @annotation_count < 0 + true + end + + # Custom attribute writer method with validation + # @param annotation_count [Object] Object to be assigned + # @!visibility private + def annotation_count=(annotation_count) + if !annotation_count.nil? && annotation_count > 65535 + fail ArgumentError, 'invalid value for "annotation_count", must be smaller than or equal to 65535.' + end + if !annotation_count.nil? && annotation_count < 0 + fail ArgumentError, 'invalid value for "annotation_count", must be greater than or equal to 0.' + end + @annotation_count = annotation_count + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + annotation_count == o.annotation_count && + code == o.code && + filename == o.filename && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [annotation_count, code, filename, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/get_multiple_rulesets_response_data_type.rb b/lib/datadog_api_client/v2/models/get_multiple_rulesets_response_data_type.rb new file mode 100644 index 00000000000..d18f7936eec --- /dev/null +++ b/lib/datadog_api_client/v2/models/get_multiple_rulesets_response_data_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Get multiple rulesets response resource type. + class GetMultipleRulesetsResponseDataType + include BaseEnumModel + + GET_MULTIPLE_RULESETS_RESPONSE = "get_multiple_rulesets_response".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/secret_rule_array.rb b/lib/datadog_api_client/v2/models/secret_rule_array.rb new file mode 100644 index 00000000000..12a62ab3815 --- /dev/null +++ b/lib/datadog_api_client/v2/models/secret_rule_array.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # + class SecretRuleArray + include BaseGenericModel + + # + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SecretRuleArray` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/secret_rule_data.rb b/lib/datadog_api_client/v2/models/secret_rule_data.rb new file mode 100644 index 00000000000..3b36400aa43 --- /dev/null +++ b/lib/datadog_api_client/v2/models/secret_rule_data.rb @@ -0,0 +1,143 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # + class SecretRuleData + include BaseGenericModel + + # + attr_accessor :attributes + + # + attr_accessor :id + + # Secret rule resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'SecretRuleDataAttributes', + :'id' => :'String', + :'type' => :'SecretRuleDataType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SecretRuleData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/secret_rule_data_attributes.rb b/lib/datadog_api_client/v2/models/secret_rule_data_attributes.rb new file mode 100644 index 00000000000..d2fb19f9e53 --- /dev/null +++ b/lib/datadog_api_client/v2/models/secret_rule_data_attributes.rb @@ -0,0 +1,189 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # + class SecretRuleDataAttributes + include BaseGenericModel + + # + attr_accessor :default_included_keywords + + # + attr_accessor :description + + # + attr_accessor :license + + # + attr_accessor :match_validation + + # + attr_accessor :name + + # + attr_accessor :pattern + + # + attr_accessor :priority + + # + attr_accessor :sds_id + + # + attr_accessor :validators + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'default_included_keywords' => :'default_included_keywords', + :'description' => :'description', + :'license' => :'license', + :'match_validation' => :'match_validation', + :'name' => :'name', + :'pattern' => :'pattern', + :'priority' => :'priority', + :'sds_id' => :'sds_id', + :'validators' => :'validators' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'default_included_keywords' => :'Array', + :'description' => :'String', + :'license' => :'String', + :'match_validation' => :'SecretRuleDataAttributesMatchValidation', + :'name' => :'String', + :'pattern' => :'String', + :'priority' => :'String', + :'sds_id' => :'String', + :'validators' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SecretRuleDataAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'default_included_keywords') + if (value = attributes[:'default_included_keywords']).is_a?(Array) + self.default_included_keywords = value + end + end + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'license') + self.license = attributes[:'license'] + end + + if attributes.key?(:'match_validation') + self.match_validation = attributes[:'match_validation'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'pattern') + self.pattern = attributes[:'pattern'] + end + + if attributes.key?(:'priority') + self.priority = attributes[:'priority'] + end + + if attributes.key?(:'sds_id') + self.sds_id = attributes[:'sds_id'] + end + + if attributes.key?(:'validators') + if (value = attributes[:'validators']).is_a?(Array) + self.validators = value + end + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + default_included_keywords == o.default_included_keywords && + description == o.description && + license == o.license && + match_validation == o.match_validation && + name == o.name && + pattern == o.pattern && + priority == o.priority && + sds_id == o.sds_id && + validators == o.validators && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [default_included_keywords, description, license, match_validation, name, pattern, priority, sds_id, validators, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/secret_rule_data_attributes_match_validation.rb b/lib/datadog_api_client/v2/models/secret_rule_data_attributes_match_validation.rb new file mode 100644 index 00000000000..764c3c2de98 --- /dev/null +++ b/lib/datadog_api_client/v2/models/secret_rule_data_attributes_match_validation.rb @@ -0,0 +1,203 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # + class SecretRuleDataAttributesMatchValidation + include BaseGenericModel + + # + attr_accessor :endpoint + + # + attr_accessor :hosts + + # + attr_accessor :http_method + + # + attr_accessor :invalid_http_status_code + + # + attr_accessor :request_headers + + # + attr_reader :timeout_seconds + + # + attr_accessor :type + + # + attr_accessor :valid_http_status_code + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'endpoint' => :'endpoint', + :'hosts' => :'hosts', + :'http_method' => :'http_method', + :'invalid_http_status_code' => :'invalid_http_status_code', + :'request_headers' => :'request_headers', + :'timeout_seconds' => :'timeout_seconds', + :'type' => :'type', + :'valid_http_status_code' => :'valid_http_status_code' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'endpoint' => :'String', + :'hosts' => :'Array', + :'http_method' => :'String', + :'invalid_http_status_code' => :'Array', + :'request_headers' => :'Hash', + :'timeout_seconds' => :'Integer', + :'type' => :'String', + :'valid_http_status_code' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SecretRuleDataAttributesMatchValidation` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'endpoint') + self.endpoint = attributes[:'endpoint'] + end + + if attributes.key?(:'hosts') + if (value = attributes[:'hosts']).is_a?(Array) + self.hosts = value + end + end + + if attributes.key?(:'http_method') + self.http_method = attributes[:'http_method'] + end + + if attributes.key?(:'invalid_http_status_code') + if (value = attributes[:'invalid_http_status_code']).is_a?(Array) + self.invalid_http_status_code = value + end + end + + if attributes.key?(:'request_headers') + self.request_headers = attributes[:'request_headers'] + end + + if attributes.key?(:'timeout_seconds') + self.timeout_seconds = attributes[:'timeout_seconds'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'valid_http_status_code') + if (value = attributes[:'valid_http_status_code']).is_a?(Array) + self.valid_http_status_code = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if !@timeout_seconds.nil? && @timeout_seconds > 1.8446744073709552e+19 + return false if !@timeout_seconds.nil? && @timeout_seconds < 0 + true + end + + # Custom attribute writer method with validation + # @param timeout_seconds [Object] Object to be assigned + # @!visibility private + def timeout_seconds=(timeout_seconds) + if !timeout_seconds.nil? && timeout_seconds > 1.8446744073709552e+19 + fail ArgumentError, 'invalid value for "timeout_seconds", must be smaller than or equal to 1.8446744073709552e+19.' + end + if !timeout_seconds.nil? && timeout_seconds < 0 + fail ArgumentError, 'invalid value for "timeout_seconds", must be greater than or equal to 0.' + end + @timeout_seconds = timeout_seconds + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + endpoint == o.endpoint && + hosts == o.hosts && + http_method == o.http_method && + invalid_http_status_code == o.invalid_http_status_code && + request_headers == o.request_headers && + timeout_seconds == o.timeout_seconds && + type == o.type && + valid_http_status_code == o.valid_http_status_code && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [endpoint, hosts, http_method, invalid_http_status_code, request_headers, timeout_seconds, type, valid_http_status_code, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/secret_rule_data_attributes_match_validation_invalid_http_status_code_items.rb b/lib/datadog_api_client/v2/models/secret_rule_data_attributes_match_validation_invalid_http_status_code_items.rb new file mode 100644 index 00000000000..596247d07ca --- /dev/null +++ b/lib/datadog_api_client/v2/models/secret_rule_data_attributes_match_validation_invalid_http_status_code_items.rb @@ -0,0 +1,152 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # + class SecretRuleDataAttributesMatchValidationInvalidHttpStatusCodeItems + include BaseGenericModel + + # + attr_reader :_end + + # + attr_reader :start + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'_end' => :'end', + :'start' => :'start' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'_end' => :'Integer', + :'start' => :'Integer' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SecretRuleDataAttributesMatchValidationInvalidHttpStatusCodeItems` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'_end') + self._end = attributes[:'_end'] + end + + if attributes.key?(:'start') + self.start = attributes[:'start'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if !@_end.nil? && @_end > 1.8446744073709552e+19 + return false if !@_end.nil? && @_end < 0 + return false if !@start.nil? && @start > 1.8446744073709552e+19 + return false if !@start.nil? && @start < 0 + true + end + + # Custom attribute writer method with validation + # @param _end [Object] Object to be assigned + # @!visibility private + def _end=(_end) + if !_end.nil? && _end > 1.8446744073709552e+19 + fail ArgumentError, 'invalid value for "_end", must be smaller than or equal to 1.8446744073709552e+19.' + end + if !_end.nil? && _end < 0 + fail ArgumentError, 'invalid value for "_end", must be greater than or equal to 0.' + end + @_end = _end + end + + # Custom attribute writer method with validation + # @param start [Object] Object to be assigned + # @!visibility private + def start=(start) + if !start.nil? && start > 1.8446744073709552e+19 + fail ArgumentError, 'invalid value for "start", must be smaller than or equal to 1.8446744073709552e+19.' + end + if !start.nil? && start < 0 + fail ArgumentError, 'invalid value for "start", must be greater than or equal to 0.' + end + @start = start + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + _end == o._end && + start == o.start && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [_end, start, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/secret_rule_data_attributes_match_validation_valid_http_status_code_items.rb b/lib/datadog_api_client/v2/models/secret_rule_data_attributes_match_validation_valid_http_status_code_items.rb new file mode 100644 index 00000000000..ddfb5d0c92d --- /dev/null +++ b/lib/datadog_api_client/v2/models/secret_rule_data_attributes_match_validation_valid_http_status_code_items.rb @@ -0,0 +1,152 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # + class SecretRuleDataAttributesMatchValidationValidHttpStatusCodeItems + include BaseGenericModel + + # + attr_reader :_end + + # + attr_reader :start + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'_end' => :'end', + :'start' => :'start' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'_end' => :'Integer', + :'start' => :'Integer' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SecretRuleDataAttributesMatchValidationValidHttpStatusCodeItems` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'_end') + self._end = attributes[:'_end'] + end + + if attributes.key?(:'start') + self.start = attributes[:'start'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if !@_end.nil? && @_end > 1.8446744073709552e+19 + return false if !@_end.nil? && @_end < 0 + return false if !@start.nil? && @start > 1.8446744073709552e+19 + return false if !@start.nil? && @start < 0 + true + end + + # Custom attribute writer method with validation + # @param _end [Object] Object to be assigned + # @!visibility private + def _end=(_end) + if !_end.nil? && _end > 1.8446744073709552e+19 + fail ArgumentError, 'invalid value for "_end", must be smaller than or equal to 1.8446744073709552e+19.' + end + if !_end.nil? && _end < 0 + fail ArgumentError, 'invalid value for "_end", must be greater than or equal to 0.' + end + @_end = _end + end + + # Custom attribute writer method with validation + # @param start [Object] Object to be assigned + # @!visibility private + def start=(start) + if !start.nil? && start > 1.8446744073709552e+19 + fail ArgumentError, 'invalid value for "start", must be smaller than or equal to 1.8446744073709552e+19.' + end + if !start.nil? && start < 0 + fail ArgumentError, 'invalid value for "start", must be greater than or equal to 0.' + end + @start = start + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + _end == o._end && + start == o.start && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [_end, start, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/secret_rule_data_type.rb b/lib/datadog_api_client/v2/models/secret_rule_data_type.rb new file mode 100644 index 00000000000..8e651c35482 --- /dev/null +++ b/lib/datadog_api_client/v2/models/secret_rule_data_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Secret rule resource type. + class SecretRuleDataType + include BaseEnumModel + + SECRET_RULE = "secret_rule".freeze + end +end