diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 25ad70c2815c..85d8f9a15af5 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -1493,6 +1493,13 @@ components: required: true schema: type: string + SampleLogGenerationContentPackID: + description: The identifier of the Cloud SIEM content pack to operate on (for example, `aws-cloudtrail`). + in: path + name: content_pack_id + required: true + schema: + type: string SchemaVersion: description: The schema version desired in the response. in: query @@ -1532,6 +1539,13 @@ components: required: true schema: type: string + SecurityMonitoringIntegrationConfigID: + description: The ID of the entity context sync configuration. + in: path + name: integration_config_id + required: true + schema: + type: string SecurityMonitoringRuleID: description: The ID of the rule. in: path @@ -26913,6 +26927,101 @@ components: type: string type: array type: object + EntityContextEntity: + description: A single entity returned by the entity context endpoint. + properties: + attributes: + $ref: "#/components/schemas/EntityContextEntityAttributes" + id: + description: The unique identifier of the entity. + example: user@example.com + type: string + type: + $ref: "#/components/schemas/SecurityMonitoringEntityContextEntityType" + required: + - id + - type + - attributes + type: object + EntityContextEntityAttributes: + description: The attributes of an entity context entry, grouping all the historical revisions of the entity. + properties: + revisions: + description: The historical revisions of the entity, ordered chronologically. + items: + $ref: "#/components/schemas/EntityContextRevision" + type: array + required: + - revisions + type: object + EntityContextPage: + description: Pagination metadata for the entity context response. + properties: + next_token: + description: An opaque token to pass as `page_token` in a subsequent request to retrieve the next page of results. Empty when there are no more results. + example: "" + type: string + required: + - next_token + type: object + EntityContextResponse: + description: Response from the entity context endpoint, containing the matching entities and pagination metadata. + properties: + data: + description: The list of entities matching the query. + items: + $ref: "#/components/schemas/EntityContextEntity" + type: array + meta: + $ref: "#/components/schemas/EntityContextResponseMeta" + required: + - data + - meta + type: object + EntityContextResponseMeta: + description: Metadata returned alongside the entity context response. + properties: + page: + $ref: "#/components/schemas/EntityContextPage" + total_count: + description: The total number of entities matching the query, irrespective of pagination. + example: 1 + format: int32 + maximum: 2147483647 + type: integer + required: + - page + - total_count + type: object + EntityContextRevision: + description: A single historical revision of an entity, including the time range during which the revision was observed. + properties: + attributes: + $ref: "#/components/schemas/EntityContextRevisionAttributes" + first_seen_at: + description: The first time the entity was observed at this revision. + example: "2026-04-01T00:00:00Z" + format: date-time + type: string + last_seen_at: + description: The last time the entity was observed at this revision. + example: "2026-05-01T00:00:00Z" + format: date-time + type: string + required: + - attributes + - first_seen_at + - last_seen_at + type: object + EntityContextRevisionAttributes: + additionalProperties: {} + description: The set of attributes recorded for the entity at this revision. The keys depend on the kind of entity. + example: + display_name: Test User + emails: + - user@example.com + principal_id: user@example.com + type: object EntityData: description: Entity data. properties: @@ -67345,6 +67454,272 @@ components: example: "report_id" type: string type: object + SampleLogGenerationBulkSubscriptionAttributes: + description: The attributes for creating sample log generation subscriptions for multiple content packs. + properties: + content_pack_ids: + description: The identifiers of the Cloud SIEM content packs to subscribe to. At most five content packs can be requested in a single call. + example: + - aws-cloudtrail + items: + description: A Cloud SIEM content pack identifier. + type: string + maxItems: 5 + type: array + duration: + $ref: "#/components/schemas/SampleLogGenerationDuration" + required: + - content_pack_ids + type: object + SampleLogGenerationBulkSubscriptionData: + description: The bulk subscription request body. + properties: + attributes: + $ref: "#/components/schemas/SampleLogGenerationBulkSubscriptionAttributes" + type: + $ref: "#/components/schemas/SampleLogGenerationBulkSubscriptionRequestType" + required: + - type + - attributes + type: object + SampleLogGenerationBulkSubscriptionItemMeta: + description: Per-item status returned for a bulk subscription request. + properties: + error: + description: A description of the error encountered for this content pack, if the subscription could not be created. + example: content pack does not exist + type: string + status: + description: The HTTP status code that resulted from creating the subscription for this content pack. + example: 200 + format: int32 + maximum: 599 + type: integer + required: + - status + type: object + SampleLogGenerationBulkSubscriptionRequest: + description: Request body to create sample log generation subscriptions for multiple content packs at once. + properties: + data: + $ref: "#/components/schemas/SampleLogGenerationBulkSubscriptionData" + required: + - data + type: object + SampleLogGenerationBulkSubscriptionRequestType: + default: bulk_subscription_requests + description: The type of the resource. The value should always be `bulk_subscription_requests`. + enum: + - bulk_subscription_requests + example: bulk_subscription_requests + type: string + x-enum-varnames: + - BULK_SUBSCRIPTION_REQUESTS + SampleLogGenerationBulkSubscriptionResponse: + description: Response containing the per-content-pack results of a bulk subscription request. + properties: + data: + description: The list of bulk subscription results, one per requested content pack. + items: + $ref: "#/components/schemas/SampleLogGenerationBulkSubscriptionResultItem" + type: array + required: + - data + type: object + SampleLogGenerationBulkSubscriptionResultItem: + description: A single result entry returned by the bulk subscription endpoint. + properties: + attributes: + $ref: "#/components/schemas/SampleLogGenerationSubscriptionAttributes" + id: + description: The unique identifier of the subscription, when one was created. + example: "123" + type: string + meta: + $ref: "#/components/schemas/SampleLogGenerationBulkSubscriptionItemMeta" + type: + $ref: "#/components/schemas/SampleLogGenerationSubscriptionResourceType" + required: + - id + - type + - attributes + - meta + type: object + SampleLogGenerationDuration: + default: 3d + description: How long the subscription should remain active before expiring. + enum: + - 1h + - 1d + - 3d + - 7d + example: 3d + type: string + x-enum-varnames: + - ONE_HOUR + - ONE_DAY + - THREE_DAYS + - SEVEN_DAYS + SampleLogGenerationSubscriptionAttributes: + description: The attributes describing a sample log generation subscription. + properties: + content_pack_id: + description: The identifier of the Cloud SIEM content pack the subscription targets. + example: aws-cloudtrail + type: string + created_at: + description: The time at which the subscription was created. + example: "2026-05-08T20:02:13.77481Z" + format: date-time + type: string + expires_at: + description: The time at which the subscription expires and stops generating logs. + example: "2026-05-11T20:02:13.77481Z" + format: date-time + type: string + is_active: + description: Whether the subscription is currently active and generating logs. + example: true + type: boolean + status: + $ref: "#/components/schemas/SampleLogGenerationSubscriptionStatus" + required: + - content_pack_id + - status + - is_active + - created_at + - expires_at + type: object + SampleLogGenerationSubscriptionCreateAttributes: + description: The attributes for creating a sample log generation subscription. + properties: + content_pack_id: + description: The identifier of the Cloud SIEM content pack to subscribe to. + example: aws-cloudtrail + type: string + duration: + $ref: "#/components/schemas/SampleLogGenerationDuration" + required: + - content_pack_id + type: object + SampleLogGenerationSubscriptionCreateData: + description: The subscription request body. + properties: + attributes: + $ref: "#/components/schemas/SampleLogGenerationSubscriptionCreateAttributes" + type: + $ref: "#/components/schemas/SampleLogGenerationSubscriptionRequestType" + required: + - type + - attributes + type: object + SampleLogGenerationSubscriptionCreateRequest: + description: Request body to create a sample log generation subscription for a single content pack. + properties: + data: + $ref: "#/components/schemas/SampleLogGenerationSubscriptionCreateData" + required: + - data + type: object + SampleLogGenerationSubscriptionData: + description: A sample log generation subscription. + properties: + attributes: + $ref: "#/components/schemas/SampleLogGenerationSubscriptionAttributes" + id: + description: The unique identifier of the subscription. + example: "789" + type: string + type: + $ref: "#/components/schemas/SampleLogGenerationSubscriptionResourceType" + required: + - id + - type + - attributes + type: object + SampleLogGenerationSubscriptionRequestType: + default: subscription_requests + description: The type of the resource. The value should always be `subscription_requests`. + enum: + - subscription_requests + example: subscription_requests + type: string + x-enum-varnames: + - SUBSCRIPTION_REQUESTS + SampleLogGenerationSubscriptionResourceType: + default: subscriptions + description: The type of the resource. The value should always be `subscriptions`. + enum: + - subscriptions + example: subscriptions + type: string + x-enum-varnames: + - SUBSCRIPTIONS + SampleLogGenerationSubscriptionResponse: + description: Response containing a single sample log generation subscription. + properties: + data: + $ref: "#/components/schemas/SampleLogGenerationSubscriptionData" + required: + - data + type: object + SampleLogGenerationSubscriptionStatus: + description: The status of the subscription. + enum: + - subscribed + - renewed + - unsubscribed + - no_active_subscription + - not_available + - active + - expired + example: subscribed + type: string + x-enum-varnames: + - SUBSCRIBED + - RENEWED + - UNSUBSCRIBED + - NO_ACTIVE_SUBSCRIPTION + - NOT_AVAILABLE + - ACTIVE + - EXPIRED + SampleLogGenerationSubscriptionsResponse: + description: Response containing a list of sample log generation subscriptions. + properties: + data: + description: The list of sample log generation subscriptions. + items: + $ref: "#/components/schemas/SampleLogGenerationSubscriptionData" + type: array + meta: + $ref: "#/components/schemas/SampleLogGenerationSubscriptionsResponseMeta" + required: + - data + - meta + type: object + SampleLogGenerationSubscriptionsResponseMeta: + description: Metadata returned alongside a list of sample log generation subscriptions. + properties: + total_subscriptions: + description: The total number of subscriptions matching the request, irrespective of pagination. + example: 1 + format: int32 + maximum: 2147483647 + type: integer + required: + - total_subscriptions + type: object + SampleLogGenerationSubscriptionsStatusFilter: + default: active + description: Filter that controls whether to return only active subscriptions or every subscription on record. + enum: + - active + - all + example: active + type: string + x-enum-varnames: + - ACTIVE + - ALL ScaRequest: description: The top-level request object for submitting a Software Composition Analysis (SCA) scan result. properties: @@ -69725,6 +70100,112 @@ components: required: - data type: object + SecurityFilterVersion: + description: A snapshot of all security filters at a specific configuration version. + properties: + attributes: + $ref: "#/components/schemas/SecurityFilterVersionAttributes" + id: + description: The identifier of the configuration version. + example: "1" + type: string + type: + $ref: "#/components/schemas/SecurityFilterVersionType" + required: + - id + - type + - attributes + type: object + SecurityFilterVersionAttributes: + description: The attributes describing a single security filter configuration version. + properties: + date: + description: The Unix timestamp in milliseconds at which this configuration version was applied. + example: 1758177253469 + format: int64 + type: integer + filters: + description: The set of security filters at this configuration version. + items: + $ref: "#/components/schemas/SecurityFilterVersionEntry" + type: array + version: + description: The configuration version number. + example: 1 + format: int32 + maximum: 2147483647 + type: integer + required: + - version + - date + - filters + type: object + SecurityFilterVersionEntry: + description: A single security filter as it existed at a given configuration version. + properties: + exclusion_filters: + description: The list of exclusion filters applied in this security filter. + items: + $ref: "#/components/schemas/SecurityFilterExclusionFilterResponse" + type: array + filtered_data_type: + $ref: "#/components/schemas/SecurityFilterFilteredDataType" + id: + description: The ID of the security filter. + example: "123" + type: string + is_builtin: + description: Whether the security filter is the built-in filter. + example: false + type: boolean + is_enabled: + description: Whether the security filter is enabled. + example: true + type: boolean + name: + description: The name of the security filter. + example: Test Security Filter + type: string + query: + description: The query of the security filter. + example: source:test + type: string + version: + description: The version of this security filter. + example: 1 + format: int32 + maximum: 2147483647 + type: integer + required: + - id + - name + - version + - query + - is_enabled + - exclusion_filters + - filtered_data_type + - is_builtin + type: object + SecurityFilterVersionType: + default: security_filters_configuration + description: The type of the resource. The value should always be `security_filters_configuration`. + enum: + - security_filters_configuration + example: security_filters_configuration + type: string + x-enum-varnames: + - SECURITY_FILTERS_CONFIGURATION + SecurityFilterVersionsResponse: + description: Response containing the version history of security filters. + properties: + data: + description: A list of historical security filter configurations, ordered from the most recent to the oldest. + items: + $ref: "#/components/schemas/SecurityFilterVersion" + type: array + required: + - data + type: object SecurityFiltersResponse: description: All the available security filters objects. properties: @@ -70261,6 +70742,13 @@ components: $ref: "#/components/schemas/SecurityMonitoringCriticalAsset" type: array type: object + SecurityMonitoringEntityContextEntityType: + default: entity + description: |- + The type of the entity. Reflects the underlying entity kind from the entity context store + (for example, `siem_entity_identity` for identities). Defaults to `entity` when the kind is unknown. + example: siem_entity_identity + type: string SecurityMonitoringFilter: description: The rule's suppression filter. properties: @@ -70279,6 +70767,240 @@ components: x-enum-varnames: - REQUIRE - SUPPRESS + SecurityMonitoringIntegrationConfigAttributes: + description: The attributes of an entity context sync configuration as returned by the API. + properties: + created_at: + description: The time at which the entity context sync configuration was created. + example: "2026-05-01T12:00:00Z" + format: date-time + type: string + domain: + description: The domain associated with the external entity source (for example, the customer's identity provider domain). + example: siem-test.com + type: string + enabled: + description: Whether the sync is enabled and actively ingesting entities into Cloud SIEM. + example: true + type: boolean + integration_type: + $ref: "#/components/schemas/SecurityMonitoringIntegrationType" + modified_at: + description: The time at which the entity context sync configuration was last modified. + example: "2026-05-01T12:00:00Z" + format: date-time + type: string + name: + description: The display name of the entity context sync configuration. + example: My GWS Integration + type: string + settings: + $ref: "#/components/schemas/SecurityMonitoringIntegrationConfigSettings" + state: + $ref: "#/components/schemas/SecurityMonitoringIntegrationConfigState" + required: + - enabled + - domain + - integration_type + type: object + SecurityMonitoringIntegrationConfigCreateAttributes: + description: The attributes of the entity context sync configuration to create. + properties: + domain: + description: The domain associated with the external entity source. + example: siem-test.com + type: string + integration_type: + $ref: "#/components/schemas/SecurityMonitoringIntegrationType" + name: + description: The display name for the entity context sync configuration. + example: My GWS Integration + type: string + secrets: + $ref: "#/components/schemas/SecurityMonitoringIntegrationConfigSecrets" + settings: + $ref: "#/components/schemas/SecurityMonitoringIntegrationConfigSettings" + required: + - integration_type + - domain + - name + - secrets + type: object + SecurityMonitoringIntegrationConfigCreateData: + description: The entity context sync configuration to create. + properties: + attributes: + $ref: "#/components/schemas/SecurityMonitoringIntegrationConfigCreateAttributes" + type: + $ref: "#/components/schemas/SecurityMonitoringIntegrationConfigResourceType" + required: + - type + - attributes + type: object + SecurityMonitoringIntegrationConfigCreateRequest: + description: Request body to create an entity context sync configuration. + properties: + data: + $ref: "#/components/schemas/SecurityMonitoringIntegrationConfigCreateData" + required: + - data + type: object + SecurityMonitoringIntegrationConfigData: + description: An entity context sync configuration. + properties: + attributes: + $ref: "#/components/schemas/SecurityMonitoringIntegrationConfigAttributes" + id: + description: The unique identifier of the integration configuration. + example: 11111111-2222-3333-4444-555555555555 + type: string + type: + $ref: "#/components/schemas/SecurityMonitoringIntegrationConfigResourceType" + required: + - id + - type + - attributes + type: object + SecurityMonitoringIntegrationConfigResourceType: + default: integration_config + description: The type of the resource. The value should always be `integration_config`. + enum: + - integration_config + example: integration_config + type: string + x-enum-varnames: + - INTEGRATION_CONFIG + SecurityMonitoringIntegrationConfigResponse: + description: Response containing a single entity context sync configuration. + properties: + data: + $ref: "#/components/schemas/SecurityMonitoringIntegrationConfigData" + required: + - data + type: object + SecurityMonitoringIntegrationConfigSecrets: + additionalProperties: {} + description: The secrets used to authenticate against the external entity source. The accepted keys depend on the source type (for example, `admin_email` for Google Workspace). + example: + admin_email: test@example.com + type: object + SecurityMonitoringIntegrationConfigSettings: + additionalProperties: {} + description: Free-form, non-sensitive settings for the entity context sync. The accepted keys depend on the source type. + example: + setting1: value1 + type: object + SecurityMonitoringIntegrationConfigState: + description: The state of the credentials configured on the entity context sync. + enum: + - valid + - invalid + - initializing + example: valid + type: string + x-enum-varnames: + - VALID + - INVALID + - INITIALIZING + SecurityMonitoringIntegrationConfigUpdateAttributes: + description: Fields to update on the entity context sync configuration. All fields are optional. + properties: + domain: + description: The new domain associated with the external entity source. + example: siem-test.com + type: string + enabled: + description: Whether the entity context sync should be enabled. + example: true + type: boolean + integration_type: + $ref: "#/components/schemas/SecurityMonitoringIntegrationType" + name: + description: The new display name for the entity context sync configuration. + example: My GWS Integration (renamed) + type: string + secrets: + $ref: "#/components/schemas/SecurityMonitoringIntegrationConfigSecrets" + settings: + $ref: "#/components/schemas/SecurityMonitoringIntegrationConfigSettings" + type: object + SecurityMonitoringIntegrationConfigUpdateData: + description: The entity context sync configuration fields to update. + properties: + attributes: + $ref: "#/components/schemas/SecurityMonitoringIntegrationConfigUpdateAttributes" + type: + $ref: "#/components/schemas/SecurityMonitoringIntegrationConfigResourceType" + required: + - type + - attributes + type: object + SecurityMonitoringIntegrationConfigUpdateRequest: + description: Request body to update an entity context sync configuration. Supports partial updates. + properties: + data: + $ref: "#/components/schemas/SecurityMonitoringIntegrationConfigUpdateData" + required: + - data + type: object + SecurityMonitoringIntegrationConfigsResponse: + description: Response containing a list of entity context sync configurations. + properties: + data: + description: The list of integration configurations. + items: + $ref: "#/components/schemas/SecurityMonitoringIntegrationConfigData" + type: array + required: + - data + type: object + SecurityMonitoringIntegrationCredentialsValidateAttributes: + description: The credentials to validate against the external entity source. + properties: + domain: + description: The domain associated with the external entity source. + example: siem-test.com + type: string + integration_type: + $ref: "#/components/schemas/SecurityMonitoringIntegrationType" + secrets: + $ref: "#/components/schemas/SecurityMonitoringIntegrationConfigSecrets" + required: + - integration_type + - domain + - secrets + type: object + SecurityMonitoringIntegrationCredentialsValidateData: + description: The credentials to validate. + properties: + attributes: + $ref: "#/components/schemas/SecurityMonitoringIntegrationCredentialsValidateAttributes" + type: + $ref: "#/components/schemas/SecurityMonitoringIntegrationConfigResourceType" + required: + - type + - attributes + type: object + SecurityMonitoringIntegrationCredentialsValidateRequest: + description: Request body to validate credentials against an external entity source before creating a sync configuration. + properties: + data: + $ref: "#/components/schemas/SecurityMonitoringIntegrationCredentialsValidateData" + required: + - data + type: object + SecurityMonitoringIntegrationType: + description: The type of external source that provides entities to Cloud SIEM. + enum: + - GOOGLE_WORKSPACE + - OKTA + - ENTRA_ID + example: GOOGLE_WORKSPACE + type: string + x-enum-varnames: + - GOOGLE_WORKSPACE + - OKTA + - ENTRA_ID SecurityMonitoringListRulesResponse: description: List of rules. properties: @@ -75700,6 +76422,60 @@ components: description: Included data for shift operations. oneOf: - $ref: "#/components/schemas/ScheduleUser" + SignalEntitiesAttributes: + description: Attributes containing the entities related to the signal. + properties: + identities: + description: The identity entities related to the signal. Each item is a free-form object describing an identity (for example, a user or principal). + example: + - display_name: Test User + principal_id: user@example.com + items: + $ref: "#/components/schemas/SignalEntityIdentity" + type: array + required: + - identities + type: object + SignalEntitiesData: + description: Entities related to a security signal. + properties: + attributes: + $ref: "#/components/schemas/SignalEntitiesAttributes" + id: + description: The signal ID the entities are associated with. + example: AAAAAWgN8Xwgr1vKDQAAAABBV2dOOFh3ZzZobm1mWXJFYTR0OA + type: string + type: + $ref: "#/components/schemas/SignalEntitiesType" + required: + - id + - type + - attributes + type: object + SignalEntitiesResponse: + description: Response containing entities related to a security signal. + properties: + data: + $ref: "#/components/schemas/SignalEntitiesData" + required: + - data + type: object + SignalEntitiesType: + default: entities + description: The type of the resource. The value should always be `entities`. + enum: + - entities + example: entities + type: string + x-enum-varnames: + - ENTITIES + SignalEntityIdentity: + additionalProperties: {} + description: An identity entity related to a signal. The set of attributes is dynamic and depends on the source providing the identity. + example: + display_name: Test User + principal_id: user@example.com + type: object SimpleMonitorUserTemplate: description: A simplified version of a monitor user template. properties: @@ -90026,6 +90802,10 @@ components: incident_settings_read: View Incident Settings. incident_settings_write: Configure Incident Settings. incident_write: Create, view, and manage incidents in Datadog. + integrations_read: View configured integrations and their settings. + logs_modify_indexes: Modify log indexes, filters, exclusion filters, and configurations. + logs_read_index_data: Read indexed log data. + manage_integrations: Install, uninstall, and configure integrations. metrics_read: View custom metrics. monitors_downtime: Set downtimes to suppress alerts from any monitor in an organization. Mute and unmute monitors. The ability to write monitors is not required to set downtimes. monitors_read: View monitors. @@ -90046,6 +90826,7 @@ components: security_monitoring_suppressions_write: Write Rule Suppressions. security_pipelines_read: View Security Pipelines. security_pipelines_write: Create, edit, and delete CSM Security Pipelines. + siem_entities_read: View Cloud SIEM entities. slos_corrections: Apply, edit, and delete SLO status corrections. A user with this permission can make status corrections, even if they do not have permission to edit those SLOs. slos_read: View SLOs and status corrections. slos_write: Create, edit, and delete SLOs. @@ -142891,6 +143672,355 @@ paths: summary: Update a critical asset tags: - Security Monitoring + /api/v2/security_monitoring/configuration/integration_config: + get: + description: |- + List the entity context sync configurations for Cloud SIEM. Each configuration connects Cloud SIEM + to an external source that provides entities (for example, users from an identity provider) for use + in signals and the entity explorer. + operationId: ListSecurityMonitoringIntegrationConfigs + parameters: + - description: Filter the entity context sync configurations by source type. + in: query + name: filter[integration_type] + required: false + schema: + $ref: "#/components/schemas/SecurityMonitoringIntegrationType" + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + created_at: "2026-05-01T12:00:00Z" + domain: siem-test.com + enabled: true + integration_type: GOOGLE_WORKSPACE + modified_at: "2026-05-01T12:00:00Z" + name: My GWS Integration + settings: + setting1: value1 + state: valid + id: 11111111-2222-3333-4444-555555555555 + type: integration_config + schema: + $ref: "#/components/schemas/SecurityMonitoringIntegrationConfigsResponse" + description: OK + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - integrations_read + summary: List entity context sync configurations + tags: ["Security Monitoring"] + x-permission: + operator: OR + permissions: + - integrations_read + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + post: + description: |- + Create a new entity context sync configuration so Cloud SIEM can ingest entities from an external + source. The credentials provided in `secrets` are validated against the source before the configuration + is stored and never returned in subsequent responses. + operationId: CreateSecurityMonitoringIntegrationConfig + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + domain: siem-test.com + integration_type: GOOGLE_WORKSPACE + name: My GWS Integration + secrets: + admin_email: test@example.com + settings: + setting1: value1 + type: integration_config + schema: + $ref: "#/components/schemas/SecurityMonitoringIntegrationConfigCreateRequest" + description: The definition of the new integration configuration. + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + created_at: "2026-05-01T12:00:00Z" + domain: siem-test.com + enabled: true + integration_type: GOOGLE_WORKSPACE + modified_at: "2026-05-01T12:00:00Z" + name: My GWS Integration + settings: + setting1: value1 + id: 11111111-2222-3333-4444-555555555555 + type: integration_config + schema: + $ref: "#/components/schemas/SecurityMonitoringIntegrationConfigResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - manage_integrations + summary: Create an entity context sync configuration + tags: ["Security Monitoring"] + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - manage_integrations + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/security_monitoring/configuration/integration_config/validate: + post: + description: |- + Validate a set of credentials against the external entity source before creating a sync configuration. + Returns a 200 status code if the credentials are valid. + operationId: ValidateSecurityMonitoringIntegrationCredentials + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + domain: siem-test.com + integration_type: GOOGLE_WORKSPACE + secrets: + admin_email: test@example.com + type: integration_config + schema: + $ref: "#/components/schemas/SecurityMonitoringIntegrationCredentialsValidateRequest" + description: The credentials to validate. + required: true + responses: + "200": + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - integrations_read + summary: Validate entity context sync credentials + tags: ["Security Monitoring"] + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - integrations_read + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/security_monitoring/configuration/integration_config/{integration_config_id}: + delete: + description: |- + Delete an entity context sync configuration. Cloud SIEM stops ingesting entities from this source, + and the credentials stored for the configuration are removed from the secrets store. + operationId: DeleteSecurityMonitoringIntegrationConfig + parameters: + - $ref: "#/components/parameters/SecurityMonitoringIntegrationConfigID" + responses: + "204": + description: OK + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - manage_integrations + summary: Delete an entity context sync configuration + tags: ["Security Monitoring"] + x-permission: + operator: OR + permissions: + - manage_integrations + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + get: + description: Get the details of a specific entity context sync configuration. + operationId: GetSecurityMonitoringIntegrationConfig + parameters: + - $ref: "#/components/parameters/SecurityMonitoringIntegrationConfigID" + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + created_at: "2026-05-01T12:00:00Z" + domain: siem-test.com + enabled: true + integration_type: GOOGLE_WORKSPACE + modified_at: "2026-05-01T12:00:00Z" + name: My GWS Integration + settings: + setting1: value1 + state: valid + id: 11111111-2222-3333-4444-555555555555 + type: integration_config + schema: + $ref: "#/components/schemas/SecurityMonitoringIntegrationConfigResponse" + description: OK + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - integrations_read + summary: Get an entity context sync configuration + tags: ["Security Monitoring"] + x-permission: + operator: OR + permissions: + - integrations_read + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + patch: + description: Update an existing entity context sync configuration. Supports partial updates; only the fields provided in the request body are modified. + operationId: UpdateSecurityMonitoringIntegrationConfig + parameters: + - $ref: "#/components/parameters/SecurityMonitoringIntegrationConfigID" + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + enabled: false + name: My GWS Integration (renamed) + type: integration_config + schema: + $ref: "#/components/schemas/SecurityMonitoringIntegrationConfigUpdateRequest" + description: The fields to update on the integration configuration. + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + created_at: "2026-05-01T12:00:00Z" + domain: siem-test.com + enabled: false + integration_type: GOOGLE_WORKSPACE + modified_at: "2026-05-08T12:00:00Z" + name: My GWS Integration (renamed) + settings: + setting1: value1 + state: valid + id: 11111111-2222-3333-4444-555555555555 + type: integration_config + schema: + $ref: "#/components/schemas/SecurityMonitoringIntegrationConfigResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - manage_integrations + summary: Update an entity context sync configuration + tags: ["Security Monitoring"] + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - manage_integrations + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/security_monitoring/configuration/integration_config/{integration_config_id}/validate: + post: + description: |- + Validate the credentials currently stored on an existing entity context sync configuration. + Returns a 200 status code if the credentials are still valid against the external entity source. + operationId: ValidateSecurityMonitoringIntegrationConfig + parameters: + - $ref: "#/components/parameters/SecurityMonitoringIntegrationConfigID" + responses: + "200": + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - integrations_read + summary: Validate an entity context sync configuration + tags: ["Security Monitoring"] + x-permission: + operator: OR + permissions: + - integrations_read + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/security_monitoring/configuration/security_filters: get: description: Get the list of configured security filters with their definitions. @@ -143003,6 +144133,53 @@ paths: operator: OR permissions: - security_monitoring_filters_write + /api/v2/security_monitoring/configuration/security_filters/versions: + get: + description: |- + Get the configured security filters at each historical version of the configuration. + Each entry in the response represents the set of all security filters at a given version, + ordered from the most recent version to the oldest. + operationId: ListSecurityFilterVersions + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + date: 1758177253469 + filters: + - exclusion_filters: [] + filtered_data_type: logs + id: "123" + is_builtin: false + is_enabled: true + name: Test Security Filter + query: source:test + version: 1 + version: 1 + id: "1" + type: security_filters_configuration + schema: + $ref: "#/components/schemas/SecurityFilterVersionsResponse" + description: OK + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - security_monitoring_filters_read + summary: Get the version history of security filters + tags: ["Security Monitoring"] + x-permission: + operator: OR + permissions: + - security_monitoring_filters_read /api/v2/security_monitoring/configuration/security_filters/{security_filter_id}: delete: description: Delete a specific security filter. @@ -143783,6 +144960,113 @@ paths: x-unstable: |- **Note**: This endpoint is in preview and is subject to change. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/security_monitoring/entity_context: + get: + description: |- + Search the Cloud SIEM entity context store for entities that match a query, and return the historical + revisions of each entity in the requested time range. The endpoint can either return revisions across an + interval (`from` / `to`) or the snapshot of each entity at a single point in time (`as_of`); the two modes + are mutually exclusive. + operationId: GetEntityContext + parameters: + - description: A free-text query (for example, an email address or principal ID) used to filter the entities returned. + example: user@example.com + in: query + name: query + required: false + schema: + type: string + - description: |- + The start of the time range to query, as an RFC3339 timestamp or a relative time (for example, `now-7d`). + Defaults to `now-7d`. Ignored when `as_of` is set. + in: query + name: from + required: false + schema: + default: now-7d + example: now-7d + type: string + - description: |- + The end of the time range to query, as an RFC3339 timestamp or a relative time (for example, `now`). + Defaults to `now`. Ignored when `as_of` is set. + in: query + name: to + required: false + schema: + default: now + example: now + type: string + - description: |- + A point in time at which to query the entity revisions, as an RFC3339 timestamp, a Unix timestamp + (in seconds), or a relative time (for example, `now-1d`). When set, `from` and `to` are ignored. + Cannot be combined with custom `from` / `to` values. + example: now-1d + in: query + name: as_of + required: false + schema: + type: string + - description: The maximum number of entities to return. + in: query + name: limit + required: false + schema: + default: 250 + example: 100 + format: int64 + type: integer + - description: An opaque token used to fetch the next page of results, as returned in `meta.page.next_token` of a previous response. + in: query + name: page_token + required: false + schema: + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + revisions: + - attributes: + display_name: Test User + emails: + - user@example.com + principal_id: user@example.com + first_seen_at: "2026-04-01T00:00:00Z" + last_seen_at: "2026-05-01T00:00:00Z" + id: user@example.com + type: siem_entity_identity + meta: + page: + next_token: "" + total_count: 1 + schema: + $ref: "#/components/schemas/EntityContextResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - siem_entities_read + summary: Get entity context + tags: ["Security Monitoring"] + x-permission: + operator: OR + permissions: + - siem_entities_read + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/security_monitoring/rules: get: description: List rules. @@ -144658,6 +145942,282 @@ paths: - security_monitoring_rules_read x-unstable: |- **Note**: This endpoint is in beta and may be subject to changes. + /api/v2/security_monitoring/sample_log_generation/subscriptions: + get: + description: |- + Get the sample log generation subscriptions for the organization. + Sample log generation injects representative example logs for a given Cloud SIEM content pack into the Logs platform, + which can be used to test detection rules without onboarding the underlying integration first. + + **Availability**: this endpoint is restricted to Cloud SIEM trial organizations on an eligible + pricing model. Other organizations receive a `403 Forbidden` (non-trial orgs) or a `400 Bad Request` + (feature disabled), and legacy pricing tiers receive a response with `status: not_available`. + operationId: ListSampleLogGenerationSubscriptions + parameters: + - description: |- + Filter the subscriptions by status. Use `active` to return only currently active + subscriptions, or `all` to return every subscription including expired ones. + Ignored when `start_timestamp` is provided. Defaults to `active`. + in: query + name: status + required: false + schema: + $ref: "#/components/schemas/SampleLogGenerationSubscriptionsStatusFilter" + - description: |- + The start of the time range, as an RFC3339 timestamp. When provided, the response includes + every subscription that was active at any point in `[start_timestamp, end_timestamp]`, + and the `status` filter is ignored. + example: "2026-05-01T00:00:00Z" + in: query + name: start_timestamp + required: false + schema: + format: date-time + type: string + - description: |- + The end of the time range, as an RFC3339 timestamp. Ignored unless `start_timestamp` is set. + Defaults to the current time when `start_timestamp` is provided. + example: "2026-05-08T00:00:00Z" + in: query + name: end_timestamp + required: false + schema: + format: date-time + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + content_pack_id: aws-cloudtrail + created_at: "2026-05-08T20:02:13.77481Z" + expires_at: "2026-05-11T20:02:13.77481Z" + is_active: true + status: subscribed + id: "999" + type: subscriptions + meta: + total_subscriptions: 1 + schema: + $ref: "#/components/schemas/SampleLogGenerationSubscriptionsResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - security_monitoring_filters_read + - logs_read_index_data + summary: Get sample log generation subscriptions + tags: ["Security Monitoring"] + x-permission: + operator: OR + permissions: + - security_monitoring_filters_read + - logs_read_index_data + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + post: + description: |- + Subscribe to sample log generation for a Cloud SIEM content pack. Sample logs for the + requested content pack are injected into the Logs platform for the duration of the subscription, + so detection rules can be exercised without onboarding the underlying integration first. + + **Availability**: this endpoint is restricted to Cloud SIEM trial organizations on an + eligible pricing model. Non-trial orgs receive `403 Forbidden`, the feature flag may also reject + requests with `400 Bad Request`, and legacy pricing tiers receive a response with `status: not_available`. + operationId: CreateSampleLogGenerationSubscription + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + content_pack_id: aws-cloudtrail + duration: 3d + type: subscription_requests + schema: + $ref: "#/components/schemas/SampleLogGenerationSubscriptionCreateRequest" + description: The content pack to subscribe to and the desired duration of the subscription. + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + content_pack_id: aws-cloudtrail + created_at: "2026-05-08T20:02:13.77481Z" + expires_at: "2026-05-11T20:02:13.77481Z" + is_active: true + status: subscribed + id: "789" + type: subscriptions + schema: + $ref: "#/components/schemas/SampleLogGenerationSubscriptionResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - security_monitoring_filters_write + - logs_modify_indexes + summary: Subscribe to sample log generation + tags: ["Security Monitoring"] + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - security_monitoring_filters_write + - logs_modify_indexes + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/security_monitoring/sample_log_generation/subscriptions/bulk: + post: + description: |- + Subscribe to sample log generation for multiple Cloud SIEM content packs in a single call. + Each requested content pack is processed independently; the response includes a per-item + status so partial successes can be inspected. + + **Availability**: this endpoint is restricted to Cloud SIEM trial organizations on an + eligible pricing model. Non-trial orgs receive `403 Forbidden`, the feature flag may also reject + requests with `400 Bad Request`, and legacy pricing tiers receive per-item responses with `status: not_available`. + operationId: BulkCreateSampleLogGenerationSubscriptions + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + content_pack_ids: + - aws-cloudtrail + duration: 3d + type: bulk_subscription_requests + schema: + $ref: "#/components/schemas/SampleLogGenerationBulkSubscriptionRequest" + description: The content packs to subscribe to and the desired duration of the subscriptions. + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + content_pack_id: aws-cloudtrail + created_at: "2026-05-08T20:02:13.655716Z" + expires_at: "2026-05-11T20:02:13.655716Z" + is_active: true + status: subscribed + id: "123" + meta: + status: 200 + type: subscriptions + schema: + $ref: "#/components/schemas/SampleLogGenerationBulkSubscriptionResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - security_monitoring_filters_write + - logs_modify_indexes + summary: Bulk subscribe to sample log generation + tags: ["Security Monitoring"] + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - security_monitoring_filters_write + - logs_modify_indexes + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/security_monitoring/sample_log_generation/subscriptions/{content_pack_id}: + delete: + description: |- + Unsubscribe from sample log generation for a Cloud SIEM content pack. + After unsubscribing, no more sample logs are generated for the requested content pack. + + **Availability**: this endpoint is restricted to Cloud SIEM trial organizations on an + eligible pricing model. Non-trial orgs receive `403 Forbidden`, the feature flag may also reject + requests with `400 Bad Request`, and legacy pricing tiers receive a response with `status: not_available`. + operationId: DeleteSampleLogGenerationSubscription + parameters: + - $ref: "#/components/parameters/SampleLogGenerationContentPackID" + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + content_pack_id: aws-cloudtrail + created_at: "2026-05-08T20:02:13.77481Z" + expires_at: "2026-05-08T20:30:00Z" + is_active: false + status: unsubscribed + id: "789" + type: subscriptions + schema: + $ref: "#/components/schemas/SampleLogGenerationSubscriptionResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - security_monitoring_filters_write + - logs_modify_indexes + summary: Unsubscribe from sample log generation + tags: ["Security Monitoring"] + x-permission: + operator: OR + permissions: + - security_monitoring_filters_write + - logs_modify_indexes + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/security_monitoring/signals: get: description: |- @@ -145078,6 +146638,61 @@ paths: operator: OR permissions: - security_monitoring_signals_write + /api/v2/security_monitoring/signals/{signal_id}/entities: + get: + description: Get the list of entities related to a security signal, captured at the signal's timestamp. + operationId: GetSignalEntities + parameters: + - $ref: "#/components/parameters/SignalID" + - description: The maximum number of entities to return. + in: query + name: limit + required: false + schema: + default: 10 + example: 10 + format: int32 + maximum: 1000 + type: integer + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + identities: + - display_name: Test User + principal_id: user@example.com + id: AAAAAWgN8Xwgr1vKDQAAAABBV2dOOFh3ZzZobm1mWXJFYTR0OA + type: entities + schema: + $ref: "#/components/schemas/SignalEntitiesResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - security_monitoring_signals_read + summary: Get entities related to a signal + tags: ["Security Monitoring"] + x-permission: + operator: OR + permissions: + - security_monitoring_signals_read + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/security_monitoring/signals/{signal_id}/incidents: patch: description: |- diff --git a/examples/v2/security-monitoring/BulkCreateSampleLogGenerationSubscriptions.rb b/examples/v2/security-monitoring/BulkCreateSampleLogGenerationSubscriptions.rb new file mode 100644 index 000000000000..3cc111019aab --- /dev/null +++ b/examples/v2/security-monitoring/BulkCreateSampleLogGenerationSubscriptions.rb @@ -0,0 +1,20 @@ +# Bulk subscribe to sample log generation returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.bulk_create_sample_log_generation_subscriptions".to_sym] = true +end +api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new + +body = DatadogAPIClient::V2::SampleLogGenerationBulkSubscriptionRequest.new({ + data: DatadogAPIClient::V2::SampleLogGenerationBulkSubscriptionData.new({ + attributes: DatadogAPIClient::V2::SampleLogGenerationBulkSubscriptionAttributes.new({ + content_pack_ids: [ + "aws-cloudtrail", + ], + duration: DatadogAPIClient::V2::SampleLogGenerationDuration::THREE_DAYS, + }), + type: DatadogAPIClient::V2::SampleLogGenerationBulkSubscriptionRequestType::BULK_SUBSCRIPTION_REQUESTS, + }), +}) +p api_instance.bulk_create_sample_log_generation_subscriptions(body) diff --git a/examples/v2/security-monitoring/CreateSampleLogGenerationSubscription.rb b/examples/v2/security-monitoring/CreateSampleLogGenerationSubscription.rb new file mode 100644 index 000000000000..35a674ee543c --- /dev/null +++ b/examples/v2/security-monitoring/CreateSampleLogGenerationSubscription.rb @@ -0,0 +1,18 @@ +# Subscribe to sample log generation returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.create_sample_log_generation_subscription".to_sym] = true +end +api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new + +body = DatadogAPIClient::V2::SampleLogGenerationSubscriptionCreateRequest.new({ + data: DatadogAPIClient::V2::SampleLogGenerationSubscriptionCreateData.new({ + attributes: DatadogAPIClient::V2::SampleLogGenerationSubscriptionCreateAttributes.new({ + content_pack_id: "aws-cloudtrail", + duration: DatadogAPIClient::V2::SampleLogGenerationDuration::THREE_DAYS, + }), + type: DatadogAPIClient::V2::SampleLogGenerationSubscriptionRequestType::SUBSCRIPTION_REQUESTS, + }), +}) +p api_instance.create_sample_log_generation_subscription(body) diff --git a/examples/v2/security-monitoring/CreateSecurityMonitoringIntegrationConfig.rb b/examples/v2/security-monitoring/CreateSecurityMonitoringIntegrationConfig.rb new file mode 100644 index 000000000000..11d69e368d0e --- /dev/null +++ b/examples/v2/security-monitoring/CreateSecurityMonitoringIntegrationConfig.rb @@ -0,0 +1,21 @@ +# Create an entity context sync configuration returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.create_security_monitoring_integration_config".to_sym] = true +end +api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new + +body = DatadogAPIClient::V2::SecurityMonitoringIntegrationConfigCreateRequest.new({ + data: DatadogAPIClient::V2::SecurityMonitoringIntegrationConfigCreateData.new({ + attributes: DatadogAPIClient::V2::SecurityMonitoringIntegrationConfigCreateAttributes.new({ + domain: "siem-test.com", + integration_type: DatadogAPIClient::V2::SecurityMonitoringIntegrationType::GOOGLE_WORKSPACE, + name: "My GWS Integration", + secrets: DatadogAPIClient::V2::SecurityMonitoringIntegrationConfigSecrets.new({}), + settings: DatadogAPIClient::V2::SecurityMonitoringIntegrationConfigSettings.new({}), + }), + type: DatadogAPIClient::V2::SecurityMonitoringIntegrationConfigResourceType::INTEGRATION_CONFIG, + }), +}) +p api_instance.create_security_monitoring_integration_config(body) diff --git a/examples/v2/security-monitoring/DeleteSampleLogGenerationSubscription.rb b/examples/v2/security-monitoring/DeleteSampleLogGenerationSubscription.rb new file mode 100644 index 000000000000..fd70dc15647e --- /dev/null +++ b/examples/v2/security-monitoring/DeleteSampleLogGenerationSubscription.rb @@ -0,0 +1,8 @@ +# Unsubscribe from sample log generation returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.delete_sample_log_generation_subscription".to_sym] = true +end +api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new +p api_instance.delete_sample_log_generation_subscription("content_pack_id") diff --git a/examples/v2/security-monitoring/DeleteSecurityMonitoringIntegrationConfig.rb b/examples/v2/security-monitoring/DeleteSecurityMonitoringIntegrationConfig.rb new file mode 100644 index 000000000000..8f7298fd1801 --- /dev/null +++ b/examples/v2/security-monitoring/DeleteSecurityMonitoringIntegrationConfig.rb @@ -0,0 +1,8 @@ +# Delete an entity context sync configuration returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.delete_security_monitoring_integration_config".to_sym] = true +end +api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new +api_instance.delete_security_monitoring_integration_config("integration_config_id") diff --git a/examples/v2/security-monitoring/GetEntityContext.rb b/examples/v2/security-monitoring/GetEntityContext.rb new file mode 100644 index 000000000000..bc4910b0cf18 --- /dev/null +++ b/examples/v2/security-monitoring/GetEntityContext.rb @@ -0,0 +1,8 @@ +# Get entity context returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.get_entity_context".to_sym] = true +end +api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new +p api_instance.get_entity_context() diff --git a/examples/v2/security-monitoring/GetSecurityMonitoringIntegrationConfig.rb b/examples/v2/security-monitoring/GetSecurityMonitoringIntegrationConfig.rb new file mode 100644 index 000000000000..c14f834c2929 --- /dev/null +++ b/examples/v2/security-monitoring/GetSecurityMonitoringIntegrationConfig.rb @@ -0,0 +1,8 @@ +# Get an entity context sync configuration returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.get_security_monitoring_integration_config".to_sym] = true +end +api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new +p api_instance.get_security_monitoring_integration_config("integration_config_id") diff --git a/examples/v2/security-monitoring/GetSignalEntities.rb b/examples/v2/security-monitoring/GetSignalEntities.rb new file mode 100644 index 000000000000..568da5262ed7 --- /dev/null +++ b/examples/v2/security-monitoring/GetSignalEntities.rb @@ -0,0 +1,8 @@ +# Get entities related to a signal returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.get_signal_entities".to_sym] = true +end +api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new +p api_instance.get_signal_entities("signal_id") diff --git a/examples/v2/security-monitoring/ListSampleLogGenerationSubscriptions.rb b/examples/v2/security-monitoring/ListSampleLogGenerationSubscriptions.rb new file mode 100644 index 000000000000..56a91b979335 --- /dev/null +++ b/examples/v2/security-monitoring/ListSampleLogGenerationSubscriptions.rb @@ -0,0 +1,8 @@ +# Get sample log generation subscriptions returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.list_sample_log_generation_subscriptions".to_sym] = true +end +api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new +p api_instance.list_sample_log_generation_subscriptions() diff --git a/examples/v2/security-monitoring/ListSecurityFilterVersions.rb b/examples/v2/security-monitoring/ListSecurityFilterVersions.rb new file mode 100644 index 000000000000..fedeb2290a8a --- /dev/null +++ b/examples/v2/security-monitoring/ListSecurityFilterVersions.rb @@ -0,0 +1,5 @@ +# Get the version history of security filters returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new +p api_instance.list_security_filter_versions() diff --git a/examples/v2/security-monitoring/ListSecurityMonitoringIntegrationConfigs.rb b/examples/v2/security-monitoring/ListSecurityMonitoringIntegrationConfigs.rb new file mode 100644 index 000000000000..fd038b4fb0d2 --- /dev/null +++ b/examples/v2/security-monitoring/ListSecurityMonitoringIntegrationConfigs.rb @@ -0,0 +1,8 @@ +# List entity context sync configurations returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.list_security_monitoring_integration_configs".to_sym] = true +end +api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new +p api_instance.list_security_monitoring_integration_configs() diff --git a/examples/v2/security-monitoring/UpdateSecurityMonitoringIntegrationConfig.rb b/examples/v2/security-monitoring/UpdateSecurityMonitoringIntegrationConfig.rb new file mode 100644 index 000000000000..31abcb761a7a --- /dev/null +++ b/examples/v2/security-monitoring/UpdateSecurityMonitoringIntegrationConfig.rb @@ -0,0 +1,22 @@ +# Update an entity context sync configuration returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.update_security_monitoring_integration_config".to_sym] = true +end +api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new + +body = DatadogAPIClient::V2::SecurityMonitoringIntegrationConfigUpdateRequest.new({ + data: DatadogAPIClient::V2::SecurityMonitoringIntegrationConfigUpdateData.new({ + attributes: DatadogAPIClient::V2::SecurityMonitoringIntegrationConfigUpdateAttributes.new({ + domain: "siem-test.com", + enabled: true, + integration_type: DatadogAPIClient::V2::SecurityMonitoringIntegrationType::GOOGLE_WORKSPACE, + name: "My GWS Integration (renamed)", + secrets: DatadogAPIClient::V2::SecurityMonitoringIntegrationConfigSecrets.new({}), + settings: DatadogAPIClient::V2::SecurityMonitoringIntegrationConfigSettings.new({}), + }), + type: DatadogAPIClient::V2::SecurityMonitoringIntegrationConfigResourceType::INTEGRATION_CONFIG, + }), +}) +p api_instance.update_security_monitoring_integration_config("integration_config_id", body) diff --git a/examples/v2/security-monitoring/ValidateSecurityMonitoringIntegrationConfig.rb b/examples/v2/security-monitoring/ValidateSecurityMonitoringIntegrationConfig.rb new file mode 100644 index 000000000000..d1400e1ffcab --- /dev/null +++ b/examples/v2/security-monitoring/ValidateSecurityMonitoringIntegrationConfig.rb @@ -0,0 +1,8 @@ +# Validate an entity context sync configuration returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.validate_security_monitoring_integration_config".to_sym] = true +end +api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new +p api_instance.validate_security_monitoring_integration_config("integration_config_id") diff --git a/examples/v2/security-monitoring/ValidateSecurityMonitoringIntegrationCredentials.rb b/examples/v2/security-monitoring/ValidateSecurityMonitoringIntegrationCredentials.rb new file mode 100644 index 000000000000..955a901cdd67 --- /dev/null +++ b/examples/v2/security-monitoring/ValidateSecurityMonitoringIntegrationCredentials.rb @@ -0,0 +1,19 @@ +# Validate entity context sync credentials returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.validate_security_monitoring_integration_credentials".to_sym] = true +end +api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new + +body = DatadogAPIClient::V2::SecurityMonitoringIntegrationCredentialsValidateRequest.new({ + data: DatadogAPIClient::V2::SecurityMonitoringIntegrationCredentialsValidateData.new({ + attributes: DatadogAPIClient::V2::SecurityMonitoringIntegrationCredentialsValidateAttributes.new({ + domain: "siem-test.com", + integration_type: DatadogAPIClient::V2::SecurityMonitoringIntegrationType::GOOGLE_WORKSPACE, + secrets: DatadogAPIClient::V2::SecurityMonitoringIntegrationConfigSecrets.new({}), + }), + type: DatadogAPIClient::V2::SecurityMonitoringIntegrationConfigResourceType::INTEGRATION_CONFIG, + }), +}) +p api_instance.validate_security_monitoring_integration_credentials(body) diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index 9246b6c3a9d0..7703d0eb6d29 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -2073,6 +2073,28 @@ "critical_asset_id" => "String", "body" => "SecurityMonitoringCriticalAssetUpdateRequest", }, + "v2.ListSecurityMonitoringIntegrationConfigs" => { + "filter_integration_type" => "SecurityMonitoringIntegrationType", + }, + "v2.CreateSecurityMonitoringIntegrationConfig" => { + "body" => "SecurityMonitoringIntegrationConfigCreateRequest", + }, + "v2.ValidateSecurityMonitoringIntegrationCredentials" => { + "body" => "SecurityMonitoringIntegrationCredentialsValidateRequest", + }, + "v2.DeleteSecurityMonitoringIntegrationConfig" => { + "integration_config_id" => "String", + }, + "v2.GetSecurityMonitoringIntegrationConfig" => { + "integration_config_id" => "String", + }, + "v2.UpdateSecurityMonitoringIntegrationConfig" => { + "integration_config_id" => "String", + "body" => "SecurityMonitoringIntegrationConfigUpdateRequest", + }, + "v2.ValidateSecurityMonitoringIntegrationConfig" => { + "integration_config_id" => "String", + }, "v2.CreateSecurityFilter" => { "body" => "SecurityFilterCreateRequest", }, @@ -2125,6 +2147,14 @@ "v2.DeactivateContentPack" => { "content_pack_id" => "String", }, + "v2.GetEntityContext" => { + "query" => "String", + "from" => "String", + "to" => "String", + "as_of" => "String", + "limit" => "Integer", + "page_token" => "String", + }, "v2.ListSecurityMonitoringRules" => { "page_size" => "Integer", "page_number" => "Integer", @@ -2171,6 +2201,20 @@ "page_size" => "Integer", "page_number" => "Integer", }, + "v2.ListSampleLogGenerationSubscriptions" => { + "status" => "SampleLogGenerationSubscriptionsStatusFilter", + "start_timestamp" => "Time", + "end_timestamp" => "Time", + }, + "v2.CreateSampleLogGenerationSubscription" => { + "body" => "SampleLogGenerationSubscriptionCreateRequest", + }, + "v2.BulkCreateSampleLogGenerationSubscriptions" => { + "body" => "SampleLogGenerationBulkSubscriptionRequest", + }, + "v2.DeleteSampleLogGenerationSubscription" => { + "content_pack_id" => "String", + }, "v2.ListSecurityMonitoringSignals" => { "filter_query" => "String", "filter_from" => "Time", @@ -2198,6 +2242,10 @@ "signal_id" => "String", "body" => "SecurityMonitoringSignalAssigneeUpdateRequest", }, + "v2.GetSignalEntities" => { + "signal_id" => "String", + "limit" => "Integer", + }, "v2.EditSecurityMonitoringSignalIncidents" => { "signal_id" => "String", "body" => "SecurityMonitoringSignalIncidentsUpdateRequest", diff --git a/features/v2/security_monitoring.feature b/features/v2/security_monitoring.feature index ff9964a900d9..485a947631d8 100644 --- a/features/v2/security_monitoring.feature +++ b/features/v2/security_monitoring.feature @@ -142,6 +142,22 @@ Feature: Security Monitoring When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/k9-cloud-siem + Scenario: Bulk subscribe to sample log generation returns "Bad Request" response + Given operation "BulkCreateSampleLogGenerationSubscriptions" enabled + And new "BulkCreateSampleLogGenerationSubscriptions" request + And body with value {"data": {"attributes": {"content_pack_ids": ["aws-cloudtrail"], "duration": "3d"}, "type": "bulk_subscription_requests"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/k9-cloud-siem + Scenario: Bulk subscribe to sample log generation returns "OK" response + Given operation "BulkCreateSampleLogGenerationSubscriptions" enabled + And new "BulkCreateSampleLogGenerationSubscriptions" request + And body with value {"data": {"attributes": {"content_pack_ids": ["aws-cloudtrail"], "duration": "3d"}, "type": "bulk_subscription_requests"}} + When the request is sent + Then the response status is 200 OK + @skip @team:DataDog/k9-cloud-siem Scenario: Bulk update security signals returns "Bad Request" response Given new "BulkEditSecurityMonitoringSignals" request @@ -721,6 +737,22 @@ Feature: Security Monitoring And the response "data.attributes.rule_query" is equal to "type:log_detection source:cloudtrail" And the response "data.attributes.data_exclusion_query" is equal to "account_id:12345" + @generated @skip @team:DataDog/k9-cloud-siem + Scenario: Create an entity context sync configuration returns "Bad Request" response + Given operation "CreateSecurityMonitoringIntegrationConfig" enabled + And new "CreateSecurityMonitoringIntegrationConfig" request + And body with value {"data": {"attributes": {"domain": "siem-test.com", "integration_type": "GOOGLE_WORKSPACE", "name": "My GWS Integration", "secrets": {"admin_email": "test@example.com"}, "settings": {"setting1": "value1"}}, "type": "integration_config"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/k9-cloud-siem + Scenario: Create an entity context sync configuration returns "OK" response + Given operation "CreateSecurityMonitoringIntegrationConfig" enabled + And new "CreateSecurityMonitoringIntegrationConfig" request + And body with value {"data": {"attributes": {"domain": "siem-test.com", "integration_type": "GOOGLE_WORKSPACE", "name": "My GWS Integration", "secrets": {"admin_email": "test@example.com"}, "settings": {"setting1": "value1"}}, "type": "integration_config"}} + When the request is sent + Then the response status is 200 OK + @team:DataDog/k9-investigation Scenario: Create case for security finding returns "Created" response Given new "CreateCases" request @@ -911,6 +943,22 @@ Feature: Security Monitoring When the request is sent Then the response status is 204 Rule successfully deleted. + @generated @skip @team:DataDog/k9-cloud-siem + Scenario: Delete an entity context sync configuration returns "Not Found" response + Given operation "DeleteSecurityMonitoringIntegrationConfig" enabled + And new "DeleteSecurityMonitoringIntegrationConfig" request + And request contains "integration_config_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/k9-cloud-siem + Scenario: Delete an entity context sync configuration returns "OK" response + Given operation "DeleteSecurityMonitoringIntegrationConfig" enabled + And new "DeleteSecurityMonitoringIntegrationConfig" request + And request contains "integration_config_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 204 OK + @team:DataDog/k9-cloud-siem Scenario: Delete an existing job returns "Bad Request" response Given operation "DeleteHistoricalJob" enabled @@ -1398,6 +1446,22 @@ Feature: Security Monitoring Then the response status is 200 OK And the response "data[0].attributes.name" is equal to "suppression2 {{ unique_hash }}" + @generated @skip @team:DataDog/k9-cloud-siem + Scenario: Get an entity context sync configuration returns "Not Found" response + Given operation "GetSecurityMonitoringIntegrationConfig" enabled + And new "GetSecurityMonitoringIntegrationConfig" request + And request contains "integration_config_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/k9-cloud-siem + Scenario: Get an entity context sync configuration returns "OK" response + Given operation "GetSecurityMonitoringIntegrationConfig" enabled + And new "GetSecurityMonitoringIntegrationConfig" request + And request contains "integration_config_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/k9-cloud-siem Scenario: Get an indicator of compromise returns "Bad Request" response Given operation "GetIndicatorOfCompromise" enabled @@ -1495,6 +1559,44 @@ Feature: Security Monitoring When the request is sent Then the response status is 200 Notification rule details. + @generated @skip @team:DataDog/k9-cloud-siem + Scenario: Get entities related to a signal returns "Bad Request" response + Given operation "GetSignalEntities" enabled + And new "GetSignalEntities" request + And request contains "signal_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/k9-cloud-siem + Scenario: Get entities related to a signal returns "Not Found" response + Given operation "GetSignalEntities" enabled + And new "GetSignalEntities" request + And request contains "signal_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/k9-cloud-siem + Scenario: Get entities related to a signal returns "OK" response + Given operation "GetSignalEntities" enabled + And new "GetSignalEntities" request + And request contains "signal_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/k9-cloud-siem + Scenario: Get entity context returns "Bad Request" response + Given operation "GetEntityContext" enabled + And new "GetEntityContext" request + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/k9-cloud-siem + Scenario: Get entity context returns "OK" response + Given operation "GetEntityContext" enabled + And new "GetEntityContext" request + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/k9-cloud-siem Scenario: Get investigation queries for a signal returns "Not Found" response Given new "GetInvestigationLogQueriesMatchingSignal" request @@ -1527,6 +1629,20 @@ Feature: Security Monitoring And the response "data.attributes.count" is equal to 1 And the response "data.attributes.data[1].rule.name" has the same value as "security_rule.name" + @generated @skip @team:DataDog/k9-cloud-siem + Scenario: Get sample log generation subscriptions returns "Bad Request" response + Given operation "ListSampleLogGenerationSubscriptions" enabled + And new "ListSampleLogGenerationSubscriptions" request + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/k9-cloud-siem + Scenario: Get sample log generation subscriptions returns "OK" response + Given operation "ListSampleLogGenerationSubscriptions" enabled + And new "ListSampleLogGenerationSubscriptions" request + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/k9-cloud-siem Scenario: Get suggested actions for a signal returns "Not Found" response Given new "GetSuggestedActionsMatchingSignal" request @@ -1593,6 +1709,12 @@ Feature: Security Monitoring When the request is sent Then the response status is 200 The list of notification rules. + @generated @skip @team:DataDog/k9-cloud-siem + Scenario: Get the version history of security filters returns "OK" response + Given new "ListSecurityFilterVersions" request + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/k9-cloud-vm Scenario: List assets SBOMs returns "Bad request: The server cannot process the request due to invalid syntax in the request." response Given new "ListAssetsSBOMs" request @@ -1621,6 +1743,13 @@ Feature: Security Monitoring When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/k9-cloud-siem + Scenario: List entity context sync configurations returns "OK" response + Given operation "ListSecurityMonitoringIntegrationConfigs" enabled + And new "ListSecurityMonitoringIntegrationConfigs" request + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/cloud-security-posture-management Scenario: List findings returns "Bad Request: The server cannot process the request due to invalid syntax in the request." response Given operation "ListFindings" enabled @@ -2109,6 +2238,22 @@ Feature: Security Monitoring And the response "meta.page" has field "after" And the response "links" has field "next" + @generated @skip @team:DataDog/k9-cloud-siem + Scenario: Subscribe to sample log generation returns "Bad Request" response + Given operation "CreateSampleLogGenerationSubscription" enabled + And new "CreateSampleLogGenerationSubscription" request + And body with value {"data": {"attributes": {"content_pack_id": "aws-cloudtrail", "duration": "3d"}, "type": "subscription_requests"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/k9-cloud-siem + Scenario: Subscribe to sample log generation returns "OK" response + Given operation "CreateSampleLogGenerationSubscription" enabled + And new "CreateSampleLogGenerationSubscription" request + And body with value {"data": {"attributes": {"content_pack_id": "aws-cloudtrail", "duration": "3d"}, "type": "subscription_requests"}} + When the request is sent + Then the response status is 200 OK + @skip @team:DataDog/k9-cloud-siem Scenario: Test a rule returns "Bad Request" response Given new "TestSecurityMonitoringRule" request @@ -2179,6 +2324,22 @@ Feature: Security Monitoring When the request is sent Then the response status is 422 Unprocessable Entity + @generated @skip @team:DataDog/k9-cloud-siem + Scenario: Unsubscribe from sample log generation returns "Bad Request" response + Given operation "DeleteSampleLogGenerationSubscription" enabled + And new "DeleteSampleLogGenerationSubscription" request + And request contains "content_pack_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/k9-cloud-siem + Scenario: Unsubscribe from sample log generation returns "OK" response + Given operation "DeleteSampleLogGenerationSubscription" enabled + And new "DeleteSampleLogGenerationSubscription" request + And request contains "content_pack_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @skip-validation @team:DataDog/k9-cloud-siem Scenario: Update a cloud configuration rule's details returns "OK" response Given new "UpdateSecurityMonitoringRule" request @@ -2318,6 +2479,33 @@ Feature: Security Monitoring And the response "data.attributes.suppression_query" is equal to "env:staging status:low" And the response "data.attributes.version" is equal to 2 + @generated @skip @team:DataDog/k9-cloud-siem + Scenario: Update an entity context sync configuration returns "Bad Request" response + Given operation "UpdateSecurityMonitoringIntegrationConfig" enabled + And new "UpdateSecurityMonitoringIntegrationConfig" request + And request contains "integration_config_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"domain": "siem-test.com", "enabled": true, "integration_type": "GOOGLE_WORKSPACE", "name": "My GWS Integration (renamed)", "secrets": {"admin_email": "test@example.com"}, "settings": {"setting1": "value1"}}, "type": "integration_config"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/k9-cloud-siem + Scenario: Update an entity context sync configuration returns "Not Found" response + Given operation "UpdateSecurityMonitoringIntegrationConfig" enabled + And new "UpdateSecurityMonitoringIntegrationConfig" request + And request contains "integration_config_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"domain": "siem-test.com", "enabled": true, "integration_type": "GOOGLE_WORKSPACE", "name": "My GWS Integration (renamed)", "secrets": {"admin_email": "test@example.com"}, "settings": {"setting1": "value1"}}, "type": "integration_config"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/k9-cloud-siem + Scenario: Update an entity context sync configuration returns "OK" response + Given operation "UpdateSecurityMonitoringIntegrationConfig" enabled + And new "UpdateSecurityMonitoringIntegrationConfig" request + And request contains "integration_config_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"domain": "siem-test.com", "enabled": true, "integration_type": "GOOGLE_WORKSPACE", "name": "My GWS Integration (renamed)", "secrets": {"admin_email": "test@example.com"}, "settings": {"setting1": "value1"}}, "type": "integration_config"}} + When the request is sent + Then the response status is 200 OK + @skip-validation @team:DataDog/k9-cloud-siem Scenario: Update an existing rule returns "Bad Request" response Given new "UpdateSecurityMonitoringRule" request @@ -2425,3 +2613,43 @@ Feature: Security Monitoring And body with value {"data": {"attributes": {"data_exclusion_query": "source:cloudtrail account_id:12345", "description": "This rule suppresses low-severity signals in staging environments.", "enabled": true, "name": "Custom suppression", "rule_query": "type:log_detection source:cloudtrail"}, "type": "suppressions"}} When the request is sent Then the response status is 204 OK + + @generated @skip @team:DataDog/k9-cloud-siem + Scenario: Validate an entity context sync configuration returns "Bad Request" response + Given operation "ValidateSecurityMonitoringIntegrationConfig" enabled + And new "ValidateSecurityMonitoringIntegrationConfig" request + And request contains "integration_config_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/k9-cloud-siem + Scenario: Validate an entity context sync configuration returns "Not Found" response + Given operation "ValidateSecurityMonitoringIntegrationConfig" enabled + And new "ValidateSecurityMonitoringIntegrationConfig" request + And request contains "integration_config_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/k9-cloud-siem + Scenario: Validate an entity context sync configuration returns "OK" response + Given operation "ValidateSecurityMonitoringIntegrationConfig" enabled + And new "ValidateSecurityMonitoringIntegrationConfig" request + And request contains "integration_config_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/k9-cloud-siem + Scenario: Validate entity context sync credentials returns "Bad Request" response + Given operation "ValidateSecurityMonitoringIntegrationCredentials" enabled + And new "ValidateSecurityMonitoringIntegrationCredentials" request + And body with value {"data": {"attributes": {"domain": "siem-test.com", "integration_type": "GOOGLE_WORKSPACE", "secrets": {"admin_email": "test@example.com"}}, "type": "integration_config"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/k9-cloud-siem + Scenario: Validate entity context sync credentials returns "OK" response + Given operation "ValidateSecurityMonitoringIntegrationCredentials" enabled + And new "ValidateSecurityMonitoringIntegrationCredentials" request + And body with value {"data": {"attributes": {"domain": "siem-test.com", "integration_type": "GOOGLE_WORKSPACE", "secrets": {"admin_email": "test@example.com"}}, "type": "integration_config"}} + When the request is sent + Then the response status is 200 OK diff --git a/features/v2/undo.json b/features/v2/undo.json index 02753f1a80a7..8f3ff5ccce85 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -6177,6 +6177,55 @@ "type": "idempotent" } }, + "ListSecurityMonitoringIntegrationConfigs": { + "tag": "Security Monitoring", + "undo": { + "type": "safe" + } + }, + "CreateSecurityMonitoringIntegrationConfig": { + "tag": "Security Monitoring", + "undo": { + "operationId": "DeleteSecurityMonitoringIntegrationConfig", + "parameters": [ + { + "name": "integration_config_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "ValidateSecurityMonitoringIntegrationCredentials": { + "tag": "Security Monitoring", + "undo": { + "type": "safe" + } + }, + "DeleteSecurityMonitoringIntegrationConfig": { + "tag": "Security Monitoring", + "undo": { + "type": "idempotent" + } + }, + "GetSecurityMonitoringIntegrationConfig": { + "tag": "Security Monitoring", + "undo": { + "type": "safe" + } + }, + "UpdateSecurityMonitoringIntegrationConfig": { + "tag": "Security Monitoring", + "undo": { + "type": "idempotent" + } + }, + "ValidateSecurityMonitoringIntegrationConfig": { + "tag": "Security Monitoring", + "undo": { + "type": "safe" + } + }, "ListSecurityFilters": { "tag": "Security Monitoring", "undo": { @@ -6196,6 +6245,12 @@ "type": "unsafe" } }, + "ListSecurityFilterVersions": { + "tag": "Security Monitoring", + "undo": { + "type": "safe" + } + }, "DeleteSecurityFilter": { "tag": "Security Monitoring", "undo": { @@ -6293,6 +6348,12 @@ "type": "idempotent" } }, + "GetEntityContext": { + "tag": "Security Monitoring", + "undo": { + "type": "safe" + } + }, "ListSecurityMonitoringRules": { "tag": "Security Monitoring", "undo": { @@ -6378,6 +6439,37 @@ "type": "safe" } }, + "ListSampleLogGenerationSubscriptions": { + "tag": "Security Monitoring", + "undo": { + "type": "safe" + } + }, + "CreateSampleLogGenerationSubscription": { + "tag": "Security Monitoring", + "undo": { + "operationId": "DeleteSampleLogGenerationSubscription", + "parameters": [ + { + "name": "content_pack_id", + "source": "data.attributes.content_pack_id" + } + ], + "type": "unsafe" + } + }, + "BulkCreateSampleLogGenerationSubscriptions": { + "tag": "Security Monitoring", + "undo": { + "type": "idempotent" + } + }, + "DeleteSampleLogGenerationSubscription": { + "tag": "Security Monitoring", + "undo": { + "type": "idempotent" + } + }, "ListSecurityMonitoringSignals": { "tag": "Security Monitoring", "undo": { @@ -6420,6 +6512,12 @@ "type": "idempotent" } }, + "GetSignalEntities": { + "tag": "Security Monitoring", + "undo": { + "type": "safe" + } + }, "EditSecurityMonitoringSignalIncidents": { "tag": "Security Monitoring", "undo": { diff --git a/lib/datadog_api_client/configuration.rb b/lib/datadog_api_client/configuration.rb index 0cac7943cea0..6408b5f82a06 100644 --- a/lib/datadog_api_client/configuration.rb +++ b/lib/datadog_api_client/configuration.rb @@ -307,14 +307,20 @@ def initialize "v2.get_aws_cloud_auth_persona_mapping": false, "v2.list_aws_cloud_auth_persona_mappings": false, "v2.activate_content_pack": false, + "v2.bulk_create_sample_log_generation_subscriptions": false, "v2.bulk_export_security_monitoring_terraform_resources": false, "v2.cancel_historical_job": false, "v2.convert_job_result_to_signal": false, "v2.convert_security_monitoring_terraform_resource": false, + "v2.create_sample_log_generation_subscription": false, + "v2.create_security_monitoring_integration_config": false, "v2.deactivate_content_pack": false, "v2.delete_historical_job": false, + "v2.delete_sample_log_generation_subscription": false, + "v2.delete_security_monitoring_integration_config": false, "v2.export_security_monitoring_terraform_resource": false, "v2.get_content_packs_states": false, + "v2.get_entity_context": false, "v2.get_finding": false, "v2.get_historical_job": false, "v2.get_indicator_of_compromise": false, @@ -322,18 +328,25 @@ def initialize "v2.get_secrets_rules": false, "v2.get_security_monitoring_histsignal": false, "v2.get_security_monitoring_histsignals_by_job_id": false, + "v2.get_security_monitoring_integration_config": false, + "v2.get_signal_entities": false, "v2.list_findings": false, "v2.list_historical_jobs": false, "v2.list_indicators_of_compromise": false, "v2.list_multiple_rulesets": false, + "v2.list_sample_log_generation_subscriptions": false, "v2.list_scanned_assets_metadata": false, "v2.list_security_monitoring_histsignals": false, + "v2.list_security_monitoring_integration_configs": false, "v2.list_vulnerabilities": false, "v2.list_vulnerable_assets": false, "v2.mute_findings": false, "v2.mute_security_findings": false, "v2.run_historical_job": false, "v2.search_security_monitoring_histsignals": false, + "v2.update_security_monitoring_integration_config": false, + "v2.validate_security_monitoring_integration_config": false, + "v2.validate_security_monitoring_integration_credentials": false, "v2.get_code_coverage_branch_summary": false, "v2.get_code_coverage_commit_summary": false, "v2.get_rule_based_view": false, diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 9e8451285fa8..62f629dd2e1a 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -2681,6 +2681,12 @@ def overrides "v2.downtime_update_request_attributes" => "DowntimeUpdateRequestAttributes", "v2.downtime_update_request_data" => "DowntimeUpdateRequestData", "v2.entity_attributes" => "EntityAttributes", + "v2.entity_context_entity" => "EntityContextEntity", + "v2.entity_context_entity_attributes" => "EntityContextEntityAttributes", + "v2.entity_context_page" => "EntityContextPage", + "v2.entity_context_response" => "EntityContextResponse", + "v2.entity_context_response_meta" => "EntityContextResponseMeta", + "v2.entity_context_revision" => "EntityContextRevision", "v2.entity_data" => "EntityData", "v2.entity_meta" => "EntityMeta", "v2.entity_relationships" => "EntityRelationships", @@ -5305,6 +5311,26 @@ def overrides "v2.saml_assertion_attribute" => "SAMLAssertionAttribute", "v2.saml_assertion_attribute_attributes" => "SAMLAssertionAttributeAttributes", "v2.saml_assertion_attributes_type" => "SAMLAssertionAttributesType", + "v2.sample_log_generation_bulk_subscription_attributes" => "SampleLogGenerationBulkSubscriptionAttributes", + "v2.sample_log_generation_bulk_subscription_data" => "SampleLogGenerationBulkSubscriptionData", + "v2.sample_log_generation_bulk_subscription_item_meta" => "SampleLogGenerationBulkSubscriptionItemMeta", + "v2.sample_log_generation_bulk_subscription_request" => "SampleLogGenerationBulkSubscriptionRequest", + "v2.sample_log_generation_bulk_subscription_request_type" => "SampleLogGenerationBulkSubscriptionRequestType", + "v2.sample_log_generation_bulk_subscription_response" => "SampleLogGenerationBulkSubscriptionResponse", + "v2.sample_log_generation_bulk_subscription_result_item" => "SampleLogGenerationBulkSubscriptionResultItem", + "v2.sample_log_generation_duration" => "SampleLogGenerationDuration", + "v2.sample_log_generation_subscription_attributes" => "SampleLogGenerationSubscriptionAttributes", + "v2.sample_log_generation_subscription_create_attributes" => "SampleLogGenerationSubscriptionCreateAttributes", + "v2.sample_log_generation_subscription_create_data" => "SampleLogGenerationSubscriptionCreateData", + "v2.sample_log_generation_subscription_create_request" => "SampleLogGenerationSubscriptionCreateRequest", + "v2.sample_log_generation_subscription_data" => "SampleLogGenerationSubscriptionData", + "v2.sample_log_generation_subscription_request_type" => "SampleLogGenerationSubscriptionRequestType", + "v2.sample_log_generation_subscription_resource_type" => "SampleLogGenerationSubscriptionResourceType", + "v2.sample_log_generation_subscription_response" => "SampleLogGenerationSubscriptionResponse", + "v2.sample_log_generation_subscriptions_response" => "SampleLogGenerationSubscriptionsResponse", + "v2.sample_log_generation_subscriptions_response_meta" => "SampleLogGenerationSubscriptionsResponseMeta", + "v2.sample_log_generation_subscriptions_status_filter" => "SampleLogGenerationSubscriptionsStatusFilter", + "v2.sample_log_generation_subscription_status" => "SampleLogGenerationSubscriptionStatus", "v2.sbom" => "SBOM", "v2.sbom_attributes" => "SBOMAttributes", "v2.sbom_component" => "SBOMComponent", @@ -5465,6 +5491,11 @@ def overrides "v2.security_filter_update_attributes" => "SecurityFilterUpdateAttributes", "v2.security_filter_update_data" => "SecurityFilterUpdateData", "v2.security_filter_update_request" => "SecurityFilterUpdateRequest", + "v2.security_filter_version" => "SecurityFilterVersion", + "v2.security_filter_version_attributes" => "SecurityFilterVersionAttributes", + "v2.security_filter_version_entry" => "SecurityFilterVersionEntry", + "v2.security_filter_versions_response" => "SecurityFilterVersionsResponse", + "v2.security_filter_version_type" => "SecurityFilterVersionType", "v2.security_findings_attributes" => "SecurityFindingsAttributes", "v2.security_findings_data" => "SecurityFindingsData", "v2.security_findings_data_type" => "SecurityFindingsDataType", @@ -5500,6 +5531,22 @@ def overrides "v2.security_monitoring_critical_asset_update_request" => "SecurityMonitoringCriticalAssetUpdateRequest", "v2.security_monitoring_filter" => "SecurityMonitoringFilter", "v2.security_monitoring_filter_action" => "SecurityMonitoringFilterAction", + "v2.security_monitoring_integration_config_attributes" => "SecurityMonitoringIntegrationConfigAttributes", + "v2.security_monitoring_integration_config_create_attributes" => "SecurityMonitoringIntegrationConfigCreateAttributes", + "v2.security_monitoring_integration_config_create_data" => "SecurityMonitoringIntegrationConfigCreateData", + "v2.security_monitoring_integration_config_create_request" => "SecurityMonitoringIntegrationConfigCreateRequest", + "v2.security_monitoring_integration_config_data" => "SecurityMonitoringIntegrationConfigData", + "v2.security_monitoring_integration_config_resource_type" => "SecurityMonitoringIntegrationConfigResourceType", + "v2.security_monitoring_integration_config_response" => "SecurityMonitoringIntegrationConfigResponse", + "v2.security_monitoring_integration_configs_response" => "SecurityMonitoringIntegrationConfigsResponse", + "v2.security_monitoring_integration_config_state" => "SecurityMonitoringIntegrationConfigState", + "v2.security_monitoring_integration_config_update_attributes" => "SecurityMonitoringIntegrationConfigUpdateAttributes", + "v2.security_monitoring_integration_config_update_data" => "SecurityMonitoringIntegrationConfigUpdateData", + "v2.security_monitoring_integration_config_update_request" => "SecurityMonitoringIntegrationConfigUpdateRequest", + "v2.security_monitoring_integration_credentials_validate_attributes" => "SecurityMonitoringIntegrationCredentialsValidateAttributes", + "v2.security_monitoring_integration_credentials_validate_data" => "SecurityMonitoringIntegrationCredentialsValidateData", + "v2.security_monitoring_integration_credentials_validate_request" => "SecurityMonitoringIntegrationCredentialsValidateRequest", + "v2.security_monitoring_integration_type" => "SecurityMonitoringIntegrationType", "v2.security_monitoring_list_rules_response" => "SecurityMonitoringListRulesResponse", "v2.security_monitoring_paginated_suppressions_response" => "SecurityMonitoringPaginatedSuppressionsResponse", "v2.security_monitoring_reference_table" => "SecurityMonitoringReferenceTable", @@ -5827,6 +5874,10 @@ def overrides "v2.shift_data_relationships_user_data_type" => "ShiftDataRelationshipsUserDataType", "v2.shift_data_type" => "ShiftDataType", "v2.shift_included" => "ShiftIncluded", + "v2.signal_entities_attributes" => "SignalEntitiesAttributes", + "v2.signal_entities_data" => "SignalEntitiesData", + "v2.signal_entities_response" => "SignalEntitiesResponse", + "v2.signal_entities_type" => "SignalEntitiesType", "v2.simple_monitor_user_template" => "SimpleMonitorUserTemplate", "v2.single_aggregated_connection_response_array" => "SingleAggregatedConnectionResponseArray", "v2.single_aggregated_connection_response_data" => "SingleAggregatedConnectionResponseData", 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 e14aa320f3f3..11dba03541e8 100644 --- a/lib/datadog_api_client/v2/api/security_monitoring_api.rb +++ b/lib/datadog_api_client/v2/api/security_monitoring_api.rb @@ -237,6 +237,85 @@ def attach_jira_issue_with_http_info(body, opts = {}) return data, status_code, headers end + # Bulk subscribe to sample log generation. + # + # @see #bulk_create_sample_log_generation_subscriptions_with_http_info + def bulk_create_sample_log_generation_subscriptions(body, opts = {}) + data, _status_code, _headers = bulk_create_sample_log_generation_subscriptions_with_http_info(body, opts) + data + end + + # Bulk subscribe to sample log generation. + # + # Subscribe to sample log generation for multiple Cloud SIEM content packs in a single call. + # Each requested content pack is processed independently; the response includes a per-item + # status so partial successes can be inspected. + # + # **Availability**: this endpoint is restricted to Cloud SIEM trial organizations on an + # eligible pricing model. Non-trial orgs receive `403 Forbidden`, the feature flag may also reject + # requests with `400 Bad Request`, and legacy pricing tiers receive per-item responses with `status: not_available`. + # + # @param body [SampleLogGenerationBulkSubscriptionRequest] The content packs to subscribe to and the desired duration of the subscriptions. + # @param opts [Hash] the optional parameters + # @return [Array<(SampleLogGenerationBulkSubscriptionResponse, Integer, Hash)>] SampleLogGenerationBulkSubscriptionResponse data, response status code and response headers + def bulk_create_sample_log_generation_subscriptions_with_http_info(body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.bulk_create_sample_log_generation_subscriptions".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.bulk_create_sample_log_generation_subscriptions") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.bulk_create_sample_log_generation_subscriptions")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.bulk_create_sample_log_generation_subscriptions ...' + 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.bulk_create_sample_log_generation_subscriptions" + end + # resource path + local_var_path = '/api/v2/security_monitoring/sample_log_generation/subscriptions/bulk' + + # 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] || 'SampleLogGenerationBulkSubscriptionResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :bulk_create_sample_log_generation_subscriptions, + :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#bulk_create_sample_log_generation_subscriptions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Bulk delete security monitoring rules. # # @see #bulk_delete_security_monitoring_rules_with_http_info @@ -1239,6 +1318,85 @@ def create_jira_issues_with_http_info(body, opts = {}) return data, status_code, headers end + # Subscribe to sample log generation. + # + # @see #create_sample_log_generation_subscription_with_http_info + def create_sample_log_generation_subscription(body, opts = {}) + data, _status_code, _headers = create_sample_log_generation_subscription_with_http_info(body, opts) + data + end + + # Subscribe to sample log generation. + # + # Subscribe to sample log generation for a Cloud SIEM content pack. Sample logs for the + # requested content pack are injected into the Logs platform for the duration of the subscription, + # so detection rules can be exercised without onboarding the underlying integration first. + # + # **Availability**: this endpoint is restricted to Cloud SIEM trial organizations on an + # eligible pricing model. Non-trial orgs receive `403 Forbidden`, the feature flag may also reject + # requests with `400 Bad Request`, and legacy pricing tiers receive a response with `status: not_available`. + # + # @param body [SampleLogGenerationSubscriptionCreateRequest] The content pack to subscribe to and the desired duration of the subscription. + # @param opts [Hash] the optional parameters + # @return [Array<(SampleLogGenerationSubscriptionResponse, Integer, Hash)>] SampleLogGenerationSubscriptionResponse data, response status code and response headers + def create_sample_log_generation_subscription_with_http_info(body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.create_sample_log_generation_subscription".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_sample_log_generation_subscription") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_sample_log_generation_subscription")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.create_sample_log_generation_subscription ...' + 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.create_sample_log_generation_subscription" + end + # resource path + local_var_path = '/api/v2/security_monitoring/sample_log_generation/subscriptions' + + # 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] || 'SampleLogGenerationSubscriptionResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :create_sample_log_generation_subscription, + :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#create_sample_log_generation_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Create a security filter. # # @see #create_security_filter_with_http_info @@ -1376,6 +1534,81 @@ def create_security_monitoring_critical_asset_with_http_info(body, opts = {}) return data, status_code, headers end + # Create an entity context sync configuration. + # + # @see #create_security_monitoring_integration_config_with_http_info + def create_security_monitoring_integration_config(body, opts = {}) + data, _status_code, _headers = create_security_monitoring_integration_config_with_http_info(body, opts) + data + end + + # Create an entity context sync configuration. + # + # Create a new entity context sync configuration so Cloud SIEM can ingest entities from an external + # source. The credentials provided in `secrets` are validated against the source before the configuration + # is stored and never returned in subsequent responses. + # + # @param body [SecurityMonitoringIntegrationConfigCreateRequest] The definition of the new integration configuration. + # @param opts [Hash] the optional parameters + # @return [Array<(SecurityMonitoringIntegrationConfigResponse, Integer, Hash)>] SecurityMonitoringIntegrationConfigResponse data, response status code and response headers + def create_security_monitoring_integration_config_with_http_info(body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.create_security_monitoring_integration_config".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_security_monitoring_integration_config") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_security_monitoring_integration_config")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.create_security_monitoring_integration_config ...' + 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.create_security_monitoring_integration_config" + end + # resource path + local_var_path = '/api/v2/security_monitoring/configuration/integration_config' + + # 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] || 'SecurityMonitoringIntegrationConfigResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :create_security_monitoring_integration_config, + :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#create_security_monitoring_integration_config\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Create a detection rule. # # @see #create_security_monitoring_rule_with_http_info @@ -1857,6 +2090,82 @@ def delete_historical_job_with_http_info(job_id, opts = {}) return data, status_code, headers end + # Unsubscribe from sample log generation. + # + # @see #delete_sample_log_generation_subscription_with_http_info + def delete_sample_log_generation_subscription(content_pack_id, opts = {}) + data, _status_code, _headers = delete_sample_log_generation_subscription_with_http_info(content_pack_id, opts) + data + end + + # Unsubscribe from sample log generation. + # + # Unsubscribe from sample log generation for a Cloud SIEM content pack. + # After unsubscribing, no more sample logs are generated for the requested content pack. + # + # **Availability**: this endpoint is restricted to Cloud SIEM trial organizations on an + # eligible pricing model. Non-trial orgs receive `403 Forbidden`, the feature flag may also reject + # requests with `400 Bad Request`, and legacy pricing tiers receive a response with `status: not_available`. + # + # @param content_pack_id [String] The identifier of the Cloud SIEM content pack to operate on (for example, `aws-cloudtrail`). + # @param opts [Hash] the optional parameters + # @return [Array<(SampleLogGenerationSubscriptionResponse, Integer, Hash)>] SampleLogGenerationSubscriptionResponse data, response status code and response headers + def delete_sample_log_generation_subscription_with_http_info(content_pack_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.delete_sample_log_generation_subscription".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_sample_log_generation_subscription") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_sample_log_generation_subscription")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.delete_sample_log_generation_subscription ...' + end + # verify the required parameter 'content_pack_id' is set + if @api_client.config.client_side_validation && content_pack_id.nil? + fail ArgumentError, "Missing the required parameter 'content_pack_id' when calling SecurityMonitoringAPI.delete_sample_log_generation_subscription" + end + # resource path + local_var_path = '/api/v2/security_monitoring/sample_log_generation/subscriptions/{content_pack_id}'.sub('{content_pack_id}', CGI.escape(content_pack_id.to_s).gsub('%2F', '/')) + + # 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] || 'SampleLogGenerationSubscriptionResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :delete_sample_log_generation_subscription, + :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::Delete, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SecurityMonitoringAPI#delete_sample_log_generation_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Delete a security filter. # # @see #delete_security_filter_with_http_info @@ -1987,6 +2296,78 @@ def delete_security_monitoring_critical_asset_with_http_info(critical_asset_id, return data, status_code, headers end + # Delete an entity context sync configuration. + # + # @see #delete_security_monitoring_integration_config_with_http_info + def delete_security_monitoring_integration_config(integration_config_id, opts = {}) + delete_security_monitoring_integration_config_with_http_info(integration_config_id, opts) + nil + end + + # Delete an entity context sync configuration. + # + # Delete an entity context sync configuration. Cloud SIEM stops ingesting entities from this source, + # and the credentials stored for the configuration are removed from the secrets store. + # + # @param integration_config_id [String] The ID of the entity context sync configuration. + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_security_monitoring_integration_config_with_http_info(integration_config_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.delete_security_monitoring_integration_config".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_security_monitoring_integration_config") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_security_monitoring_integration_config")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.delete_security_monitoring_integration_config ...' + end + # verify the required parameter 'integration_config_id' is set + if @api_client.config.client_side_validation && integration_config_id.nil? + fail ArgumentError, "Missing the required parameter 'integration_config_id' when calling SecurityMonitoringAPI.delete_security_monitoring_integration_config" + end + # resource path + local_var_path = '/api/v2/security_monitoring/configuration/integration_config/{integration_config_id}'.sub('{integration_config_id}', CGI.escape(integration_config_id.to_s).gsub('%2F', '/')) + + # 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(['*/*']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :delete_security_monitoring_integration_config, + :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::Delete, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SecurityMonitoringAPI#delete_security_monitoring_integration_config\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Delete an existing rule. # # @see #delete_security_monitoring_rule_with_http_info @@ -2826,32 +3207,113 @@ def get_custom_framework(handle, version, opts = {}) data end - # Get a custom framework. + # Get a custom framework. + # + # Get a custom framework. + # + # @param handle [String] The framework handle + # @param version [String] The framework version + # @param opts [Hash] the optional parameters + # @return [Array<(GetCustomFrameworkResponse, Integer, Hash)>] GetCustomFrameworkResponse data, response status code and response headers + def get_custom_framework_with_http_info(handle, version, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.get_custom_framework ...' + end + # verify the required parameter 'handle' is set + if @api_client.config.client_side_validation && handle.nil? + fail ArgumentError, "Missing the required parameter 'handle' when calling SecurityMonitoringAPI.get_custom_framework" + end + # verify the required parameter 'version' is set + if @api_client.config.client_side_validation && version.nil? + fail ArgumentError, "Missing the required parameter 'version' when calling SecurityMonitoringAPI.get_custom_framework" + end + # resource path + local_var_path = '/api/v2/cloud_security_management/custom_frameworks/{handle}/{version}'.sub('{handle}', CGI.escape(handle.to_s).gsub('%2F', '/')).sub('{version}', CGI.escape(version.to_s).gsub('%2F', '/')) + + # 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] || 'GetCustomFrameworkResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :get_custom_framework, + :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_custom_framework\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get entity context. + # + # @see #get_entity_context_with_http_info + def get_entity_context(opts = {}) + data, _status_code, _headers = get_entity_context_with_http_info(opts) + data + end + + # Get entity context. # - # Get a custom framework. + # Search the Cloud SIEM entity context store for entities that match a query, and return the historical + # revisions of each entity in the requested time range. The endpoint can either return revisions across an + # interval (`from` / `to`) or the snapshot of each entity at a single point in time (`as_of`); the two modes + # are mutually exclusive. # - # @param handle [String] The framework handle - # @param version [String] The framework version # @param opts [Hash] the optional parameters - # @return [Array<(GetCustomFrameworkResponse, Integer, Hash)>] GetCustomFrameworkResponse data, response status code and response headers - def get_custom_framework_with_http_info(handle, version, opts = {}) + # @option opts [String] :query A free-text query (for example, an email address or principal ID) used to filter the entities returned. + # @option opts [String] :from The start of the time range to query, as an RFC3339 timestamp or a relative time (for example, `now-7d`). Defaults to `now-7d`. Ignored when `as_of` is set. + # @option opts [String] :to The end of the time range to query, as an RFC3339 timestamp or a relative time (for example, `now`). Defaults to `now`. Ignored when `as_of` is set. + # @option opts [String] :as_of A point in time at which to query the entity revisions, as an RFC3339 timestamp, a Unix timestamp (in seconds), or a relative time (for example, `now-1d`). When set, `from` and `to` are ignored. Cannot be combined with custom `from` / `to` values. + # @option opts [Integer] :limit The maximum number of entities to return. + # @option opts [String] :page_token An opaque token used to fetch the next page of results, as returned in `meta.page.next_token` of a previous response. + # @return [Array<(EntityContextResponse, Integer, Hash)>] EntityContextResponse data, response status code and response headers + def get_entity_context_with_http_info(opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.get_entity_context".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_entity_context") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_entity_context")) + end if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.get_custom_framework ...' - end - # verify the required parameter 'handle' is set - if @api_client.config.client_side_validation && handle.nil? - fail ArgumentError, "Missing the required parameter 'handle' when calling SecurityMonitoringAPI.get_custom_framework" - end - # verify the required parameter 'version' is set - if @api_client.config.client_side_validation && version.nil? - fail ArgumentError, "Missing the required parameter 'version' when calling SecurityMonitoringAPI.get_custom_framework" + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.get_entity_context ...' end # resource path - local_var_path = '/api/v2/cloud_security_management/custom_frameworks/{handle}/{version}'.sub('{handle}', CGI.escape(handle.to_s).gsub('%2F', '/')).sub('{version}', CGI.escape(version.to_s).gsub('%2F', '/')) + local_var_path = '/api/v2/security_monitoring/entity_context' # query parameters query_params = opts[:query_params] || {} + query_params[:'query'] = opts[:'query'] if !opts[:'query'].nil? + query_params[:'from'] = opts[:'from'] if !opts[:'from'].nil? + query_params[:'to'] = opts[:'to'] if !opts[:'to'].nil? + query_params[:'as_of'] = opts[:'as_of'] if !opts[:'as_of'].nil? + query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? + query_params[:'page_token'] = opts[:'page_token'] if !opts[:'page_token'].nil? # header parameters header_params = opts[:header_params] || {} @@ -2865,13 +3327,13 @@ def get_custom_framework_with_http_info(handle, version, opts = {}) post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] || 'GetCustomFrameworkResponse' + return_type = opts[:debug_return_type] || 'EntityContextResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( - :operation => :get_custom_framework, + :operation => :get_entity_context, :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -2883,7 +3345,7 @@ def get_custom_framework_with_http_info(handle, version, opts = {}) 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_custom_framework\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: SecurityMonitoringAPI#get_entity_context\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end @@ -3757,6 +4219,77 @@ def get_security_monitoring_histsignals_by_job_id_with_http_info(job_id, opts = return data, status_code, headers end + # Get an entity context sync configuration. + # + # @see #get_security_monitoring_integration_config_with_http_info + def get_security_monitoring_integration_config(integration_config_id, opts = {}) + data, _status_code, _headers = get_security_monitoring_integration_config_with_http_info(integration_config_id, opts) + data + end + + # Get an entity context sync configuration. + # + # Get the details of a specific entity context sync configuration. + # + # @param integration_config_id [String] The ID of the entity context sync configuration. + # @param opts [Hash] the optional parameters + # @return [Array<(SecurityMonitoringIntegrationConfigResponse, Integer, Hash)>] SecurityMonitoringIntegrationConfigResponse data, response status code and response headers + def get_security_monitoring_integration_config_with_http_info(integration_config_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.get_security_monitoring_integration_config".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_security_monitoring_integration_config") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_security_monitoring_integration_config")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.get_security_monitoring_integration_config ...' + end + # verify the required parameter 'integration_config_id' is set + if @api_client.config.client_side_validation && integration_config_id.nil? + fail ArgumentError, "Missing the required parameter 'integration_config_id' when calling SecurityMonitoringAPI.get_security_monitoring_integration_config" + end + # resource path + local_var_path = '/api/v2/security_monitoring/configuration/integration_config/{integration_config_id}'.sub('{integration_config_id}', CGI.escape(integration_config_id.to_s).gsub('%2F', '/')) + + # 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] || 'SecurityMonitoringIntegrationConfigResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :get_security_monitoring_integration_config, + :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_security_monitoring_integration_config\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Get a rule's details. # # @see #get_security_monitoring_rule_with_http_info @@ -3952,6 +4485,82 @@ def get_security_monitoring_suppression_with_http_info(suppression_id, opts = {} return data, status_code, headers end + # Get entities related to a signal. + # + # @see #get_signal_entities_with_http_info + def get_signal_entities(signal_id, opts = {}) + data, _status_code, _headers = get_signal_entities_with_http_info(signal_id, opts) + data + end + + # Get entities related to a signal. + # + # Get the list of entities related to a security signal, captured at the signal's timestamp. + # + # @param signal_id [String] The ID of the signal. + # @param opts [Hash] the optional parameters + # @option opts [Integer] :limit The maximum number of entities to return. + # @return [Array<(SignalEntitiesResponse, Integer, Hash)>] SignalEntitiesResponse data, response status code and response headers + def get_signal_entities_with_http_info(signal_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.get_signal_entities".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_signal_entities") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_signal_entities")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.get_signal_entities ...' + end + # verify the required parameter 'signal_id' is set + if @api_client.config.client_side_validation && signal_id.nil? + fail ArgumentError, "Missing the required parameter 'signal_id' when calling SecurityMonitoringAPI.get_signal_entities" + end + if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 1000 + fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling SecurityMonitoringAPI.get_signal_entities, must be smaller than or equal to 1000.' + end + # resource path + local_var_path = '/api/v2/security_monitoring/signals/{signal_id}/entities'.sub('{signal_id}', CGI.escape(signal_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? + + # 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] || 'SignalEntitiesResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :get_signal_entities, + :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_signal_entities\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Get details of a signal-based notification rule. # # @see #get_signal_notification_rule_with_http_info @@ -4974,6 +5583,88 @@ def list_multiple_rulesets_with_http_info(body, opts = {}) return data, status_code, headers end + # Get sample log generation subscriptions. + # + # @see #list_sample_log_generation_subscriptions_with_http_info + def list_sample_log_generation_subscriptions(opts = {}) + data, _status_code, _headers = list_sample_log_generation_subscriptions_with_http_info(opts) + data + end + + # Get sample log generation subscriptions. + # + # Get the sample log generation subscriptions for the organization. + # Sample log generation injects representative example logs for a given Cloud SIEM content pack into the Logs platform, + # which can be used to test detection rules without onboarding the underlying integration first. + # + # **Availability**: this endpoint is restricted to Cloud SIEM trial organizations on an eligible + # pricing model. Other organizations receive a `403 Forbidden` (non-trial orgs) or a `400 Bad Request` + # (feature disabled), and legacy pricing tiers receive a response with `status: not_available`. + # + # @param opts [Hash] the optional parameters + # @option opts [SampleLogGenerationSubscriptionsStatusFilter] :status Filter the subscriptions by status. Use `active` to return only currently active subscriptions, or `all` to return every subscription including expired ones. Ignored when `start_timestamp` is provided. Defaults to `active`. + # @option opts [Time] :start_timestamp The start of the time range, as an RFC3339 timestamp. When provided, the response includes every subscription that was active at any point in `[start_timestamp, end_timestamp]`, and the `status` filter is ignored. + # @option opts [Time] :end_timestamp The end of the time range, as an RFC3339 timestamp. Ignored unless `start_timestamp` is set. Defaults to the current time when `start_timestamp` is provided. + # @return [Array<(SampleLogGenerationSubscriptionsResponse, Integer, Hash)>] SampleLogGenerationSubscriptionsResponse data, response status code and response headers + def list_sample_log_generation_subscriptions_with_http_info(opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.list_sample_log_generation_subscriptions".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_sample_log_generation_subscriptions") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_sample_log_generation_subscriptions")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.list_sample_log_generation_subscriptions ...' + end + allowable_values = ['active', 'all'] + if @api_client.config.client_side_validation && opts[:'status'] && !allowable_values.include?(opts[:'status']) + fail ArgumentError, "invalid value for \"status\", must be one of #{allowable_values}" + end + # resource path + local_var_path = '/api/v2/security_monitoring/sample_log_generation/subscriptions' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil? + query_params[:'start_timestamp'] = opts[:'start_timestamp'] if !opts[:'start_timestamp'].nil? + query_params[:'end_timestamp'] = opts[:'end_timestamp'] if !opts[:'end_timestamp'].nil? + + # 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] || 'SampleLogGenerationSubscriptionsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :list_sample_log_generation_subscriptions, + :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#list_sample_log_generation_subscriptions\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 @@ -5046,26 +5737,86 @@ def list_scanned_assets_metadata_with_http_info(opts = {}) end if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.list_scanned_assets_metadata ...' - end - if @api_client.config.client_side_validation && !opts[:'page_number'].nil? && opts[:'page_number'] < 1 - fail ArgumentError, 'invalid value for "opts[:"page_number"]" when calling SecurityMonitoringAPI.list_scanned_assets_metadata, must be greater than or equal to 1.' - end - allowable_values = ['Host', 'HostImage', 'Image'] - if @api_client.config.client_side_validation && opts[:'filter_asset_type'] && !allowable_values.include?(opts[:'filter_asset_type']) - fail ArgumentError, "invalid value for \"filter_asset_type\", must be one of #{allowable_values}" + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.list_scanned_assets_metadata ...' + end + if @api_client.config.client_side_validation && !opts[:'page_number'].nil? && opts[:'page_number'] < 1 + fail ArgumentError, 'invalid value for "opts[:"page_number"]" when calling SecurityMonitoringAPI.list_scanned_assets_metadata, must be greater than or equal to 1.' + end + allowable_values = ['Host', 'HostImage', 'Image'] + if @api_client.config.client_side_validation && opts[:'filter_asset_type'] && !allowable_values.include?(opts[:'filter_asset_type']) + fail ArgumentError, "invalid value for \"filter_asset_type\", must be one of #{allowable_values}" + end + # resource path + local_var_path = '/api/v2/security/scanned-assets-metadata' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'page[token]'] = opts[:'page_token'] if !opts[:'page_token'].nil? + query_params[:'page[number]'] = opts[:'page_number'] if !opts[:'page_number'].nil? + query_params[:'filter[asset.type]'] = opts[:'filter_asset_type'] if !opts[:'filter_asset_type'].nil? + query_params[:'filter[asset.name]'] = opts[:'filter_asset_name'] if !opts[:'filter_asset_name'].nil? + query_params[:'filter[last_success.origin]'] = opts[:'filter_last_success_origin'] if !opts[:'filter_last_success_origin'].nil? + query_params[:'filter[last_success.env]'] = opts[:'filter_last_success_env'] if !opts[:'filter_last_success_env'].nil? + + # 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] || 'ScannedAssetsMetadata' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :list_scanned_assets_metadata, + :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#list_scanned_assets_metadata\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get all security filters. + # + # @see #list_security_filters_with_http_info + def list_security_filters(opts = {}) + data, _status_code, _headers = list_security_filters_with_http_info(opts) + data + end + + # Get all security filters. + # + # Get the list of configured security filters with their definitions. + # + # @param opts [Hash] the optional parameters + # @return [Array<(SecurityFiltersResponse, Integer, Hash)>] SecurityFiltersResponse data, response status code and response headers + def list_security_filters_with_http_info(opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.list_security_filters ...' end # resource path - local_var_path = '/api/v2/security/scanned-assets-metadata' + local_var_path = '/api/v2/security_monitoring/configuration/security_filters' # query parameters query_params = opts[:query_params] || {} - query_params[:'page[token]'] = opts[:'page_token'] if !opts[:'page_token'].nil? - query_params[:'page[number]'] = opts[:'page_number'] if !opts[:'page_number'].nil? - query_params[:'filter[asset.type]'] = opts[:'filter_asset_type'] if !opts[:'filter_asset_type'].nil? - query_params[:'filter[asset.name]'] = opts[:'filter_asset_name'] if !opts[:'filter_asset_name'].nil? - query_params[:'filter[last_success.origin]'] = opts[:'filter_last_success_origin'] if !opts[:'filter_last_success_origin'].nil? - query_params[:'filter[last_success.env]'] = opts[:'filter_last_success_env'] if !opts[:'filter_last_success_env'].nil? # header parameters header_params = opts[:header_params] || {} @@ -5079,13 +5830,13 @@ def list_scanned_assets_metadata_with_http_info(opts = {}) post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] || 'ScannedAssetsMetadata' + return_type = opts[:debug_return_type] || 'SecurityFiltersResponse' # auth_names - auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( - :operation => :list_scanned_assets_metadata, + :operation => :list_security_filters, :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -5097,32 +5848,34 @@ def list_scanned_assets_metadata_with_http_info(opts = {}) 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#list_scanned_assets_metadata\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: SecurityMonitoringAPI#list_security_filters\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Get all security filters. + # Get the version history of security filters. # - # @see #list_security_filters_with_http_info - def list_security_filters(opts = {}) - data, _status_code, _headers = list_security_filters_with_http_info(opts) + # @see #list_security_filter_versions_with_http_info + def list_security_filter_versions(opts = {}) + data, _status_code, _headers = list_security_filter_versions_with_http_info(opts) data end - # Get all security filters. + # Get the version history of security filters. # - # Get the list of configured security filters with their definitions. + # Get the configured security filters at each historical version of the configuration. + # Each entry in the response represents the set of all security filters at a given version, + # ordered from the most recent version to the oldest. # # @param opts [Hash] the optional parameters - # @return [Array<(SecurityFiltersResponse, Integer, Hash)>] SecurityFiltersResponse data, response status code and response headers - def list_security_filters_with_http_info(opts = {}) + # @return [Array<(SecurityFilterVersionsResponse, Integer, Hash)>] SecurityFilterVersionsResponse data, response status code and response headers + def list_security_filter_versions_with_http_info(opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.list_security_filters ...' + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.list_security_filter_versions ...' end # resource path - local_var_path = '/api/v2/security_monitoring/configuration/security_filters' + local_var_path = '/api/v2/security_monitoring/configuration/security_filters/versions' # query parameters query_params = opts[:query_params] || {} @@ -5139,13 +5892,13 @@ def list_security_filters_with_http_info(opts = {}) post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] || 'SecurityFiltersResponse' + return_type = opts[:debug_return_type] || 'SecurityFilterVersionsResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( - :operation => :list_security_filters, + :operation => :list_security_filter_versions, :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -5157,7 +5910,7 @@ def list_security_filters_with_http_info(opts = {}) 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#list_security_filters\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: SecurityMonitoringAPI#list_security_filter_versions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end @@ -5412,6 +6165,80 @@ def list_security_monitoring_histsignals_with_http_info(opts = {}) return data, status_code, headers end + # List entity context sync configurations. + # + # @see #list_security_monitoring_integration_configs_with_http_info + def list_security_monitoring_integration_configs(opts = {}) + data, _status_code, _headers = list_security_monitoring_integration_configs_with_http_info(opts) + data + end + + # List entity context sync configurations. + # + # List the entity context sync configurations for Cloud SIEM. Each configuration connects Cloud SIEM + # to an external source that provides entities (for example, users from an identity provider) for use + # in signals and the entity explorer. + # + # @param opts [Hash] the optional parameters + # @option opts [SecurityMonitoringIntegrationType] :filter_integration_type Filter the entity context sync configurations by source type. + # @return [Array<(SecurityMonitoringIntegrationConfigsResponse, Integer, Hash)>] SecurityMonitoringIntegrationConfigsResponse data, response status code and response headers + def list_security_monitoring_integration_configs_with_http_info(opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.list_security_monitoring_integration_configs".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_security_monitoring_integration_configs") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_security_monitoring_integration_configs")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.list_security_monitoring_integration_configs ...' + end + allowable_values = ['GOOGLE_WORKSPACE', 'OKTA', 'ENTRA_ID'] + if @api_client.config.client_side_validation && opts[:'filter_integration_type'] && !allowable_values.include?(opts[:'filter_integration_type']) + fail ArgumentError, "invalid value for \"filter_integration_type\", must be one of #{allowable_values}" + end + # resource path + local_var_path = '/api/v2/security_monitoring/configuration/integration_config' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'filter[integration_type]'] = opts[:'filter_integration_type'] if !opts[:'filter_integration_type'].nil? + + # 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] || 'SecurityMonitoringIntegrationConfigsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :list_security_monitoring_integration_configs, + :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#list_security_monitoring_integration_configs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # List rules. # # @see #list_security_monitoring_rules_with_http_info @@ -7116,6 +7943,84 @@ def update_security_monitoring_critical_asset_with_http_info(critical_asset_id, return data, status_code, headers end + # Update an entity context sync configuration. + # + # @see #update_security_monitoring_integration_config_with_http_info + def update_security_monitoring_integration_config(integration_config_id, body, opts = {}) + data, _status_code, _headers = update_security_monitoring_integration_config_with_http_info(integration_config_id, body, opts) + data + end + + # Update an entity context sync configuration. + # + # Update an existing entity context sync configuration. Supports partial updates; only the fields provided in the request body are modified. + # + # @param integration_config_id [String] The ID of the entity context sync configuration. + # @param body [SecurityMonitoringIntegrationConfigUpdateRequest] The fields to update on the integration configuration. + # @param opts [Hash] the optional parameters + # @return [Array<(SecurityMonitoringIntegrationConfigResponse, Integer, Hash)>] SecurityMonitoringIntegrationConfigResponse data, response status code and response headers + def update_security_monitoring_integration_config_with_http_info(integration_config_id, body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.update_security_monitoring_integration_config".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.update_security_monitoring_integration_config") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.update_security_monitoring_integration_config")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.update_security_monitoring_integration_config ...' + end + # verify the required parameter 'integration_config_id' is set + if @api_client.config.client_side_validation && integration_config_id.nil? + fail ArgumentError, "Missing the required parameter 'integration_config_id' when calling SecurityMonitoringAPI.update_security_monitoring_integration_config" + 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.update_security_monitoring_integration_config" + end + # resource path + local_var_path = '/api/v2/security_monitoring/configuration/integration_config/{integration_config_id}'.sub('{integration_config_id}', CGI.escape(integration_config_id.to_s).gsub('%2F', '/')) + + # 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] || 'SecurityMonitoringIntegrationConfigResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :update_security_monitoring_integration_config, + :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::Patch, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SecurityMonitoringAPI#update_security_monitoring_integration_config\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Update an existing rule. # # @see #update_security_monitoring_rule_with_http_info @@ -7263,6 +8168,152 @@ def update_security_monitoring_suppression_with_http_info(suppression_id, body, return data, status_code, headers end + # Validate an entity context sync configuration. + # + # @see #validate_security_monitoring_integration_config_with_http_info + def validate_security_monitoring_integration_config(integration_config_id, opts = {}) + validate_security_monitoring_integration_config_with_http_info(integration_config_id, opts) + nil + end + + # Validate an entity context sync configuration. + # + # Validate the credentials currently stored on an existing entity context sync configuration. + # Returns a 200 status code if the credentials are still valid against the external entity source. + # + # @param integration_config_id [String] The ID of the entity context sync configuration. + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def validate_security_monitoring_integration_config_with_http_info(integration_config_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.validate_security_monitoring_integration_config".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.validate_security_monitoring_integration_config") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.validate_security_monitoring_integration_config")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.validate_security_monitoring_integration_config ...' + end + # verify the required parameter 'integration_config_id' is set + if @api_client.config.client_side_validation && integration_config_id.nil? + fail ArgumentError, "Missing the required parameter 'integration_config_id' when calling SecurityMonitoringAPI.validate_security_monitoring_integration_config" + end + # resource path + local_var_path = '/api/v2/security_monitoring/configuration/integration_config/{integration_config_id}/validate'.sub('{integration_config_id}', CGI.escape(integration_config_id.to_s).gsub('%2F', '/')) + + # 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(['*/*']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :validate_security_monitoring_integration_config, + :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#validate_security_monitoring_integration_config\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Validate entity context sync credentials. + # + # @see #validate_security_monitoring_integration_credentials_with_http_info + def validate_security_monitoring_integration_credentials(body, opts = {}) + validate_security_monitoring_integration_credentials_with_http_info(body, opts) + nil + end + + # Validate entity context sync credentials. + # + # Validate a set of credentials against the external entity source before creating a sync configuration. + # Returns a 200 status code if the credentials are valid. + # + # @param body [SecurityMonitoringIntegrationCredentialsValidateRequest] The credentials to validate. + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def validate_security_monitoring_integration_credentials_with_http_info(body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.validate_security_monitoring_integration_credentials".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.validate_security_monitoring_integration_credentials") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.validate_security_monitoring_integration_credentials")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.validate_security_monitoring_integration_credentials ...' + 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.validate_security_monitoring_integration_credentials" + end + # resource path + local_var_path = '/api/v2/security_monitoring/configuration/integration_config/validate' + + # 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(['*/*']) + # 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] + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :validate_security_monitoring_integration_credentials, + :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#validate_security_monitoring_integration_credentials\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Validate a detection rule. # # @see #validate_security_monitoring_rule_with_http_info diff --git a/lib/datadog_api_client/v2/models/entity_context_entity.rb b/lib/datadog_api_client/v2/models/entity_context_entity.rb new file mode 100644 index 000000000000..e253da4ebbc2 --- /dev/null +++ b/lib/datadog_api_client/v2/models/entity_context_entity.rb @@ -0,0 +1,166 @@ +=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 + # A single entity returned by the entity context endpoint. + class EntityContextEntity + include BaseGenericModel + + # The attributes of an entity context entry, grouping all the historical revisions of the entity. + attr_reader :attributes + + # The unique identifier of the entity. + attr_reader :id + + # The type of the entity. Reflects the underlying entity kind from the entity context store + # (for example, `siem_entity_identity` for identities). Defaults to `entity` when the kind is unknown. + 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' => :'EntityContextEntityAttributes', + :'id' => :'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::EntityContextEntity` 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 @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + 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/entity_context_entity_attributes.rb b/lib/datadog_api_client/v2/models/entity_context_entity_attributes.rb new file mode 100644 index 000000000000..8c0e2b06dea0 --- /dev/null +++ b/lib/datadog_api_client/v2/models/entity_context_entity_attributes.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 + # The attributes of an entity context entry, grouping all the historical revisions of the entity. + class EntityContextEntityAttributes + include BaseGenericModel + + # The historical revisions of the entity, ordered chronologically. + attr_reader :revisions + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'revisions' => :'revisions' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'revisions' => :'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::EntityContextEntityAttributes` 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?(:'revisions') + if (value = attributes[:'revisions']).is_a?(Array) + self.revisions = 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 @revisions.nil? + true + end + + # Custom attribute writer method with validation + # @param revisions [Object] Object to be assigned + # @!visibility private + def revisions=(revisions) + if revisions.nil? + fail ArgumentError, 'invalid value for "revisions", revisions cannot be nil.' + end + @revisions = revisions + 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 && + revisions == o.revisions && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [revisions, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/entity_context_page.rb b/lib/datadog_api_client/v2/models/entity_context_page.rb new file mode 100644 index 000000000000..5558829394fe --- /dev/null +++ b/lib/datadog_api_client/v2/models/entity_context_page.rb @@ -0,0 +1,123 @@ +=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 + # Pagination metadata for the entity context response. + class EntityContextPage + include BaseGenericModel + + # An opaque token to pass as `page_token` in a subsequent request to retrieve the next page of results. Empty when there are no more results. + attr_reader :next_token + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'next_token' => :'next_token' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'next_token' => :'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::EntityContextPage` 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?(:'next_token') + self.next_token = attributes[:'next_token'] + 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 @next_token.nil? + true + end + + # Custom attribute writer method with validation + # @param next_token [Object] Object to be assigned + # @!visibility private + def next_token=(next_token) + if next_token.nil? + fail ArgumentError, 'invalid value for "next_token", next_token cannot be nil.' + end + @next_token = next_token + 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 && + next_token == o.next_token && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [next_token, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/entity_context_response.rb b/lib/datadog_api_client/v2/models/entity_context_response.rb new file mode 100644 index 000000000000..06d1c8faf070 --- /dev/null +++ b/lib/datadog_api_client/v2/models/entity_context_response.rb @@ -0,0 +1,146 @@ +=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 + # Response from the entity context endpoint, containing the matching entities and pagination metadata. + class EntityContextResponse + include BaseGenericModel + + # The list of entities matching the query. + attr_reader :data + + # Metadata returned alongside the entity context response. + attr_reader :meta + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data', + :'meta' => :'meta' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array', + :'meta' => :'EntityContextResponseMeta' + } + 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::EntityContextResponse` 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 + + if attributes.key?(:'meta') + self.meta = attributes[:'meta'] + 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? + return false if @meta.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 + + # Custom attribute writer method with validation + # @param meta [Object] Object to be assigned + # @!visibility private + def meta=(meta) + if meta.nil? + fail ArgumentError, 'invalid value for "meta", meta cannot be nil.' + end + @meta = meta + 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 && + meta == o.meta && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, meta, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/entity_context_response_meta.rb b/lib/datadog_api_client/v2/models/entity_context_response_meta.rb new file mode 100644 index 000000000000..218d4929dc67 --- /dev/null +++ b/lib/datadog_api_client/v2/models/entity_context_response_meta.rb @@ -0,0 +1,148 @@ +=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 + # Metadata returned alongside the entity context response. + class EntityContextResponseMeta + include BaseGenericModel + + # Pagination metadata for the entity context response. + attr_reader :page + + # The total number of entities matching the query, irrespective of pagination. + attr_reader :total_count + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'page' => :'page', + :'total_count' => :'total_count' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'page' => :'EntityContextPage', + :'total_count' => :'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::EntityContextResponseMeta` 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?(:'page') + self.page = attributes[:'page'] + end + + if attributes.key?(:'total_count') + self.total_count = attributes[:'total_count'] + 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 @page.nil? + return false if @total_count.nil? + return false if @total_count > 2147483647 + true + end + + # Custom attribute writer method with validation + # @param page [Object] Object to be assigned + # @!visibility private + def page=(page) + if page.nil? + fail ArgumentError, 'invalid value for "page", page cannot be nil.' + end + @page = page + end + + # Custom attribute writer method with validation + # @param total_count [Object] Object to be assigned + # @!visibility private + def total_count=(total_count) + if total_count.nil? + fail ArgumentError, 'invalid value for "total_count", total_count cannot be nil.' + end + if total_count > 2147483647 + fail ArgumentError, 'invalid value for "total_count", must be smaller than or equal to 2147483647.' + end + @total_count = total_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 && + page == o.page && + total_count == o.total_count && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [page, total_count, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/entity_context_revision.rb b/lib/datadog_api_client/v2/models/entity_context_revision.rb new file mode 100644 index 000000000000..8321f3a0debd --- /dev/null +++ b/lib/datadog_api_client/v2/models/entity_context_revision.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 + # A single historical revision of an entity, including the time range during which the revision was observed. + class EntityContextRevision + include BaseGenericModel + + # The set of attributes recorded for the entity at this revision. The keys depend on the kind of entity. + attr_reader :attributes + + # The first time the entity was observed at this revision. + attr_reader :first_seen_at + + # The last time the entity was observed at this revision. + attr_reader :last_seen_at + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'first_seen_at' => :'first_seen_at', + :'last_seen_at' => :'last_seen_at' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'Hash', + :'first_seen_at' => :'Time', + :'last_seen_at' => :'Time' + } + 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::EntityContextRevision` 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?(:'first_seen_at') + self.first_seen_at = attributes[:'first_seen_at'] + end + + if attributes.key?(:'last_seen_at') + self.last_seen_at = attributes[:'last_seen_at'] + 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 @attributes.nil? + return false if @first_seen_at.nil? + return false if @last_seen_at.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param first_seen_at [Object] Object to be assigned + # @!visibility private + def first_seen_at=(first_seen_at) + if first_seen_at.nil? + fail ArgumentError, 'invalid value for "first_seen_at", first_seen_at cannot be nil.' + end + @first_seen_at = first_seen_at + end + + # Custom attribute writer method with validation + # @param last_seen_at [Object] Object to be assigned + # @!visibility private + def last_seen_at=(last_seen_at) + if last_seen_at.nil? + fail ArgumentError, 'invalid value for "last_seen_at", last_seen_at cannot be nil.' + end + @last_seen_at = last_seen_at + 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 && + first_seen_at == o.first_seen_at && + last_seen_at == o.last_seen_at && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, first_seen_at, last_seen_at, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/sample_log_generation_bulk_subscription_attributes.rb b/lib/datadog_api_client/v2/models/sample_log_generation_bulk_subscription_attributes.rb new file mode 100644 index 000000000000..98ee47c0ed3e --- /dev/null +++ b/lib/datadog_api_client/v2/models/sample_log_generation_bulk_subscription_attributes.rb @@ -0,0 +1,139 @@ +=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 + # The attributes for creating sample log generation subscriptions for multiple content packs. + class SampleLogGenerationBulkSubscriptionAttributes + include BaseGenericModel + + # The identifiers of the Cloud SIEM content packs to subscribe to. At most five content packs can be requested in a single call. + attr_reader :content_pack_ids + + # How long the subscription should remain active before expiring. + attr_accessor :duration + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'content_pack_ids' => :'content_pack_ids', + :'duration' => :'duration' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'content_pack_ids' => :'Array', + :'duration' => :'SampleLogGenerationDuration' + } + 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::SampleLogGenerationBulkSubscriptionAttributes` 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?(:'content_pack_ids') + if (value = attributes[:'content_pack_ids']).is_a?(Array) + self.content_pack_ids = value + end + end + + if attributes.key?(:'duration') + self.duration = attributes[:'duration'] + 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 @content_pack_ids.nil? + return false if @content_pack_ids.length > 5 + true + end + + # Custom attribute writer method with validation + # @param content_pack_ids [Object] Object to be assigned + # @!visibility private + def content_pack_ids=(content_pack_ids) + if content_pack_ids.nil? + fail ArgumentError, 'invalid value for "content_pack_ids", content_pack_ids cannot be nil.' + end + if content_pack_ids.length > 5 + fail ArgumentError, 'invalid value for "content_pack_ids", number of items must be less than or equal to 5.' + end + @content_pack_ids = content_pack_ids + 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 && + content_pack_ids == o.content_pack_ids && + duration == o.duration && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [content_pack_ids, duration, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/sample_log_generation_bulk_subscription_data.rb b/lib/datadog_api_client/v2/models/sample_log_generation_bulk_subscription_data.rb new file mode 100644 index 000000000000..c04eb6136379 --- /dev/null +++ b/lib/datadog_api_client/v2/models/sample_log_generation_bulk_subscription_data.rb @@ -0,0 +1,144 @@ +=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 + # The bulk subscription request body. + class SampleLogGenerationBulkSubscriptionData + include BaseGenericModel + + # The attributes for creating sample log generation subscriptions for multiple content packs. + attr_reader :attributes + + # The type of the resource. The value should always be `bulk_subscription_requests`. + 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', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'SampleLogGenerationBulkSubscriptionAttributes', + :'type' => :'SampleLogGenerationBulkSubscriptionRequestType' + } + 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::SampleLogGenerationBulkSubscriptionData` 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?(:'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 @attributes.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + 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 && + 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, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/sample_log_generation_bulk_subscription_item_meta.rb b/lib/datadog_api_client/v2/models/sample_log_generation_bulk_subscription_item_meta.rb new file mode 100644 index 000000000000..54bb234573e6 --- /dev/null +++ b/lib/datadog_api_client/v2/models/sample_log_generation_bulk_subscription_item_meta.rb @@ -0,0 +1,137 @@ +=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 + # Per-item status returned for a bulk subscription request. + class SampleLogGenerationBulkSubscriptionItemMeta + include BaseGenericModel + + # A description of the error encountered for this content pack, if the subscription could not be created. + attr_accessor :error + + # The HTTP status code that resulted from creating the subscription for this content pack. + attr_reader :status + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'error' => :'error', + :'status' => :'status' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'error' => :'String', + :'status' => :'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::SampleLogGenerationBulkSubscriptionItemMeta` 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?(:'error') + self.error = attributes[:'error'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + 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 @status.nil? + return false if @status > 599 + true + end + + # Custom attribute writer method with validation + # @param status [Object] Object to be assigned + # @!visibility private + def status=(status) + if status.nil? + fail ArgumentError, 'invalid value for "status", status cannot be nil.' + end + if status > 599 + fail ArgumentError, 'invalid value for "status", must be smaller than or equal to 599.' + end + @status = status + 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 && + error == o.error && + status == o.status && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [error, status, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/sample_log_generation_bulk_subscription_request.rb b/lib/datadog_api_client/v2/models/sample_log_generation_bulk_subscription_request.rb new file mode 100644 index 000000000000..9e3aca034737 --- /dev/null +++ b/lib/datadog_api_client/v2/models/sample_log_generation_bulk_subscription_request.rb @@ -0,0 +1,123 @@ +=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 + # Request body to create sample log generation subscriptions for multiple content packs at once. + class SampleLogGenerationBulkSubscriptionRequest + include BaseGenericModel + + # The bulk subscription request body. + 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' => :'SampleLogGenerationBulkSubscriptionData' + } + 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::SampleLogGenerationBulkSubscriptionRequest` 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 + + # 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/sample_log_generation_bulk_subscription_request_type.rb b/lib/datadog_api_client/v2/models/sample_log_generation_bulk_subscription_request_type.rb new file mode 100644 index 000000000000..aff78744a596 --- /dev/null +++ b/lib/datadog_api_client/v2/models/sample_log_generation_bulk_subscription_request_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 + # The type of the resource. The value should always be `bulk_subscription_requests`. + class SampleLogGenerationBulkSubscriptionRequestType + include BaseEnumModel + + BULK_SUBSCRIPTION_REQUESTS = "bulk_subscription_requests".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/sample_log_generation_bulk_subscription_response.rb b/lib/datadog_api_client/v2/models/sample_log_generation_bulk_subscription_response.rb new file mode 100644 index 000000000000..2a1f655b583e --- /dev/null +++ b/lib/datadog_api_client/v2/models/sample_log_generation_bulk_subscription_response.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 + # Response containing the per-content-pack results of a bulk subscription request. + class SampleLogGenerationBulkSubscriptionResponse + include BaseGenericModel + + # The list of bulk subscription results, one per requested content pack. + 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::SampleLogGenerationBulkSubscriptionResponse` 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/sample_log_generation_bulk_subscription_result_item.rb b/lib/datadog_api_client/v2/models/sample_log_generation_bulk_subscription_result_item.rb new file mode 100644 index 000000000000..eac9c12c4fbb --- /dev/null +++ b/lib/datadog_api_client/v2/models/sample_log_generation_bulk_subscription_result_item.rb @@ -0,0 +1,186 @@ +=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 + # A single result entry returned by the bulk subscription endpoint. + class SampleLogGenerationBulkSubscriptionResultItem + include BaseGenericModel + + # The attributes describing a sample log generation subscription. + attr_reader :attributes + + # The unique identifier of the subscription, when one was created. + attr_reader :id + + # Per-item status returned for a bulk subscription request. + attr_reader :meta + + # The type of the resource. The value should always be `subscriptions`. + 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', + :'meta' => :'meta', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'SampleLogGenerationSubscriptionAttributes', + :'id' => :'String', + :'meta' => :'SampleLogGenerationBulkSubscriptionItemMeta', + :'type' => :'SampleLogGenerationSubscriptionResourceType' + } + 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::SampleLogGenerationBulkSubscriptionResultItem` 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?(:'meta') + self.meta = attributes[:'meta'] + 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 @attributes.nil? + return false if @id.nil? + return false if @meta.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param meta [Object] Object to be assigned + # @!visibility private + def meta=(meta) + if meta.nil? + fail ArgumentError, 'invalid value for "meta", meta cannot be nil.' + end + @meta = meta + 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 && + meta == o.meta && + 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, meta, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/sample_log_generation_duration.rb b/lib/datadog_api_client/v2/models/sample_log_generation_duration.rb new file mode 100644 index 000000000000..a463631f1721 --- /dev/null +++ b/lib/datadog_api_client/v2/models/sample_log_generation_duration.rb @@ -0,0 +1,29 @@ +=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 + # How long the subscription should remain active before expiring. + class SampleLogGenerationDuration + include BaseEnumModel + + ONE_HOUR = "1h".freeze + ONE_DAY = "1d".freeze + THREE_DAYS = "3d".freeze + SEVEN_DAYS = "7d".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/sample_log_generation_subscription_attributes.rb b/lib/datadog_api_client/v2/models/sample_log_generation_subscription_attributes.rb new file mode 100644 index 000000000000..36a46d372508 --- /dev/null +++ b/lib/datadog_api_client/v2/models/sample_log_generation_subscription_attributes.rb @@ -0,0 +1,207 @@ +=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 + # The attributes describing a sample log generation subscription. + class SampleLogGenerationSubscriptionAttributes + include BaseGenericModel + + # The identifier of the Cloud SIEM content pack the subscription targets. + attr_reader :content_pack_id + + # The time at which the subscription was created. + attr_reader :created_at + + # The time at which the subscription expires and stops generating logs. + attr_reader :expires_at + + # Whether the subscription is currently active and generating logs. + attr_reader :is_active + + # The status of the subscription. + attr_reader :status + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'content_pack_id' => :'content_pack_id', + :'created_at' => :'created_at', + :'expires_at' => :'expires_at', + :'is_active' => :'is_active', + :'status' => :'status' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'content_pack_id' => :'String', + :'created_at' => :'Time', + :'expires_at' => :'Time', + :'is_active' => :'Boolean', + :'status' => :'SampleLogGenerationSubscriptionStatus' + } + 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::SampleLogGenerationSubscriptionAttributes` 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?(:'content_pack_id') + self.content_pack_id = attributes[:'content_pack_id'] + end + + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.key?(:'expires_at') + self.expires_at = attributes[:'expires_at'] + end + + if attributes.key?(:'is_active') + self.is_active = attributes[:'is_active'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + 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 @content_pack_id.nil? + return false if @created_at.nil? + return false if @expires_at.nil? + return false if @is_active.nil? + return false if @status.nil? + true + end + + # Custom attribute writer method with validation + # @param content_pack_id [Object] Object to be assigned + # @!visibility private + def content_pack_id=(content_pack_id) + if content_pack_id.nil? + fail ArgumentError, 'invalid value for "content_pack_id", content_pack_id cannot be nil.' + end + @content_pack_id = content_pack_id + end + + # Custom attribute writer method with validation + # @param created_at [Object] Object to be assigned + # @!visibility private + def created_at=(created_at) + if created_at.nil? + fail ArgumentError, 'invalid value for "created_at", created_at cannot be nil.' + end + @created_at = created_at + end + + # Custom attribute writer method with validation + # @param expires_at [Object] Object to be assigned + # @!visibility private + def expires_at=(expires_at) + if expires_at.nil? + fail ArgumentError, 'invalid value for "expires_at", expires_at cannot be nil.' + end + @expires_at = expires_at + end + + # Custom attribute writer method with validation + # @param is_active [Object] Object to be assigned + # @!visibility private + def is_active=(is_active) + if is_active.nil? + fail ArgumentError, 'invalid value for "is_active", is_active cannot be nil.' + end + @is_active = is_active + end + + # Custom attribute writer method with validation + # @param status [Object] Object to be assigned + # @!visibility private + def status=(status) + if status.nil? + fail ArgumentError, 'invalid value for "status", status cannot be nil.' + end + @status = status + 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 && + content_pack_id == o.content_pack_id && + created_at == o.created_at && + expires_at == o.expires_at && + is_active == o.is_active && + status == o.status && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [content_pack_id, created_at, expires_at, is_active, status, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/sample_log_generation_subscription_create_attributes.rb b/lib/datadog_api_client/v2/models/sample_log_generation_subscription_create_attributes.rb new file mode 100644 index 000000000000..f5c7641f390d --- /dev/null +++ b/lib/datadog_api_client/v2/models/sample_log_generation_subscription_create_attributes.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 + # The attributes for creating a sample log generation subscription. + class SampleLogGenerationSubscriptionCreateAttributes + include BaseGenericModel + + # The identifier of the Cloud SIEM content pack to subscribe to. + attr_reader :content_pack_id + + # How long the subscription should remain active before expiring. + attr_accessor :duration + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'content_pack_id' => :'content_pack_id', + :'duration' => :'duration' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'content_pack_id' => :'String', + :'duration' => :'SampleLogGenerationDuration' + } + 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::SampleLogGenerationSubscriptionCreateAttributes` 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?(:'content_pack_id') + self.content_pack_id = attributes[:'content_pack_id'] + end + + if attributes.key?(:'duration') + self.duration = attributes[:'duration'] + 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 @content_pack_id.nil? + true + end + + # Custom attribute writer method with validation + # @param content_pack_id [Object] Object to be assigned + # @!visibility private + def content_pack_id=(content_pack_id) + if content_pack_id.nil? + fail ArgumentError, 'invalid value for "content_pack_id", content_pack_id cannot be nil.' + end + @content_pack_id = content_pack_id + 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 && + content_pack_id == o.content_pack_id && + duration == o.duration && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [content_pack_id, duration, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/sample_log_generation_subscription_create_data.rb b/lib/datadog_api_client/v2/models/sample_log_generation_subscription_create_data.rb new file mode 100644 index 000000000000..86fbbda043e6 --- /dev/null +++ b/lib/datadog_api_client/v2/models/sample_log_generation_subscription_create_data.rb @@ -0,0 +1,144 @@ +=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 + # The subscription request body. + class SampleLogGenerationSubscriptionCreateData + include BaseGenericModel + + # The attributes for creating a sample log generation subscription. + attr_reader :attributes + + # The type of the resource. The value should always be `subscription_requests`. + 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', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'SampleLogGenerationSubscriptionCreateAttributes', + :'type' => :'SampleLogGenerationSubscriptionRequestType' + } + 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::SampleLogGenerationSubscriptionCreateData` 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?(:'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 @attributes.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + 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 && + 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, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/sample_log_generation_subscription_create_request.rb b/lib/datadog_api_client/v2/models/sample_log_generation_subscription_create_request.rb new file mode 100644 index 000000000000..141958ead500 --- /dev/null +++ b/lib/datadog_api_client/v2/models/sample_log_generation_subscription_create_request.rb @@ -0,0 +1,123 @@ +=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 + # Request body to create a sample log generation subscription for a single content pack. + class SampleLogGenerationSubscriptionCreateRequest + include BaseGenericModel + + # The subscription request body. + 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' => :'SampleLogGenerationSubscriptionCreateData' + } + 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::SampleLogGenerationSubscriptionCreateRequest` 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 + + # 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/sample_log_generation_subscription_data.rb b/lib/datadog_api_client/v2/models/sample_log_generation_subscription_data.rb new file mode 100644 index 000000000000..e04194dd7b1a --- /dev/null +++ b/lib/datadog_api_client/v2/models/sample_log_generation_subscription_data.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 + # A sample log generation subscription. + class SampleLogGenerationSubscriptionData + include BaseGenericModel + + # The attributes describing a sample log generation subscription. + attr_reader :attributes + + # The unique identifier of the subscription. + attr_reader :id + + # The type of the resource. The value should always be `subscriptions`. + 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' => :'SampleLogGenerationSubscriptionAttributes', + :'id' => :'String', + :'type' => :'SampleLogGenerationSubscriptionResourceType' + } + 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::SampleLogGenerationSubscriptionData` 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 @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + 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/sample_log_generation_subscription_request_type.rb b/lib/datadog_api_client/v2/models/sample_log_generation_subscription_request_type.rb new file mode 100644 index 000000000000..9632a6ec5e6c --- /dev/null +++ b/lib/datadog_api_client/v2/models/sample_log_generation_subscription_request_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 + # The type of the resource. The value should always be `subscription_requests`. + class SampleLogGenerationSubscriptionRequestType + include BaseEnumModel + + SUBSCRIPTION_REQUESTS = "subscription_requests".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/sample_log_generation_subscription_resource_type.rb b/lib/datadog_api_client/v2/models/sample_log_generation_subscription_resource_type.rb new file mode 100644 index 000000000000..aaece0ff3883 --- /dev/null +++ b/lib/datadog_api_client/v2/models/sample_log_generation_subscription_resource_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 + # The type of the resource. The value should always be `subscriptions`. + class SampleLogGenerationSubscriptionResourceType + include BaseEnumModel + + SUBSCRIPTIONS = "subscriptions".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/sample_log_generation_subscription_response.rb b/lib/datadog_api_client/v2/models/sample_log_generation_subscription_response.rb new file mode 100644 index 000000000000..cff9dd74d800 --- /dev/null +++ b/lib/datadog_api_client/v2/models/sample_log_generation_subscription_response.rb @@ -0,0 +1,123 @@ +=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 + # Response containing a single sample log generation subscription. + class SampleLogGenerationSubscriptionResponse + include BaseGenericModel + + # A sample log generation subscription. + 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' => :'SampleLogGenerationSubscriptionData' + } + 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::SampleLogGenerationSubscriptionResponse` 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 + + # 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/sample_log_generation_subscription_status.rb b/lib/datadog_api_client/v2/models/sample_log_generation_subscription_status.rb new file mode 100644 index 000000000000..864703af7539 --- /dev/null +++ b/lib/datadog_api_client/v2/models/sample_log_generation_subscription_status.rb @@ -0,0 +1,32 @@ +=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 + # The status of the subscription. + class SampleLogGenerationSubscriptionStatus + include BaseEnumModel + + SUBSCRIBED = "subscribed".freeze + RENEWED = "renewed".freeze + UNSUBSCRIBED = "unsubscribed".freeze + NO_ACTIVE_SUBSCRIPTION = "no_active_subscription".freeze + NOT_AVAILABLE = "not_available".freeze + ACTIVE = "active".freeze + EXPIRED = "expired".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/sample_log_generation_subscriptions_response.rb b/lib/datadog_api_client/v2/models/sample_log_generation_subscriptions_response.rb new file mode 100644 index 000000000000..c9d49b7e4747 --- /dev/null +++ b/lib/datadog_api_client/v2/models/sample_log_generation_subscriptions_response.rb @@ -0,0 +1,146 @@ +=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 + # Response containing a list of sample log generation subscriptions. + class SampleLogGenerationSubscriptionsResponse + include BaseGenericModel + + # The list of sample log generation subscriptions. + attr_reader :data + + # Metadata returned alongside a list of sample log generation subscriptions. + attr_reader :meta + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data', + :'meta' => :'meta' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array', + :'meta' => :'SampleLogGenerationSubscriptionsResponseMeta' + } + 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::SampleLogGenerationSubscriptionsResponse` 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 + + if attributes.key?(:'meta') + self.meta = attributes[:'meta'] + 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? + return false if @meta.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 + + # Custom attribute writer method with validation + # @param meta [Object] Object to be assigned + # @!visibility private + def meta=(meta) + if meta.nil? + fail ArgumentError, 'invalid value for "meta", meta cannot be nil.' + end + @meta = meta + 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 && + meta == o.meta && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, meta, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/sample_log_generation_subscriptions_response_meta.rb b/lib/datadog_api_client/v2/models/sample_log_generation_subscriptions_response_meta.rb new file mode 100644 index 000000000000..a33f88d44081 --- /dev/null +++ b/lib/datadog_api_client/v2/models/sample_log_generation_subscriptions_response_meta.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 + # Metadata returned alongside a list of sample log generation subscriptions. + class SampleLogGenerationSubscriptionsResponseMeta + include BaseGenericModel + + # The total number of subscriptions matching the request, irrespective of pagination. + attr_reader :total_subscriptions + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'total_subscriptions' => :'total_subscriptions' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'total_subscriptions' => :'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::SampleLogGenerationSubscriptionsResponseMeta` 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?(:'total_subscriptions') + self.total_subscriptions = attributes[:'total_subscriptions'] + 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 @total_subscriptions.nil? + return false if @total_subscriptions > 2147483647 + true + end + + # Custom attribute writer method with validation + # @param total_subscriptions [Object] Object to be assigned + # @!visibility private + def total_subscriptions=(total_subscriptions) + if total_subscriptions.nil? + fail ArgumentError, 'invalid value for "total_subscriptions", total_subscriptions cannot be nil.' + end + if total_subscriptions > 2147483647 + fail ArgumentError, 'invalid value for "total_subscriptions", must be smaller than or equal to 2147483647.' + end + @total_subscriptions = total_subscriptions + 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 && + total_subscriptions == o.total_subscriptions && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [total_subscriptions, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/sample_log_generation_subscriptions_status_filter.rb b/lib/datadog_api_client/v2/models/sample_log_generation_subscriptions_status_filter.rb new file mode 100644 index 000000000000..c77f0a57135c --- /dev/null +++ b/lib/datadog_api_client/v2/models/sample_log_generation_subscriptions_status_filter.rb @@ -0,0 +1,27 @@ +=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 + # Filter that controls whether to return only active subscriptions or every subscription on record. + class SampleLogGenerationSubscriptionsStatusFilter + include BaseEnumModel + + ACTIVE = "active".freeze + ALL = "all".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/security_filter_version.rb b/lib/datadog_api_client/v2/models/security_filter_version.rb new file mode 100644 index 000000000000..91bd0feff51f --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_filter_version.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 + # A snapshot of all security filters at a specific configuration version. + class SecurityFilterVersion + include BaseGenericModel + + # The attributes describing a single security filter configuration version. + attr_reader :attributes + + # The identifier of the configuration version. + attr_reader :id + + # The type of the resource. The value should always be `security_filters_configuration`. + 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' => :'SecurityFilterVersionAttributes', + :'id' => :'String', + :'type' => :'SecurityFilterVersionType' + } + 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::SecurityFilterVersion` 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 @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + 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/security_filter_version_attributes.rb b/lib/datadog_api_client/v2/models/security_filter_version_attributes.rb new file mode 100644 index 000000000000..2c32c987745d --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_filter_version_attributes.rb @@ -0,0 +1,171 @@ +=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 + # The attributes describing a single security filter configuration version. + class SecurityFilterVersionAttributes + include BaseGenericModel + + # The Unix timestamp in milliseconds at which this configuration version was applied. + attr_reader :date + + # The set of security filters at this configuration version. + attr_reader :filters + + # The configuration version number. + attr_reader :version + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'date' => :'date', + :'filters' => :'filters', + :'version' => :'version' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'date' => :'Integer', + :'filters' => :'Array', + :'version' => :'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::SecurityFilterVersionAttributes` 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?(:'date') + self.date = attributes[:'date'] + end + + if attributes.key?(:'filters') + if (value = attributes[:'filters']).is_a?(Array) + self.filters = value + end + end + + if attributes.key?(:'version') + self.version = attributes[:'version'] + 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 @date.nil? + return false if @filters.nil? + return false if @version.nil? + return false if @version > 2147483647 + true + end + + # Custom attribute writer method with validation + # @param date [Object] Object to be assigned + # @!visibility private + def date=(date) + if date.nil? + fail ArgumentError, 'invalid value for "date", date cannot be nil.' + end + @date = date + end + + # Custom attribute writer method with validation + # @param filters [Object] Object to be assigned + # @!visibility private + def filters=(filters) + if filters.nil? + fail ArgumentError, 'invalid value for "filters", filters cannot be nil.' + end + @filters = filters + end + + # Custom attribute writer method with validation + # @param version [Object] Object to be assigned + # @!visibility private + def version=(version) + if version.nil? + fail ArgumentError, 'invalid value for "version", version cannot be nil.' + end + if version > 2147483647 + fail ArgumentError, 'invalid value for "version", must be smaller than or equal to 2147483647.' + end + @version = version + 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 && + date == o.date && + filters == o.filters && + version == o.version && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [date, filters, version, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/security_filter_version_entry.rb b/lib/datadog_api_client/v2/models/security_filter_version_entry.rb new file mode 100644 index 000000000000..07486dee030f --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_filter_version_entry.rb @@ -0,0 +1,276 @@ +=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 + # A single security filter as it existed at a given configuration version. + class SecurityFilterVersionEntry + include BaseGenericModel + + # The list of exclusion filters applied in this security filter. + attr_reader :exclusion_filters + + # The filtered data type. + attr_reader :filtered_data_type + + # The ID of the security filter. + attr_reader :id + + # Whether the security filter is the built-in filter. + attr_reader :is_builtin + + # Whether the security filter is enabled. + attr_reader :is_enabled + + # The name of the security filter. + attr_reader :name + + # The query of the security filter. + attr_reader :query + + # The version of this security filter. + attr_reader :version + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'exclusion_filters' => :'exclusion_filters', + :'filtered_data_type' => :'filtered_data_type', + :'id' => :'id', + :'is_builtin' => :'is_builtin', + :'is_enabled' => :'is_enabled', + :'name' => :'name', + :'query' => :'query', + :'version' => :'version' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'exclusion_filters' => :'Array', + :'filtered_data_type' => :'SecurityFilterFilteredDataType', + :'id' => :'String', + :'is_builtin' => :'Boolean', + :'is_enabled' => :'Boolean', + :'name' => :'String', + :'query' => :'String', + :'version' => :'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::SecurityFilterVersionEntry` 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?(:'exclusion_filters') + if (value = attributes[:'exclusion_filters']).is_a?(Array) + self.exclusion_filters = value + end + end + + if attributes.key?(:'filtered_data_type') + self.filtered_data_type = attributes[:'filtered_data_type'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'is_builtin') + self.is_builtin = attributes[:'is_builtin'] + end + + if attributes.key?(:'is_enabled') + self.is_enabled = attributes[:'is_enabled'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'query') + self.query = attributes[:'query'] + end + + if attributes.key?(:'version') + self.version = attributes[:'version'] + 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 @exclusion_filters.nil? + return false if @filtered_data_type.nil? + return false if @id.nil? + return false if @is_builtin.nil? + return false if @is_enabled.nil? + return false if @name.nil? + return false if @query.nil? + return false if @version.nil? + return false if @version > 2147483647 + true + end + + # Custom attribute writer method with validation + # @param exclusion_filters [Object] Object to be assigned + # @!visibility private + def exclusion_filters=(exclusion_filters) + if exclusion_filters.nil? + fail ArgumentError, 'invalid value for "exclusion_filters", exclusion_filters cannot be nil.' + end + @exclusion_filters = exclusion_filters + end + + # Custom attribute writer method with validation + # @param filtered_data_type [Object] Object to be assigned + # @!visibility private + def filtered_data_type=(filtered_data_type) + if filtered_data_type.nil? + fail ArgumentError, 'invalid value for "filtered_data_type", filtered_data_type cannot be nil.' + end + @filtered_data_type = filtered_data_type + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param is_builtin [Object] Object to be assigned + # @!visibility private + def is_builtin=(is_builtin) + if is_builtin.nil? + fail ArgumentError, 'invalid value for "is_builtin", is_builtin cannot be nil.' + end + @is_builtin = is_builtin + end + + # Custom attribute writer method with validation + # @param is_enabled [Object] Object to be assigned + # @!visibility private + def is_enabled=(is_enabled) + if is_enabled.nil? + fail ArgumentError, 'invalid value for "is_enabled", is_enabled cannot be nil.' + end + @is_enabled = is_enabled + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' + end + @name = name + end + + # Custom attribute writer method with validation + # @param query [Object] Object to be assigned + # @!visibility private + def query=(query) + if query.nil? + fail ArgumentError, 'invalid value for "query", query cannot be nil.' + end + @query = query + end + + # Custom attribute writer method with validation + # @param version [Object] Object to be assigned + # @!visibility private + def version=(version) + if version.nil? + fail ArgumentError, 'invalid value for "version", version cannot be nil.' + end + if version > 2147483647 + fail ArgumentError, 'invalid value for "version", must be smaller than or equal to 2147483647.' + end + @version = version + 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 && + exclusion_filters == o.exclusion_filters && + filtered_data_type == o.filtered_data_type && + id == o.id && + is_builtin == o.is_builtin && + is_enabled == o.is_enabled && + name == o.name && + query == o.query && + version == o.version && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [exclusion_filters, filtered_data_type, id, is_builtin, is_enabled, name, query, version, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/security_filter_version_type.rb b/lib/datadog_api_client/v2/models/security_filter_version_type.rb new file mode 100644 index 000000000000..ed37ecbf2e63 --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_filter_version_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 + # The type of the resource. The value should always be `security_filters_configuration`. + class SecurityFilterVersionType + include BaseEnumModel + + SECURITY_FILTERS_CONFIGURATION = "security_filters_configuration".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/security_filter_versions_response.rb b/lib/datadog_api_client/v2/models/security_filter_versions_response.rb new file mode 100644 index 000000000000..54232e6a4e39 --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_filter_versions_response.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 + # Response containing the version history of security filters. + class SecurityFilterVersionsResponse + include BaseGenericModel + + # A list of historical security filter configurations, ordered from the most recent to the oldest. + 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::SecurityFilterVersionsResponse` 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/security_monitoring_integration_config_attributes.rb b/lib/datadog_api_client/v2/models/security_monitoring_integration_config_attributes.rb new file mode 100644 index 000000000000..59156df70d32 --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_integration_config_attributes.rb @@ -0,0 +1,215 @@ +=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 + # The attributes of an entity context sync configuration as returned by the API. + class SecurityMonitoringIntegrationConfigAttributes + include BaseGenericModel + + # The time at which the entity context sync configuration was created. + attr_accessor :created_at + + # The domain associated with the external entity source (for example, the customer's identity provider domain). + attr_reader :domain + + # Whether the sync is enabled and actively ingesting entities into Cloud SIEM. + attr_reader :enabled + + # The type of external source that provides entities to Cloud SIEM. + attr_reader :integration_type + + # The time at which the entity context sync configuration was last modified. + attr_accessor :modified_at + + # The display name of the entity context sync configuration. + attr_accessor :name + + # Free-form, non-sensitive settings for the entity context sync. The accepted keys depend on the source type. + attr_accessor :settings + + # The state of the credentials configured on the entity context sync. + attr_accessor :state + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'created_at' => :'created_at', + :'domain' => :'domain', + :'enabled' => :'enabled', + :'integration_type' => :'integration_type', + :'modified_at' => :'modified_at', + :'name' => :'name', + :'settings' => :'settings', + :'state' => :'state' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'created_at' => :'Time', + :'domain' => :'String', + :'enabled' => :'Boolean', + :'integration_type' => :'SecurityMonitoringIntegrationType', + :'modified_at' => :'Time', + :'name' => :'String', + :'settings' => :'Hash', + :'state' => :'SecurityMonitoringIntegrationConfigState' + } + 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::SecurityMonitoringIntegrationConfigAttributes` 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?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.key?(:'domain') + self.domain = attributes[:'domain'] + end + + if attributes.key?(:'enabled') + self.enabled = attributes[:'enabled'] + end + + if attributes.key?(:'integration_type') + self.integration_type = attributes[:'integration_type'] + end + + if attributes.key?(:'modified_at') + self.modified_at = attributes[:'modified_at'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'settings') + self.settings = attributes[:'settings'] + end + + if attributes.key?(:'state') + self.state = attributes[:'state'] + 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 @domain.nil? + return false if @enabled.nil? + return false if @integration_type.nil? + true + end + + # Custom attribute writer method with validation + # @param domain [Object] Object to be assigned + # @!visibility private + def domain=(domain) + if domain.nil? + fail ArgumentError, 'invalid value for "domain", domain cannot be nil.' + end + @domain = domain + end + + # Custom attribute writer method with validation + # @param enabled [Object] Object to be assigned + # @!visibility private + def enabled=(enabled) + if enabled.nil? + fail ArgumentError, 'invalid value for "enabled", enabled cannot be nil.' + end + @enabled = enabled + end + + # Custom attribute writer method with validation + # @param integration_type [Object] Object to be assigned + # @!visibility private + def integration_type=(integration_type) + if integration_type.nil? + fail ArgumentError, 'invalid value for "integration_type", integration_type cannot be nil.' + end + @integration_type = integration_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 && + created_at == o.created_at && + domain == o.domain && + enabled == o.enabled && + integration_type == o.integration_type && + modified_at == o.modified_at && + name == o.name && + settings == o.settings && + state == o.state && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [created_at, domain, enabled, integration_type, modified_at, name, settings, state, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_integration_config_create_attributes.rb b/lib/datadog_api_client/v2/models/security_monitoring_integration_config_create_attributes.rb new file mode 100644 index 000000000000..0732965fb090 --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_integration_config_create_attributes.rb @@ -0,0 +1,196 @@ +=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 + # The attributes of the entity context sync configuration to create. + class SecurityMonitoringIntegrationConfigCreateAttributes + include BaseGenericModel + + # The domain associated with the external entity source. + attr_reader :domain + + # The type of external source that provides entities to Cloud SIEM. + attr_reader :integration_type + + # The display name for the entity context sync configuration. + attr_reader :name + + # The secrets used to authenticate against the external entity source. The accepted keys depend on the source type (for example, `admin_email` for Google Workspace). + attr_reader :secrets + + # Free-form, non-sensitive settings for the entity context sync. The accepted keys depend on the source type. + attr_accessor :settings + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'domain' => :'domain', + :'integration_type' => :'integration_type', + :'name' => :'name', + :'secrets' => :'secrets', + :'settings' => :'settings' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'domain' => :'String', + :'integration_type' => :'SecurityMonitoringIntegrationType', + :'name' => :'String', + :'secrets' => :'Hash', + :'settings' => :'Hash' + } + 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::SecurityMonitoringIntegrationConfigCreateAttributes` 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?(:'domain') + self.domain = attributes[:'domain'] + end + + if attributes.key?(:'integration_type') + self.integration_type = attributes[:'integration_type'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'secrets') + self.secrets = attributes[:'secrets'] + end + + if attributes.key?(:'settings') + self.settings = attributes[:'settings'] + 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 @domain.nil? + return false if @integration_type.nil? + return false if @name.nil? + return false if @secrets.nil? + true + end + + # Custom attribute writer method with validation + # @param domain [Object] Object to be assigned + # @!visibility private + def domain=(domain) + if domain.nil? + fail ArgumentError, 'invalid value for "domain", domain cannot be nil.' + end + @domain = domain + end + + # Custom attribute writer method with validation + # @param integration_type [Object] Object to be assigned + # @!visibility private + def integration_type=(integration_type) + if integration_type.nil? + fail ArgumentError, 'invalid value for "integration_type", integration_type cannot be nil.' + end + @integration_type = integration_type + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' + end + @name = name + end + + # Custom attribute writer method with validation + # @param secrets [Object] Object to be assigned + # @!visibility private + def secrets=(secrets) + if secrets.nil? + fail ArgumentError, 'invalid value for "secrets", secrets cannot be nil.' + end + @secrets = secrets + 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 && + domain == o.domain && + integration_type == o.integration_type && + name == o.name && + secrets == o.secrets && + settings == o.settings && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [domain, integration_type, name, secrets, settings, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_integration_config_create_data.rb b/lib/datadog_api_client/v2/models/security_monitoring_integration_config_create_data.rb new file mode 100644 index 000000000000..4c5ea64dd40c --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_integration_config_create_data.rb @@ -0,0 +1,144 @@ +=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 + # The entity context sync configuration to create. + class SecurityMonitoringIntegrationConfigCreateData + include BaseGenericModel + + # The attributes of the entity context sync configuration to create. + attr_reader :attributes + + # The type of the resource. The value should always be `integration_config`. + 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', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'SecurityMonitoringIntegrationConfigCreateAttributes', + :'type' => :'SecurityMonitoringIntegrationConfigResourceType' + } + 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::SecurityMonitoringIntegrationConfigCreateData` 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?(:'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 @attributes.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + 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 && + 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, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_integration_config_create_request.rb b/lib/datadog_api_client/v2/models/security_monitoring_integration_config_create_request.rb new file mode 100644 index 000000000000..18dcdba78e08 --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_integration_config_create_request.rb @@ -0,0 +1,123 @@ +=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 + # Request body to create an entity context sync configuration. + class SecurityMonitoringIntegrationConfigCreateRequest + include BaseGenericModel + + # The entity context sync configuration to create. + 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' => :'SecurityMonitoringIntegrationConfigCreateData' + } + 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::SecurityMonitoringIntegrationConfigCreateRequest` 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 + + # 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/security_monitoring_integration_config_data.rb b/lib/datadog_api_client/v2/models/security_monitoring_integration_config_data.rb new file mode 100644 index 000000000000..d63637f3bbf6 --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_integration_config_data.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 + # An entity context sync configuration. + class SecurityMonitoringIntegrationConfigData + include BaseGenericModel + + # The attributes of an entity context sync configuration as returned by the API. + attr_reader :attributes + + # The unique identifier of the integration configuration. + attr_reader :id + + # The type of the resource. The value should always be `integration_config`. + 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' => :'SecurityMonitoringIntegrationConfigAttributes', + :'id' => :'String', + :'type' => :'SecurityMonitoringIntegrationConfigResourceType' + } + 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::SecurityMonitoringIntegrationConfigData` 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 @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + 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/security_monitoring_integration_config_resource_type.rb b/lib/datadog_api_client/v2/models/security_monitoring_integration_config_resource_type.rb new file mode 100644 index 000000000000..64a73bdabce0 --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_integration_config_resource_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 + # The type of the resource. The value should always be `integration_config`. + class SecurityMonitoringIntegrationConfigResourceType + include BaseEnumModel + + INTEGRATION_CONFIG = "integration_config".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_integration_config_response.rb b/lib/datadog_api_client/v2/models/security_monitoring_integration_config_response.rb new file mode 100644 index 000000000000..6465f3b62466 --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_integration_config_response.rb @@ -0,0 +1,123 @@ +=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 + # Response containing a single entity context sync configuration. + class SecurityMonitoringIntegrationConfigResponse + include BaseGenericModel + + # An entity context sync configuration. + 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' => :'SecurityMonitoringIntegrationConfigData' + } + 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::SecurityMonitoringIntegrationConfigResponse` 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 + + # 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/security_monitoring_integration_config_state.rb b/lib/datadog_api_client/v2/models/security_monitoring_integration_config_state.rb new file mode 100644 index 000000000000..f16f4d58dfba --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_integration_config_state.rb @@ -0,0 +1,28 @@ +=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 + # The state of the credentials configured on the entity context sync. + class SecurityMonitoringIntegrationConfigState + include BaseEnumModel + + VALID = "valid".freeze + INVALID = "invalid".freeze + INITIALIZING = "initializing".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_integration_config_update_attributes.rb b/lib/datadog_api_client/v2/models/security_monitoring_integration_config_update_attributes.rb new file mode 100644 index 000000000000..378b5c3bfa4b --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_integration_config_update_attributes.rb @@ -0,0 +1,155 @@ +=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 + # Fields to update on the entity context sync configuration. All fields are optional. + class SecurityMonitoringIntegrationConfigUpdateAttributes + include BaseGenericModel + + # The new domain associated with the external entity source. + attr_accessor :domain + + # Whether the entity context sync should be enabled. + attr_accessor :enabled + + # The type of external source that provides entities to Cloud SIEM. + attr_accessor :integration_type + + # The new display name for the entity context sync configuration. + attr_accessor :name + + # The secrets used to authenticate against the external entity source. The accepted keys depend on the source type (for example, `admin_email` for Google Workspace). + attr_accessor :secrets + + # Free-form, non-sensitive settings for the entity context sync. The accepted keys depend on the source type. + attr_accessor :settings + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'domain' => :'domain', + :'enabled' => :'enabled', + :'integration_type' => :'integration_type', + :'name' => :'name', + :'secrets' => :'secrets', + :'settings' => :'settings' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'domain' => :'String', + :'enabled' => :'Boolean', + :'integration_type' => :'SecurityMonitoringIntegrationType', + :'name' => :'String', + :'secrets' => :'Hash', + :'settings' => :'Hash' + } + 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::SecurityMonitoringIntegrationConfigUpdateAttributes` 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?(:'domain') + self.domain = attributes[:'domain'] + end + + if attributes.key?(:'enabled') + self.enabled = attributes[:'enabled'] + end + + if attributes.key?(:'integration_type') + self.integration_type = attributes[:'integration_type'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'secrets') + self.secrets = attributes[:'secrets'] + end + + if attributes.key?(:'settings') + self.settings = attributes[:'settings'] + 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 && + domain == o.domain && + enabled == o.enabled && + integration_type == o.integration_type && + name == o.name && + secrets == o.secrets && + settings == o.settings && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [domain, enabled, integration_type, name, secrets, settings, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_integration_config_update_data.rb b/lib/datadog_api_client/v2/models/security_monitoring_integration_config_update_data.rb new file mode 100644 index 000000000000..4177da3f12fc --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_integration_config_update_data.rb @@ -0,0 +1,144 @@ +=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 + # The entity context sync configuration fields to update. + class SecurityMonitoringIntegrationConfigUpdateData + include BaseGenericModel + + # Fields to update on the entity context sync configuration. All fields are optional. + attr_reader :attributes + + # The type of the resource. The value should always be `integration_config`. + 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', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'SecurityMonitoringIntegrationConfigUpdateAttributes', + :'type' => :'SecurityMonitoringIntegrationConfigResourceType' + } + 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::SecurityMonitoringIntegrationConfigUpdateData` 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?(:'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 @attributes.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + 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 && + 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, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_integration_config_update_request.rb b/lib/datadog_api_client/v2/models/security_monitoring_integration_config_update_request.rb new file mode 100644 index 000000000000..9911ab5d0f0c --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_integration_config_update_request.rb @@ -0,0 +1,123 @@ +=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 + # Request body to update an entity context sync configuration. Supports partial updates. + class SecurityMonitoringIntegrationConfigUpdateRequest + include BaseGenericModel + + # The entity context sync configuration fields to update. + 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' => :'SecurityMonitoringIntegrationConfigUpdateData' + } + 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::SecurityMonitoringIntegrationConfigUpdateRequest` 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 + + # 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/security_monitoring_integration_configs_response.rb b/lib/datadog_api_client/v2/models/security_monitoring_integration_configs_response.rb new file mode 100644 index 000000000000..0168cb37604b --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_integration_configs_response.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 + # Response containing a list of entity context sync configurations. + class SecurityMonitoringIntegrationConfigsResponse + include BaseGenericModel + + # The list of integration configurations. + 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::SecurityMonitoringIntegrationConfigsResponse` 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/security_monitoring_integration_credentials_validate_attributes.rb b/lib/datadog_api_client/v2/models/security_monitoring_integration_credentials_validate_attributes.rb new file mode 100644 index 000000000000..e8620b13801c --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_integration_credentials_validate_attributes.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 + # The credentials to validate against the external entity source. + class SecurityMonitoringIntegrationCredentialsValidateAttributes + include BaseGenericModel + + # The domain associated with the external entity source. + attr_reader :domain + + # The type of external source that provides entities to Cloud SIEM. + attr_reader :integration_type + + # The secrets used to authenticate against the external entity source. The accepted keys depend on the source type (for example, `admin_email` for Google Workspace). + attr_reader :secrets + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'domain' => :'domain', + :'integration_type' => :'integration_type', + :'secrets' => :'secrets' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'domain' => :'String', + :'integration_type' => :'SecurityMonitoringIntegrationType', + :'secrets' => :'Hash' + } + 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::SecurityMonitoringIntegrationCredentialsValidateAttributes` 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?(:'domain') + self.domain = attributes[:'domain'] + end + + if attributes.key?(:'integration_type') + self.integration_type = attributes[:'integration_type'] + end + + if attributes.key?(:'secrets') + self.secrets = attributes[:'secrets'] + 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 @domain.nil? + return false if @integration_type.nil? + return false if @secrets.nil? + true + end + + # Custom attribute writer method with validation + # @param domain [Object] Object to be assigned + # @!visibility private + def domain=(domain) + if domain.nil? + fail ArgumentError, 'invalid value for "domain", domain cannot be nil.' + end + @domain = domain + end + + # Custom attribute writer method with validation + # @param integration_type [Object] Object to be assigned + # @!visibility private + def integration_type=(integration_type) + if integration_type.nil? + fail ArgumentError, 'invalid value for "integration_type", integration_type cannot be nil.' + end + @integration_type = integration_type + end + + # Custom attribute writer method with validation + # @param secrets [Object] Object to be assigned + # @!visibility private + def secrets=(secrets) + if secrets.nil? + fail ArgumentError, 'invalid value for "secrets", secrets cannot be nil.' + end + @secrets = secrets + 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 && + domain == o.domain && + integration_type == o.integration_type && + secrets == o.secrets && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [domain, integration_type, secrets, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_integration_credentials_validate_data.rb b/lib/datadog_api_client/v2/models/security_monitoring_integration_credentials_validate_data.rb new file mode 100644 index 000000000000..ac28f800be7c --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_integration_credentials_validate_data.rb @@ -0,0 +1,144 @@ +=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 + # The credentials to validate. + class SecurityMonitoringIntegrationCredentialsValidateData + include BaseGenericModel + + # The credentials to validate against the external entity source. + attr_reader :attributes + + # The type of the resource. The value should always be `integration_config`. + 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', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'SecurityMonitoringIntegrationCredentialsValidateAttributes', + :'type' => :'SecurityMonitoringIntegrationConfigResourceType' + } + 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::SecurityMonitoringIntegrationCredentialsValidateData` 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?(:'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 @attributes.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + 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 && + 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, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_integration_credentials_validate_request.rb b/lib/datadog_api_client/v2/models/security_monitoring_integration_credentials_validate_request.rb new file mode 100644 index 000000000000..b53c18fad298 --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_integration_credentials_validate_request.rb @@ -0,0 +1,123 @@ +=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 + # Request body to validate credentials against an external entity source before creating a sync configuration. + class SecurityMonitoringIntegrationCredentialsValidateRequest + include BaseGenericModel + + # The credentials to validate. + 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' => :'SecurityMonitoringIntegrationCredentialsValidateData' + } + 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::SecurityMonitoringIntegrationCredentialsValidateRequest` 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 + + # 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/security_monitoring_integration_type.rb b/lib/datadog_api_client/v2/models/security_monitoring_integration_type.rb new file mode 100644 index 000000000000..693bf3167b22 --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_integration_type.rb @@ -0,0 +1,28 @@ +=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 + # The type of external source that provides entities to Cloud SIEM. + class SecurityMonitoringIntegrationType + include BaseEnumModel + + GOOGLE_WORKSPACE = "GOOGLE_WORKSPACE".freeze + OKTA = "OKTA".freeze + ENTRA_ID = "ENTRA_ID".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/signal_entities_attributes.rb b/lib/datadog_api_client/v2/models/signal_entities_attributes.rb new file mode 100644 index 000000000000..5e48fdf65ba6 --- /dev/null +++ b/lib/datadog_api_client/v2/models/signal_entities_attributes.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 + # Attributes containing the entities related to the signal. + class SignalEntitiesAttributes + include BaseGenericModel + + # The identity entities related to the signal. Each item is a free-form object describing an identity (for example, a user or principal). + attr_reader :identities + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'identities' => :'identities' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'identities' => :'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::SignalEntitiesAttributes` 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?(:'identities') + if (value = attributes[:'identities']).is_a?(Array) + self.identities = 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 @identities.nil? + true + end + + # Custom attribute writer method with validation + # @param identities [Object] Object to be assigned + # @!visibility private + def identities=(identities) + if identities.nil? + fail ArgumentError, 'invalid value for "identities", identities cannot be nil.' + end + @identities = identities + 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 && + identities == o.identities && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [identities, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/signal_entities_data.rb b/lib/datadog_api_client/v2/models/signal_entities_data.rb new file mode 100644 index 000000000000..433f386e0f00 --- /dev/null +++ b/lib/datadog_api_client/v2/models/signal_entities_data.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 + # Entities related to a security signal. + class SignalEntitiesData + include BaseGenericModel + + # Attributes containing the entities related to the signal. + attr_reader :attributes + + # The signal ID the entities are associated with. + attr_reader :id + + # The type of the resource. The value should always be `entities`. + 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' => :'SignalEntitiesAttributes', + :'id' => :'String', + :'type' => :'SignalEntitiesType' + } + 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::SignalEntitiesData` 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 @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + 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/signal_entities_response.rb b/lib/datadog_api_client/v2/models/signal_entities_response.rb new file mode 100644 index 000000000000..03fe46cbe51d --- /dev/null +++ b/lib/datadog_api_client/v2/models/signal_entities_response.rb @@ -0,0 +1,123 @@ +=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 + # Response containing entities related to a security signal. + class SignalEntitiesResponse + include BaseGenericModel + + # Entities related to a security signal. + 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' => :'SignalEntitiesData' + } + 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::SignalEntitiesResponse` 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 + + # 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/signal_entities_type.rb b/lib/datadog_api_client/v2/models/signal_entities_type.rb new file mode 100644 index 000000000000..0e9652b2c480 --- /dev/null +++ b/lib/datadog_api_client/v2/models/signal_entities_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 + # The type of the resource. The value should always be `entities`. + class SignalEntitiesType + include BaseEnumModel + + ENTITIES = "entities".freeze + end +end