diff --git a/.apigentools-info b/.apigentools-info index 80b4cf85273..af95e2f538c 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2025-02-06 17:59:36.285895", - "spec_repo_commit": "b89b292b" + "regenerated": "2025-02-06 21:00:05.401238", + "spec_repo_commit": "8cde2ba2" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2025-02-06 17:59:36.301562", - "spec_repo_commit": "b89b292b" + "regenerated": "2025-02-06 21:00:05.417088", + "spec_repo_commit": "8cde2ba2" } } } \ No newline at end of file diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 194508f81c8..aa65274f33f 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -1048,6 +1048,22 @@ components: type: string x-enum-varnames: - API_KEYS + APITrigger: + description: Trigger a workflow VIA an API. The workflow must be published. + properties: + rateLimit: + $ref: '#/components/schemas/TriggerRateLimit' + type: object + APITriggerWrapper: + description: Schema for an API-based trigger. + properties: + apiTrigger: + $ref: '#/components/schemas/APITrigger' + startStepNames: + $ref: '#/components/schemas/StartStepNames' + required: + - apiTrigger + type: object AWSAccountConfigID: description: 'Unique Datadog ID of the AWS Account Integration Config. @@ -1822,6 +1838,56 @@ components: - id - base_severity type: object + Annotation: + description: A list of annotations used in the workflow. These are like sticky + notes for your workflow! + properties: + display: + $ref: '#/components/schemas/AnnotationDisplay' + id: + description: The `Annotation` `id`. + example: '' + type: string + markdownTextAnnotation: + $ref: '#/components/schemas/AnnotationMarkdownTextAnnotation' + required: + - id + - display + - markdownTextAnnotation + type: object + AnnotationDisplay: + description: The definition of `AnnotationDisplay` object. + properties: + bounds: + $ref: '#/components/schemas/AnnotationDisplayBounds' + type: object + AnnotationDisplayBounds: + description: The definition of `AnnotationDisplayBounds` object. + properties: + height: + description: The `bounds` `height`. + format: double + type: number + width: + description: The `bounds` `width`. + format: double + type: number + x: + description: The `bounds` `x`. + format: double + type: number + y: + description: The `bounds` `y`. + format: double + type: number + type: object + AnnotationMarkdownTextAnnotation: + description: The definition of `AnnotationMarkdownTextAnnotation` object. + properties: + text: + description: The `markdownTextAnnotation` `text`. + type: string + type: object ApiID: description: API identifier. example: 90646597-5fdb-4a17-a240-647003f8c028 @@ -1965,6 +2031,17 @@ components: deployment: $ref: '#/components/schemas/DeploymentRelationship' type: object + AppTriggerWrapper: + description: Schema for an App-based trigger. + properties: + appTrigger: + description: Trigger a workflow VIA an App. + type: object + startStepNames: + $ref: '#/components/schemas/StartStepNames' + required: + - appTrigger + type: object ApplicationKeyCreateAttributes: description: Attributes used to create an application Key. properties: @@ -5204,6 +5281,23 @@ components: - OPEN - IN_PROGRESS - CLOSED + CaseTrigger: + description: Trigger a workflow VIA a Case. For automatic triggering a handle + must be configured and the workflow must be published. + properties: + rateLimit: + $ref: '#/components/schemas/TriggerRateLimit' + type: object + CaseTriggerWrapper: + description: Schema for a Case-based trigger. + properties: + caseTrigger: + $ref: '#/components/schemas/CaseTrigger' + startStepNames: + $ref: '#/components/schemas/StartStepNames' + required: + - caseTrigger + type: object CaseType: description: Case type enum: @@ -5421,6 +5515,17 @@ components: type: string x-enum-varnames: - SERVICE + ChangeEventTriggerWrapper: + description: Schema for a Change Event-based trigger. + properties: + changeEventTrigger: + description: Trigger a workflow VIA a Change Event. + type: object + startStepNames: + $ref: '#/components/schemas/StartStepNames' + required: + - changeEventTrigger + type: object ChargebackBreakdown: description: Charges breakdown. properties: @@ -6117,6 +6222,60 @@ components: required: - location type: object + CompletionCondition: + description: The definition of `CompletionCondition` object. + properties: + operand1: + description: The `CompletionCondition` `operand1`. + operand2: + description: The `CompletionCondition` `operand2`. + operator: + $ref: '#/components/schemas/CompletionConditionOperator' + required: + - operand1 + - operator + type: object + CompletionConditionOperator: + description: The definition of `CompletionConditionOperator` object. + enum: + - OPERATOR_EQUAL + - OPERATOR_NOT_EQUAL + - OPERATOR_GREATER_THAN + - OPERATOR_LESS_THAN + - OPERATOR_GREATER_THAN_OR_EQUAL_TO + - OPERATOR_LESS_THAN_OR_EQUAL_TO + - OPERATOR_CONTAINS + - OPERATOR_DOES_NOT_CONTAIN + - OPERATOR_IS_NULL + - OPERATOR_IS_NOT_NULL + - OPERATOR_IS_EMPTY + - OPERATOR_IS_NOT_EMPTY + example: OPERATOR_EQUAL + type: string + x-enum-varnames: + - OPERATOR_EQUAL + - OPERATOR_NOT_EQUAL + - OPERATOR_GREATER_THAN + - OPERATOR_LESS_THAN + - OPERATOR_GREATER_THAN_OR_EQUAL_TO + - OPERATOR_LESS_THAN_OR_EQUAL_TO + - OPERATOR_CONTAINS + - OPERATOR_DOES_NOT_CONTAIN + - OPERATOR_IS_NULL + - OPERATOR_IS_NOT_NULL + - OPERATOR_IS_EMPTY + - OPERATOR_IS_NOT_EMPTY + CompletionGate: + description: Used to create conditions before running subsequent actions. + properties: + completionCondition: + $ref: '#/components/schemas/CompletionCondition' + retryStrategy: + $ref: '#/components/schemas/RetryStrategy' + required: + - completionCondition + - retryStrategy + type: object Component: description: '[Definition of a UI component in the app](https://docs.datadoghq.com/service_management/app_builder/components/)' properties: @@ -6578,6 +6737,70 @@ components: $ref: '#/components/schemas/ConfluentResourceResponseData' type: array type: object + Connection: + description: The definition of `Connection` object. + properties: + connectionId: + description: The `Connection` `connectionId`. + example: '' + type: string + label: + description: The `Connection` `label`. + example: '' + type: string + required: + - connectionId + - label + type: object + ConnectionEnv: + description: A list of connections or connection groups used in the workflow. + properties: + connectionGroups: + description: The `ConnectionEnv` `connectionGroups`. + items: + $ref: '#/components/schemas/ConnectionGroup' + type: array + connections: + description: The `ConnectionEnv` `connections`. + items: + $ref: '#/components/schemas/Connection' + type: array + env: + $ref: '#/components/schemas/ConnectionEnvEnv' + required: + - env + type: object + ConnectionEnvEnv: + description: The definition of `ConnectionEnvEnv` object. + enum: + - default + example: default + type: string + x-enum-varnames: + - DEFAULT + ConnectionGroup: + description: The definition of `ConnectionGroup` object. + properties: + connectionGroupId: + description: The `ConnectionGroup` `connectionGroupId`. + example: '' + type: string + label: + description: The `ConnectionGroup` `label`. + example: '' + type: string + tags: + description: The `ConnectionGroup` `tags`. + example: + - '' + items: + type: string + type: array + required: + - connectionGroupId + - label + - tags + type: object Container: description: Container object. properties: @@ -7557,6 +7780,82 @@ components: type: $ref: '#/components/schemas/RuleType' type: object + CreateWorkflowRequest: + description: A request object for creating a new workflow. + example: + data: + attributes: + description: A sample workflow. + name: Example Workflow + published: true + spec: + annotations: + - display: + bounds: + height: 150 + width: 300 + x: -375 + y: -0.5 + id: 99999999-9999-9999-9999-999999999999 + markdownTextAnnotation: + text: Example annotation. + connectionEnvs: + - connections: + - connectionId: 11111111-1111-1111-1111-111111111111 + label: INTEGRATION_DATADOG + env: default + handle: my-handle + inputSchema: + parameters: + - defaultValue: default + name: input + type: STRING + outputSchema: + parameters: + - name: output + type: ARRAY_OBJECT + value: '{{ Steps.Step1 }}' + steps: + - actionId: com.datadoghq.dd.monitor.listMonitors + connectionLabel: INTEGRATION_DATADOG + name: Step1 + outboundEdges: + - branchName: main + nextStepName: Step2 + parameters: + - name: tags + value: service:monitoring + - actionId: com.datadoghq.core.noop + name: Step2 + triggers: + - monitorTrigger: + rateLimit: + count: 1 + interval: 3600s + startStepNames: + - Step1 + - githubWebhookTrigger: {} + startStepNames: + - Step1 + tags: + - team:infra + - service:monitoring + - foo:bar + type: workflows + properties: + data: + $ref: '#/components/schemas/WorkflowData' + required: + - data + type: object + CreateWorkflowResponse: + description: The response object after creating a new workflow. + properties: + data: + $ref: '#/components/schemas/WorkflowData' + required: + - data + type: object Creator: description: Creator of the object. properties: @@ -9043,6 +9342,17 @@ components: $ref: '#/components/schemas/DashboardListItemResponse' type: array type: object + DashboardTriggerWrapper: + description: Schema for a Dashboard-based trigger. + properties: + dashboardTrigger: + description: Trigger a workflow VIA a Dashboard. + type: object + startStepNames: + $ref: '#/components/schemas/StartStepNames' + required: + - dashboardTrigger + type: object DashboardType: description: The type of the dashboard. enum: @@ -11142,6 +11452,19 @@ components: minLength: 1 type: string type: object + ErrorHandler: + description: Used to handle errors in an action. + properties: + fallbackStepName: + description: The `ErrorHandler` `fallbackStepName`. + example: '' + type: string + retryStrategy: + $ref: '#/components/schemas/RetryStrategy' + required: + - retryStrategy + - fallbackStepName + type: object Event: description: The metadata associated with a request. properties: @@ -12712,6 +13035,12 @@ components: - _HANDLE - EMAIL - _EMAIL + GetWorkflowResponse: + description: The response object after getting a workflow. + properties: + data: + $ref: '#/components/schemas/WorkflowData' + type: object GitCommitSHA: description: Git Commit SHA. example: 66adc9350f2cc9b250b69abddab733dd55e1a588 @@ -12721,6 +13050,26 @@ components: description: Git Repository URL example: https://github.com/organization/example-repository type: string + GithubWebhookTrigger: + description: Trigger a workflow VIA GitHub webhook. To trigger a workflow from + GitHub, you must set a `webhookSecret`. In your GitHub Webhook Settings, set + the Payload URL to "base_url"/api/v2/workflows/"workflow_id"/webhook?orgId="org_id", + select application/json for the content type, and be highly recommend enabling + SSL verification for security. The workflow must be published. + properties: + rateLimit: + $ref: '#/components/schemas/TriggerRateLimit' + type: object + GithubWebhookTriggerWrapper: + description: Schema for a GitHub webhook-based trigger. + properties: + githubWebhookTrigger: + $ref: '#/components/schemas/GithubWebhookTrigger' + startStepNames: + $ref: '#/components/schemas/StartStepNames' + required: + - githubWebhookTrigger + type: object GroupScalarColumn: description: A column containing the tag keys and values in a group. properties: @@ -15012,6 +15361,23 @@ components: type: string x-enum-varnames: - INCIDENT_TODOS + IncidentTrigger: + description: Trigger a workflow VIA an Incident. For automatic triggering a + handle must be configured and the workflow must be published. + properties: + rateLimit: + $ref: '#/components/schemas/TriggerRateLimit' + type: object + IncidentTriggerWrapper: + description: Schema for an Incident-based trigger. + properties: + incidentTrigger: + $ref: '#/components/schemas/IncidentTrigger' + startStepNames: + $ref: '#/components/schemas/StartStepNames' + required: + - incidentTrigger + type: object IncidentType: default: incidents description: Incident resource type. @@ -15456,6 +15822,59 @@ components: - ONCALL - INCIDENT - RELATION + InputSchema: + description: A list of input parameters for the workflow. These can be used + as dynamic runtime values in your workflow. + properties: + parameters: + description: The `InputSchema` `parameters`. + items: + $ref: '#/components/schemas/InputSchemaParameters' + type: array + type: object + InputSchemaParameters: + description: The definition of `InputSchemaParameters` object. + properties: + defaultValue: + description: The `InputSchemaParameters` `defaultValue`. + description: + description: The `InputSchemaParameters` `description`. + type: string + label: + description: The `InputSchemaParameters` `label`. + type: string + name: + description: The `InputSchemaParameters` `name`. + example: '' + type: string + type: + $ref: '#/components/schemas/InputSchemaParametersType' + required: + - name + - type + type: object + InputSchemaParametersType: + description: The definition of `InputSchemaParametersType` object. + enum: + - STRING + - NUMBER + - BOOLEAN + - OBJECT + - ARRAY_STRING + - ARRAY_NUMBER + - ARRAY_BOOLEAN + - ARRAY_OBJECT + example: STRING + type: string + x-enum-varnames: + - STRING + - NUMBER + - BOOLEAN + - OBJECT + - ARRAY_STRING + - ARRAY_NUMBER + - ARRAY_BOOLEAN + - ARRAY_OBJECT IntakePayloadAccepted: description: The payload accepted for intake. properties: @@ -19364,6 +19783,23 @@ components: type: $ref: '#/components/schemas/MonitorDowntimeMatchResourceType' type: object + MonitorTrigger: + description: Trigger a workflow VIA a Monitor. For automatic triggering a handle + must be configured and the workflow must be published. + properties: + rateLimit: + $ref: '#/components/schemas/TriggerRateLimit' + type: object + MonitorTriggerWrapper: + description: Schema for a Monitor-based trigger. + properties: + monitorTrigger: + $ref: '#/components/schemas/MonitorTrigger' + startStepNames: + $ref: '#/components/schemas/StartStepNames' + required: + - monitorTrigger + type: object MonitorType: description: Attributes from the monitor that triggered the event. nullable: true @@ -20127,6 +20563,21 @@ components: type: string x-enum-varnames: - ORGS + OutboundEdge: + description: The definition of `OutboundEdge` object. + properties: + branchName: + description: The `OutboundEdge` `branchName`. + example: '' + type: string + nextStepName: + description: The `OutboundEdge` `nextStepName`. + example: '' + type: string + required: + - nextStepName + - branchName + type: object OutcomeType: default: outcome description: The JSON:API type for an outcome. @@ -20306,6 +20757,60 @@ components: example: /api/v2/scorecard/outcomes?include=rule&page%5Blimit%5D=100&page%5Boffset%5D=100 type: string type: object + OutputSchema: + description: A list of output parameters for the workflow. + properties: + parameters: + description: The `OutputSchema` `parameters`. + items: + $ref: '#/components/schemas/OutputSchemaParameters' + type: array + type: object + OutputSchemaParameters: + description: The definition of `OutputSchemaParameters` object. + properties: + defaultValue: + description: The `OutputSchemaParameters` `defaultValue`. + description: + description: The `OutputSchemaParameters` `description`. + type: string + label: + description: The `OutputSchemaParameters` `label`. + type: string + name: + description: The `OutputSchemaParameters` `name`. + example: '' + type: string + type: + $ref: '#/components/schemas/OutputSchemaParametersType' + value: + description: The `OutputSchemaParameters` `value`. + required: + - name + - type + type: object + OutputSchemaParametersType: + description: The definition of `OutputSchemaParametersType` object. + enum: + - STRING + - NUMBER + - BOOLEAN + - OBJECT + - ARRAY_STRING + - ARRAY_NUMBER + - ARRAY_BOOLEAN + - ARRAY_OBJECT + example: STRING + type: string + x-enum-varnames: + - STRING + - NUMBER + - BOOLEAN + - OBJECT + - ARRAY_STRING + - ARRAY_NUMBER + - ARRAY_BOOLEAN + - ARRAY_OBJECT Pagination: description: Pagination object. properties: @@ -20318,6 +20823,19 @@ components: format: int64 type: integer type: object + Parameter: + description: The definition of `Parameter` object. + properties: + name: + description: The `Parameter` `name`. + example: '' + type: string + value: + description: The `Parameter` `value`. + required: + - name + - value + type: object PartialAPIKey: description: Partial Datadog API key. properties: @@ -21930,6 +22448,24 @@ components: from the other indexes type: string type: object + ReadinessGate: + description: Used to merge multiple branches into a single branch. + properties: + thresholdType: + $ref: '#/components/schemas/ReadinessGateThresholdType' + required: + - thresholdType + type: object + ReadinessGateThresholdType: + description: The definition of `ReadinessGateThresholdType` object. + enum: + - ANY + - ALL + example: ANY + type: string + x-enum-varnames: + - ANY + - ALL RelationType: description: Supported relation types. enum: @@ -22851,6 +23387,41 @@ components: required: - data type: object + RetryStrategy: + description: The definition of `RetryStrategy` object. + properties: + kind: + $ref: '#/components/schemas/RetryStrategyKind' + linear: + $ref: '#/components/schemas/RetryStrategyLinear' + required: + - kind + type: object + RetryStrategyKind: + description: The definition of `RetryStrategyKind` object. + enum: + - RETRY_STRATEGY_LINEAR + example: RETRY_STRATEGY_LINEAR + type: string + x-enum-varnames: + - RETRY_STRATEGY_LINEAR + RetryStrategyLinear: + description: The definition of `RetryStrategyLinear` object. + properties: + interval: + description: The `RetryStrategyLinear` `interval`. The expected format is + the number of seconds ending with an s. For example, 1 day is 86400s + example: '' + type: string + maxRetries: + description: The `RetryStrategyLinear` `maxRetries`. + example: 0.0 + format: double + type: number + required: + - interval + - maxRetries + type: object Role: description: Role object returned by the API. properties: @@ -23957,6 +24528,26 @@ components: type: $ref: '#/components/schemas/ScalarFormulaResponseType' type: object + ScheduleTrigger: + description: Trigger a workflow VIA a Schedule. The workflow must be published. + properties: + rruleExpression: + description: Recurrence rule expression for scheduling. + example: '' + type: string + required: + - rruleExpression + type: object + ScheduleTriggerWrapper: + description: Schema for a Schedule-based trigger. + properties: + scheduleTrigger: + $ref: '#/components/schemas/ScheduleTrigger' + startStepNames: + $ref: '#/components/schemas/StartStepNames' + required: + - scheduleTrigger + type: object ScorecardType: default: scorecard description: The JSON:API type for scorecard. @@ -26124,6 +26715,23 @@ components: nullable: true type: string type: object + SecurityTrigger: + description: Trigger a workflow VIA a Security Signal or Finding. For automatic + triggering a handle must be configured and the workflow must be published. + properties: + rateLimit: + $ref: '#/components/schemas/TriggerRateLimit' + type: object + SecurityTriggerWrapper: + description: Schema for a Security-based trigger. + properties: + securityTrigger: + $ref: '#/components/schemas/SecurityTrigger' + startStepNames: + $ref: '#/components/schemas/StartStepNames' + required: + - securityTrigger + type: object Selectors: description: 'Selectors are used to filter security issues for which notifications should be generated. @@ -27879,6 +28487,17 @@ components: - channel_name - redirect_url type: object + SlackTriggerWrapper: + description: Schema for a Slack-based trigger. + properties: + slackTrigger: + description: Trigger a workflow VIA Slack. The workflow must be published. + type: object + startStepNames: + $ref: '#/components/schemas/StartStepNames' + required: + - slackTrigger + type: object SloReportCreateRequest: description: The SLO report request body. properties: @@ -28801,6 +29420,41 @@ components: from the other indexes type: string type: object + Spec: + description: The spec defines what the workflow does. + properties: + annotations: + description: A list of annotations used in the workflow. These are like + sticky notes for your workflow! + items: + $ref: '#/components/schemas/Annotation' + type: array + connectionEnvs: + description: A list of connections or connection groups used in the workflow. + items: + $ref: '#/components/schemas/ConnectionEnv' + type: array + handle: + description: Unique identifier used to trigger workflows automatically in + Datadog. + type: string + inputSchema: + $ref: '#/components/schemas/InputSchema' + outputSchema: + $ref: '#/components/schemas/OutputSchema' + steps: + description: A `Step` is a sub-component of a workflow. Each `Step` performs + an action. + items: + $ref: '#/components/schemas/Step' + type: array + triggers: + description: The list of triggers that activate this workflow. At least + one trigger is required, and each trigger type may appear at most once. + items: + $ref: '#/components/schemas/Trigger' + type: array + type: object SpecVersion: description: The version of the CycloneDX specification a BOM conforms to. enum: @@ -28819,6 +29473,14 @@ components: - ONE_THREE - ONE_FOUR - ONE_FIVE + StartStepNames: + description: A list of steps that run first after a trigger fires. + example: + - '' + items: + description: The `StartStepNames` `items`. + type: string + type: array State: description: The state of the rule evaluation. enum: @@ -28831,6 +29493,64 @@ components: - PASS - FAIL - SKIP + Step: + description: A Step is a sub-component of a workflow. Each Step performs an + action. + properties: + actionId: + description: The unique identifier of an action. + example: '' + type: string + completionGate: + $ref: '#/components/schemas/CompletionGate' + connectionLabel: + description: The unique identifier of a connection defined in the spec. + type: string + display: + $ref: '#/components/schemas/StepDisplay' + errorHandlers: + description: The `Step` `errorHandlers`. + items: + $ref: '#/components/schemas/ErrorHandler' + type: array + name: + description: Name of the step. + example: '' + type: string + outboundEdges: + description: A list of subsequent actions to run. + items: + $ref: '#/components/schemas/OutboundEdge' + type: array + parameters: + description: A list of inputs for an action. + items: + $ref: '#/components/schemas/Parameter' + type: array + readinessGate: + $ref: '#/components/schemas/ReadinessGate' + required: + - name + - actionId + type: object + StepDisplay: + description: The definition of `StepDisplay` object. + properties: + bounds: + $ref: '#/components/schemas/StepDisplayBounds' + type: object + StepDisplayBounds: + description: The definition of `StepDisplayBounds` object. + properties: + x: + description: The `bounds` `x`. + format: double + type: number + y: + description: The `bounds` `y`. + format: double + type: number + type: object TagsEventAttribute: description: Array of tags associated with your event. example: @@ -29637,6 +30357,33 @@ components: type: string x-enum-varnames: - SECRET + Trigger: + description: One of the triggers that can start the execution of a workflow. + oneOf: + - $ref: '#/components/schemas/APITriggerWrapper' + - $ref: '#/components/schemas/AppTriggerWrapper' + - $ref: '#/components/schemas/CaseTriggerWrapper' + - $ref: '#/components/schemas/ChangeEventTriggerWrapper' + - $ref: '#/components/schemas/DashboardTriggerWrapper' + - $ref: '#/components/schemas/GithubWebhookTriggerWrapper' + - $ref: '#/components/schemas/IncidentTriggerWrapper' + - $ref: '#/components/schemas/MonitorTriggerWrapper' + - $ref: '#/components/schemas/ScheduleTriggerWrapper' + - $ref: '#/components/schemas/SecurityTriggerWrapper' + - $ref: '#/components/schemas/SlackTriggerWrapper' + - $ref: '#/components/schemas/WorkflowTriggerWrapper' + TriggerRateLimit: + description: Defines a rate limit for a trigger. + properties: + count: + description: The `TriggerRateLimit` `count`. + format: int64 + type: integer + interval: + description: The `TriggerRateLimit` `interval`. The expected format is the + number of seconds ending with an s. For example, 1 day is 86400s + type: string + type: object TriggerSource: description: 'The type of security issues on which the rule applies. Notification rules based on security signals need to use the trigger source "security_signals", @@ -29926,6 +30673,81 @@ components: type: $ref: '#/components/schemas/RuleType' type: object + UpdateWorkflowRequest: + description: A request object for updating an existing workflow. + example: + data: + attributes: + description: A sample workflow. + name: Example Workflow + published: true + spec: + annotations: + - display: + bounds: + height: 150 + width: 300 + x: -375 + y: -0.5 + id: 99999999-9999-9999-9999-999999999999 + markdownTextAnnotation: + text: Example annotation. + connectionEnvs: + - connections: + - connectionId: 11111111-1111-1111-1111-111111111111 + label: INTEGRATION_DATADOG + env: default + handle: my-handle + inputSchema: + parameters: + - defaultValue: default + name: input + type: STRING + outputSchema: + parameters: + - name: output + type: ARRAY_OBJECT + value: '{{ Steps.Step1 }}' + steps: + - actionId: com.datadoghq.dd.monitor.listMonitors + connectionLabel: INTEGRATION_DATADOG + name: Step1 + outboundEdges: + - branchName: main + nextStepName: Step2 + parameters: + - name: tags + value: service:monitoring + - actionId: com.datadoghq.core.noop + name: Step2 + triggers: + - monitorTrigger: + rateLimit: + count: 1 + interval: 3600s + startStepNames: + - Step1 + - githubWebhookTrigger: {} + startStepNames: + - Step1 + tags: + - team:infra + - service:monitoring + - foo:bar + id: 22222222-2222-2222-2222-222222222222 + type: workflows + properties: + data: + $ref: '#/components/schemas/WorkflowDataUpdate' + required: + - data + type: object + UpdateWorkflowResponse: + description: The response object after updating a workflow. + properties: + data: + $ref: '#/components/schemas/WorkflowDataUpdate' + type: object UpsertCatalogEntityRequest: description: Create or update entity request. oneOf: @@ -30977,6 +31799,134 @@ components: - PAST_SIX_MONTHS - PAST_ONE_YEAR - ALERT + WorkflowData: + description: Data related to the workflow. + properties: + attributes: + $ref: '#/components/schemas/WorkflowDataAttributes' + id: + description: The workflow identifier + readOnly: true + type: string + relationships: + $ref: '#/components/schemas/WorkflowDataRelationships' + type: + $ref: '#/components/schemas/WorkflowDataType' + required: + - type + - attributes + type: object + WorkflowDataAttributes: + description: The definition of `WorkflowDataAttributes` object. + properties: + createdAt: + description: When the workflow was created. + format: date-time + readOnly: true + type: string + description: + description: Description of the workflow. + type: string + name: + description: Name of the workflow. + example: '' + type: string + published: + description: Set the workflow to published or unpublished. Workflows in + an unpublished state will only be executable via manual runs. Automatic + triggers such as Schedule will not execute the workflow until it is published. + type: boolean + spec: + $ref: '#/components/schemas/Spec' + tags: + description: Tags of the workflow. + items: + type: string + type: array + updatedAt: + description: When the workflow was last updated. + format: date-time + readOnly: true + type: string + webhookSecret: + description: If a Webhook trigger is defined on this workflow, a webhookSecret + is required and should be provided here. + type: string + writeOnly: true + required: + - name + - spec + type: object + WorkflowDataRelationships: + description: The definition of `WorkflowDataRelationships` object. + properties: + creator: + $ref: '#/components/schemas/WorkflowUserRelationship' + owner: + $ref: '#/components/schemas/WorkflowUserRelationship' + readOnly: true + type: object + WorkflowDataType: + description: The definition of `WorkflowDataType` object. + enum: + - workflows + example: workflows + type: string + x-enum-varnames: + - WORKFLOWS + WorkflowDataUpdate: + description: Data related to the workflow being updated. + properties: + attributes: + $ref: '#/components/schemas/WorkflowDataUpdateAttributes' + id: + description: The workflow identifier + type: string + relationships: + $ref: '#/components/schemas/WorkflowDataRelationships' + type: + $ref: '#/components/schemas/WorkflowDataType' + required: + - type + - attributes + type: object + WorkflowDataUpdateAttributes: + description: The definition of `WorkflowDataUpdateAttributes` object. + properties: + createdAt: + description: When the workflow was created. + format: date-time + readOnly: true + type: string + description: + description: Description of the workflow. + type: string + name: + description: Name of the workflow. + type: string + published: + description: Set the workflow to published or unpublished. Workflows in + an unpublished state will only be executable via manual runs. Automatic + triggers such as Schedule will not execute the workflow until it is published. + type: boolean + spec: + $ref: '#/components/schemas/Spec' + tags: + description: Tags of the workflow. + items: + type: string + type: array + updatedAt: + description: When the workflow was last updated. + format: date-time + readOnly: true + type: string + webhookSecret: + description: If a Webhook trigger is defined on this workflow, a webhookSecret + is required and should be provided here. + type: string + writeOnly: true + type: object WorkflowInstanceCreateMeta: description: Additional information for creating a workflow instance. properties: @@ -31043,6 +31993,45 @@ components: format: int64 type: integer type: object + WorkflowTriggerWrapper: + description: Schema for a Workflow-based trigger. + properties: + startStepNames: + $ref: '#/components/schemas/StartStepNames' + workflowTrigger: + description: Trigger a workflow VIA the Datadog UI. Only required if no + other trigger exists. + type: object + required: + - workflowTrigger + type: object + WorkflowUserRelationship: + description: The definition of `WorkflowUserRelationship` object. + properties: + data: + $ref: '#/components/schemas/WorkflowUserRelationshipData' + type: object + WorkflowUserRelationshipData: + description: The definition of `WorkflowUserRelationshipData` object. + properties: + id: + description: The user identifier + example: '' + type: string + type: + $ref: '#/components/schemas/WorkflowUserRelationshipType' + required: + - type + - id + type: object + WorkflowUserRelationshipType: + description: The definition of `WorkflowUserRelationshipType` object. + enum: + - users + example: users + type: string + x-enum-varnames: + - USERS WorklflowCancelInstanceResponse: description: Information about the canceled instance. properties: @@ -49743,6 +50732,198 @@ paths: operator: OR permissions: - teams_read + /api/v2/workflows: + post: + description: Create a new workflow, returning the workflow ID. This API requires + an application key scoped with the workflows_write permission. + operationId: CreateWorkflow + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateWorkflowRequest' + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/CreateWorkflowResponse' + description: Successfully created a workflow. + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Forbidden + '429': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Too many requests + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - workflows_write + summary: Create a Workflow + tags: + - Workflow Automation + x-permission: + operator: OR + permissions: + - workflows_write + /api/v2/workflows/{workflow_id}: + delete: + description: Delete a workflow by ID. This API requires an application key scoped + with the workflows_write permission. + operationId: DeleteWorkflow + parameters: + - $ref: '#/components/parameters/WorkflowId' + responses: + '204': + description: Successfully deleted a workflow. + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Not found + '429': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Too many requests + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - workflows_write + summary: Delete an existing Workflow + tags: + - Workflow Automation + x-permission: + operator: OR + permissions: + - workflows_write + get: + description: Get a workflow by ID. This API requires an application key scoped + with the workflows_read permission. + operationId: GetWorkflow + parameters: + - $ref: '#/components/parameters/WorkflowId' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/GetWorkflowResponse' + description: Successfully got a workflow. + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Not found + '429': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Too many requests + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - workflows_read + summary: Get an existing Workflow + tags: + - Workflow Automation + x-permission: + operator: OR + permissions: + - workflows_read + patch: + description: Update a workflow by ID. This API requires an application key scoped + with the workflows_write permission. + operationId: UpdateWorkflow + parameters: + - $ref: '#/components/parameters/WorkflowId' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateWorkflowRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateWorkflowResponse' + description: Successfully updated a workflow. + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Not found + '429': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Too many requests + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - workflows_write + summary: Update an existing Workflow + tags: + - Workflow Automation + x-permission: + operator: OR + permissions: + - workflows_write /api/v2/workflows/{workflow_id}/instances: get: description: List all instances of a given workflow. This API requires an application diff --git a/examples/v2/workflow-automation/CreateWorkflow.java b/examples/v2/workflow-automation/CreateWorkflow.java new file mode 100644 index 00000000000..490caa0a0f1 --- /dev/null +++ b/examples/v2/workflow-automation/CreateWorkflow.java @@ -0,0 +1,128 @@ +// Create a Workflow returns "Successfully created a workflow." response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.WorkflowAutomationApi; +import com.datadog.api.client.v2.model.Connection; +import com.datadog.api.client.v2.model.ConnectionEnv; +import com.datadog.api.client.v2.model.ConnectionEnvEnv; +import com.datadog.api.client.v2.model.CreateWorkflowRequest; +import com.datadog.api.client.v2.model.CreateWorkflowResponse; +import com.datadog.api.client.v2.model.GithubWebhookTrigger; +import com.datadog.api.client.v2.model.GithubWebhookTriggerWrapper; +import com.datadog.api.client.v2.model.InputSchema; +import com.datadog.api.client.v2.model.InputSchemaParameters; +import com.datadog.api.client.v2.model.InputSchemaParametersType; +import com.datadog.api.client.v2.model.MonitorTrigger; +import com.datadog.api.client.v2.model.MonitorTriggerWrapper; +import com.datadog.api.client.v2.model.OutboundEdge; +import com.datadog.api.client.v2.model.OutputSchema; +import com.datadog.api.client.v2.model.OutputSchemaParameters; +import com.datadog.api.client.v2.model.OutputSchemaParametersType; +import com.datadog.api.client.v2.model.Parameter; +import com.datadog.api.client.v2.model.Spec; +import com.datadog.api.client.v2.model.Step; +import com.datadog.api.client.v2.model.Trigger; +import com.datadog.api.client.v2.model.TriggerRateLimit; +import com.datadog.api.client.v2.model.WorkflowData; +import com.datadog.api.client.v2.model.WorkflowDataAttributes; +import com.datadog.api.client.v2.model.WorkflowDataType; +import java.util.Arrays; +import java.util.Collections; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + WorkflowAutomationApi apiInstance = new WorkflowAutomationApi(defaultClient); + + CreateWorkflowRequest body = + new CreateWorkflowRequest() + .data( + new WorkflowData() + .attributes( + new WorkflowDataAttributes() + .description("A sample workflow.") + .name("Example Workflow") + .published(true) + .spec( + new Spec() + .connectionEnvs( + Collections.singletonList( + new ConnectionEnv() + .connections( + Collections.singletonList( + new Connection() + .connectionId( + "11111111-1111-1111-1111-111111111111") + .label("INTEGRATION_DATADOG"))) + .env(ConnectionEnvEnv.DEFAULT))) + .handle("my-handle") + .inputSchema( + new InputSchema() + .parameters( + Collections.singletonList( + new InputSchemaParameters() + .defaultValue("default") + .name("input") + .type(InputSchemaParametersType.STRING)))) + .outputSchema( + new OutputSchema() + .parameters( + Collections.singletonList( + new OutputSchemaParameters() + .name("output") + .type( + OutputSchemaParametersType.ARRAY_OBJECT) + .value("outputValue")))) + .steps( + Arrays.asList( + new Step() + .actionId("com.datadoghq.dd.monitor.listMonitors") + .connectionLabel("INTEGRATION_DATADOG") + .name("Step1") + .outboundEdges( + Collections.singletonList( + new OutboundEdge() + .branchName("main") + .nextStepName("Step2"))) + .parameters( + Collections.singletonList( + new Parameter() + .name("tags") + .value("service:monitoring"))), + new Step() + .actionId("com.datadoghq.core.noop") + .name("Step2"))) + .triggers( + Arrays.asList( + new Trigger( + new MonitorTriggerWrapper() + .monitorTrigger( + new MonitorTrigger() + .rateLimit( + new TriggerRateLimit() + .count(1L) + .interval("3600s"))) + .startStepNames( + Collections.singletonList("Step1"))), + new Trigger( + new GithubWebhookTriggerWrapper() + .startStepNames( + Collections.singletonList("Step1")) + .githubWebhookTrigger( + new GithubWebhookTrigger()))))) + .tags(Arrays.asList("team:infra", "service:monitoring", "foo:bar"))) + .type(WorkflowDataType.WORKFLOWS)); + + try { + CreateWorkflowResponse result = apiInstance.createWorkflow(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling WorkflowAutomationApi#createWorkflow"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/workflow-automation/DeleteWorkflow.java b/examples/v2/workflow-automation/DeleteWorkflow.java new file mode 100644 index 00000000000..5110bdf07a8 --- /dev/null +++ b/examples/v2/workflow-automation/DeleteWorkflow.java @@ -0,0 +1,25 @@ +// Delete an existing Workflow returns "Successfully deleted a workflow." response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.WorkflowAutomationApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + WorkflowAutomationApi apiInstance = new WorkflowAutomationApi(defaultClient); + + // there is a valid "workflow" in the system + String WORKFLOW_DATA_ID = System.getenv("WORKFLOW_DATA_ID"); + + try { + apiInstance.deleteWorkflow(WORKFLOW_DATA_ID); + } catch (ApiException e) { + System.err.println("Exception when calling WorkflowAutomationApi#deleteWorkflow"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/workflow-automation/GetWorkflow.java b/examples/v2/workflow-automation/GetWorkflow.java new file mode 100644 index 00000000000..822a466af42 --- /dev/null +++ b/examples/v2/workflow-automation/GetWorkflow.java @@ -0,0 +1,27 @@ +// Get an existing Workflow returns "Successfully got a workflow." response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.WorkflowAutomationApi; +import com.datadog.api.client.v2.model.GetWorkflowResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + WorkflowAutomationApi apiInstance = new WorkflowAutomationApi(defaultClient); + + // there is a valid "workflow" in the system + String WORKFLOW_DATA_ID = System.getenv("WORKFLOW_DATA_ID"); + + try { + GetWorkflowResponse result = apiInstance.getWorkflow(WORKFLOW_DATA_ID); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling WorkflowAutomationApi#getWorkflow"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/workflow-automation/UpdateWorkflow.java b/examples/v2/workflow-automation/UpdateWorkflow.java new file mode 100644 index 00000000000..6fe21fa027c --- /dev/null +++ b/examples/v2/workflow-automation/UpdateWorkflow.java @@ -0,0 +1,132 @@ +// Update an existing Workflow returns "Successfully updated a workflow." response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.WorkflowAutomationApi; +import com.datadog.api.client.v2.model.Connection; +import com.datadog.api.client.v2.model.ConnectionEnv; +import com.datadog.api.client.v2.model.ConnectionEnvEnv; +import com.datadog.api.client.v2.model.GithubWebhookTrigger; +import com.datadog.api.client.v2.model.GithubWebhookTriggerWrapper; +import com.datadog.api.client.v2.model.InputSchema; +import com.datadog.api.client.v2.model.InputSchemaParameters; +import com.datadog.api.client.v2.model.InputSchemaParametersType; +import com.datadog.api.client.v2.model.MonitorTrigger; +import com.datadog.api.client.v2.model.MonitorTriggerWrapper; +import com.datadog.api.client.v2.model.OutboundEdge; +import com.datadog.api.client.v2.model.OutputSchema; +import com.datadog.api.client.v2.model.OutputSchemaParameters; +import com.datadog.api.client.v2.model.OutputSchemaParametersType; +import com.datadog.api.client.v2.model.Parameter; +import com.datadog.api.client.v2.model.Spec; +import com.datadog.api.client.v2.model.Step; +import com.datadog.api.client.v2.model.Trigger; +import com.datadog.api.client.v2.model.TriggerRateLimit; +import com.datadog.api.client.v2.model.UpdateWorkflowRequest; +import com.datadog.api.client.v2.model.UpdateWorkflowResponse; +import com.datadog.api.client.v2.model.WorkflowDataType; +import com.datadog.api.client.v2.model.WorkflowDataUpdate; +import com.datadog.api.client.v2.model.WorkflowDataUpdateAttributes; +import java.util.Arrays; +import java.util.Collections; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + WorkflowAutomationApi apiInstance = new WorkflowAutomationApi(defaultClient); + + // there is a valid "workflow" in the system + String WORKFLOW_DATA_ID = System.getenv("WORKFLOW_DATA_ID"); + + UpdateWorkflowRequest body = + new UpdateWorkflowRequest() + .data( + new WorkflowDataUpdate() + .attributes( + new WorkflowDataUpdateAttributes() + .description("A sample workflow.") + .name("Example Workflow") + .published(true) + .spec( + new Spec() + .connectionEnvs( + Collections.singletonList( + new ConnectionEnv() + .connections( + Collections.singletonList( + new Connection() + .connectionId( + "11111111-1111-1111-1111-111111111111") + .label("INTEGRATION_DATADOG"))) + .env(ConnectionEnvEnv.DEFAULT))) + .handle("my-handle") + .inputSchema( + new InputSchema() + .parameters( + Collections.singletonList( + new InputSchemaParameters() + .defaultValue("default") + .name("input") + .type(InputSchemaParametersType.STRING)))) + .outputSchema( + new OutputSchema() + .parameters( + Collections.singletonList( + new OutputSchemaParameters() + .name("output") + .type( + OutputSchemaParametersType.ARRAY_OBJECT) + .value("outputValue")))) + .steps( + Arrays.asList( + new Step() + .actionId("com.datadoghq.dd.monitor.listMonitors") + .connectionLabel("INTEGRATION_DATADOG") + .name("Step1") + .outboundEdges( + Collections.singletonList( + new OutboundEdge() + .branchName("main") + .nextStepName("Step2"))) + .parameters( + Collections.singletonList( + new Parameter() + .name("tags") + .value("service:monitoring"))), + new Step() + .actionId("com.datadoghq.core.noop") + .name("Step2"))) + .triggers( + Arrays.asList( + new Trigger( + new MonitorTriggerWrapper() + .monitorTrigger( + new MonitorTrigger() + .rateLimit( + new TriggerRateLimit() + .count(1L) + .interval("3600s"))) + .startStepNames( + Collections.singletonList("Step1"))), + new Trigger( + new GithubWebhookTriggerWrapper() + .startStepNames( + Collections.singletonList("Step1")) + .githubWebhookTrigger( + new GithubWebhookTrigger()))))) + .tags(Arrays.asList("team:infra", "service:monitoring", "foo:bar"))) + .id("22222222-2222-2222-2222-222222222222") + .type(WorkflowDataType.WORKFLOWS)); + + try { + UpdateWorkflowResponse result = apiInstance.updateWorkflow(WORKFLOW_DATA_ID, body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling WorkflowAutomationApi#updateWorkflow"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/src/main/java/com/datadog/api/client/v2/api/WorkflowAutomationApi.java b/src/main/java/com/datadog/api/client/v2/api/WorkflowAutomationApi.java index 24897e7ee0f..35f686c590c 100644 --- a/src/main/java/com/datadog/api/client/v2/api/WorkflowAutomationApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/WorkflowAutomationApi.java @@ -4,6 +4,11 @@ import com.datadog.api.client.ApiException; import com.datadog.api.client.ApiResponse; import com.datadog.api.client.Pair; +import com.datadog.api.client.v2.model.CreateWorkflowRequest; +import com.datadog.api.client.v2.model.CreateWorkflowResponse; +import com.datadog.api.client.v2.model.GetWorkflowResponse; +import com.datadog.api.client.v2.model.UpdateWorkflowRequest; +import com.datadog.api.client.v2.model.UpdateWorkflowResponse; import com.datadog.api.client.v2.model.WorkflowInstanceCreateRequest; import com.datadog.api.client.v2.model.WorkflowInstanceCreateResponse; import com.datadog.api.client.v2.model.WorkflowListInstancesResponse; @@ -217,6 +222,138 @@ public ApiResponse cancelWorkflowInstanceWithHt new GenericType() {}); } + /** + * Create a Workflow. + * + *

See {@link #createWorkflowWithHttpInfo}. + * + * @param body (required) + * @return CreateWorkflowResponse + * @throws ApiException if fails to make API call + */ + public CreateWorkflowResponse createWorkflow(CreateWorkflowRequest body) throws ApiException { + return createWorkflowWithHttpInfo(body).getData(); + } + + /** + * Create a Workflow. + * + *

See {@link #createWorkflowWithHttpInfoAsync}. + * + * @param body (required) + * @return CompletableFuture<CreateWorkflowResponse> + */ + public CompletableFuture createWorkflowAsync(CreateWorkflowRequest body) { + return createWorkflowWithHttpInfoAsync(body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Create a new workflow, returning the workflow ID. This API requires an application key scoped + * with the workflows_write permission. + * + * @param body (required) + * @return ApiResponse<CreateWorkflowResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
201 Successfully created a workflow. -
400 Bad request -
403 Forbidden -
429 Too many requests -
+ */ + public ApiResponse createWorkflowWithHttpInfo(CreateWorkflowRequest body) + throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling createWorkflow"); + } + // create path and map variables + String localVarPath = "/api/v2/workflows"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.WorkflowAutomationApi.createWorkflow", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Create a Workflow. + * + *

See {@link #createWorkflowWithHttpInfo}. + * + * @param body (required) + * @return CompletableFuture<ApiResponse<CreateWorkflowResponse>> + */ + public CompletableFuture> createWorkflowWithHttpInfoAsync( + CreateWorkflowRequest body) { + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'body' when calling createWorkflow")); + return result; + } + // create path and map variables + String localVarPath = "/api/v2/workflows"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.WorkflowAutomationApi.createWorkflow", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + /** * Execute a workflow. * @@ -381,6 +518,280 @@ public ApiResponse createWorkflowInstanceWithHtt new GenericType() {}); } + /** + * Delete an existing Workflow. + * + *

See {@link #deleteWorkflowWithHttpInfo}. + * + * @param workflowId The ID of the workflow. (required) + * @throws ApiException if fails to make API call + */ + public void deleteWorkflow(String workflowId) throws ApiException { + deleteWorkflowWithHttpInfo(workflowId); + } + + /** + * Delete an existing Workflow. + * + *

See {@link #deleteWorkflowWithHttpInfoAsync}. + * + * @param workflowId The ID of the workflow. (required) + * @return CompletableFuture + */ + public CompletableFuture deleteWorkflowAsync(String workflowId) { + return deleteWorkflowWithHttpInfoAsync(workflowId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Delete a workflow by ID. This API requires an application key scoped with the workflows_write + * permission. + * + * @param workflowId The ID of the workflow. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
204 Successfully deleted a workflow. -
403 Forbidden -
404 Not found -
429 Too many requests -
+ */ + public ApiResponse deleteWorkflowWithHttpInfo(String workflowId) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'workflowId' is set + if (workflowId == null) { + throw new ApiException( + 400, "Missing the required parameter 'workflowId' when calling deleteWorkflow"); + } + // create path and map variables + String localVarPath = + "/api/v2/workflows/{workflow_id}" + .replaceAll( + "\\{" + "workflow_id" + "\\}", apiClient.escapeString(workflowId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.WorkflowAutomationApi.deleteWorkflow", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "DELETE", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Delete an existing Workflow. + * + *

See {@link #deleteWorkflowWithHttpInfo}. + * + * @param workflowId The ID of the workflow. (required) + * @return CompletableFuture<ApiResponse<Void>> + */ + public CompletableFuture> deleteWorkflowWithHttpInfoAsync(String workflowId) { + Object localVarPostBody = null; + + // verify the required parameter 'workflowId' is set + if (workflowId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'workflowId' when calling deleteWorkflow")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/workflows/{workflow_id}" + .replaceAll( + "\\{" + "workflow_id" + "\\}", apiClient.escapeString(workflowId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.WorkflowAutomationApi.deleteWorkflow", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "DELETE", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Get an existing Workflow. + * + *

See {@link #getWorkflowWithHttpInfo}. + * + * @param workflowId The ID of the workflow. (required) + * @return GetWorkflowResponse + * @throws ApiException if fails to make API call + */ + public GetWorkflowResponse getWorkflow(String workflowId) throws ApiException { + return getWorkflowWithHttpInfo(workflowId).getData(); + } + + /** + * Get an existing Workflow. + * + *

See {@link #getWorkflowWithHttpInfoAsync}. + * + * @param workflowId The ID of the workflow. (required) + * @return CompletableFuture<GetWorkflowResponse> + */ + public CompletableFuture getWorkflowAsync(String workflowId) { + return getWorkflowWithHttpInfoAsync(workflowId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get a workflow by ID. This API requires an application key scoped with the workflows_read + * permission. + * + * @param workflowId The ID of the workflow. (required) + * @return ApiResponse<GetWorkflowResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 Successfully got a workflow. -
400 Bad request -
403 Forbidden -
404 Not found -
429 Too many requests -
+ */ + public ApiResponse getWorkflowWithHttpInfo(String workflowId) + throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'workflowId' is set + if (workflowId == null) { + throw new ApiException( + 400, "Missing the required parameter 'workflowId' when calling getWorkflow"); + } + // create path and map variables + String localVarPath = + "/api/v2/workflows/{workflow_id}" + .replaceAll( + "\\{" + "workflow_id" + "\\}", apiClient.escapeString(workflowId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.WorkflowAutomationApi.getWorkflow", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get an existing Workflow. + * + *

See {@link #getWorkflowWithHttpInfo}. + * + * @param workflowId The ID of the workflow. (required) + * @return CompletableFuture<ApiResponse<GetWorkflowResponse>> + */ + public CompletableFuture> getWorkflowWithHttpInfoAsync( + String workflowId) { + Object localVarPostBody = null; + + // verify the required parameter 'workflowId' is set + if (workflowId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'workflowId' when calling getWorkflow")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/workflows/{workflow_id}" + .replaceAll( + "\\{" + "workflow_id" + "\\}", apiClient.escapeString(workflowId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.WorkflowAutomationApi.getWorkflow", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + /** * Get a workflow instance. * @@ -770,4 +1181,164 @@ public ApiResponse listWorkflowInstancesWithHttpI false, new GenericType() {}); } + + /** + * Update an existing Workflow. + * + *

See {@link #updateWorkflowWithHttpInfo}. + * + * @param workflowId The ID of the workflow. (required) + * @param body (required) + * @return UpdateWorkflowResponse + * @throws ApiException if fails to make API call + */ + public UpdateWorkflowResponse updateWorkflow(String workflowId, UpdateWorkflowRequest body) + throws ApiException { + return updateWorkflowWithHttpInfo(workflowId, body).getData(); + } + + /** + * Update an existing Workflow. + * + *

See {@link #updateWorkflowWithHttpInfoAsync}. + * + * @param workflowId The ID of the workflow. (required) + * @param body (required) + * @return CompletableFuture<UpdateWorkflowResponse> + */ + public CompletableFuture updateWorkflowAsync( + String workflowId, UpdateWorkflowRequest body) { + return updateWorkflowWithHttpInfoAsync(workflowId, body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Update a workflow by ID. This API requires an application key scoped with the workflows_write + * permission. + * + * @param workflowId The ID of the workflow. (required) + * @param body (required) + * @return ApiResponse<UpdateWorkflowResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 Successfully updated a workflow. -
400 Bad request -
403 Forbidden -
404 Not found -
429 Too many requests -
+ */ + public ApiResponse updateWorkflowWithHttpInfo( + String workflowId, UpdateWorkflowRequest body) throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'workflowId' is set + if (workflowId == null) { + throw new ApiException( + 400, "Missing the required parameter 'workflowId' when calling updateWorkflow"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling updateWorkflow"); + } + // create path and map variables + String localVarPath = + "/api/v2/workflows/{workflow_id}" + .replaceAll( + "\\{" + "workflow_id" + "\\}", apiClient.escapeString(workflowId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.WorkflowAutomationApi.updateWorkflow", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "PATCH", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Update an existing Workflow. + * + *

See {@link #updateWorkflowWithHttpInfo}. + * + * @param workflowId The ID of the workflow. (required) + * @param body (required) + * @return CompletableFuture<ApiResponse<UpdateWorkflowResponse>> + */ + public CompletableFuture> updateWorkflowWithHttpInfoAsync( + String workflowId, UpdateWorkflowRequest body) { + Object localVarPostBody = body; + + // verify the required parameter 'workflowId' is set + if (workflowId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'workflowId' when calling updateWorkflow")); + return result; + } + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'body' when calling updateWorkflow")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/workflows/{workflow_id}" + .replaceAll( + "\\{" + "workflow_id" + "\\}", apiClient.escapeString(workflowId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.WorkflowAutomationApi.updateWorkflow", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "PATCH", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } } diff --git a/src/main/java/com/datadog/api/client/v2/model/APITrigger.java b/src/main/java/com/datadog/api/client/v2/model/APITrigger.java new file mode 100644 index 00000000000..910495bd516 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/APITrigger.java @@ -0,0 +1,136 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Trigger a workflow VIA an API. The workflow must be published. */ +@JsonPropertyOrder({APITrigger.JSON_PROPERTY_RATE_LIMIT}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class APITrigger { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_RATE_LIMIT = "rateLimit"; + private TriggerRateLimit rateLimit; + + public APITrigger rateLimit(TriggerRateLimit rateLimit) { + this.rateLimit = rateLimit; + this.unparsed |= rateLimit.unparsed; + return this; + } + + /** + * Defines a rate limit for a trigger. + * + * @return rateLimit + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RATE_LIMIT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TriggerRateLimit getRateLimit() { + return rateLimit; + } + + public void setRateLimit(TriggerRateLimit rateLimit) { + this.rateLimit = rateLimit; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return APITrigger + */ + @JsonAnySetter + public APITrigger putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this APITrigger object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + APITrigger apiTrigger = (APITrigger) o; + return Objects.equals(this.rateLimit, apiTrigger.rateLimit) + && Objects.equals(this.additionalProperties, apiTrigger.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(rateLimit, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class APITrigger {\n"); + sb.append(" rateLimit: ").append(toIndentedString(rateLimit)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/APITriggerWrapper.java b/src/main/java/com/datadog/api/client/v2/model/APITriggerWrapper.java new file mode 100644 index 00000000000..52eaf6be5df --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/APITriggerWrapper.java @@ -0,0 +1,184 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Schema for an API-based trigger. */ +@JsonPropertyOrder({ + APITriggerWrapper.JSON_PROPERTY_API_TRIGGER, + APITriggerWrapper.JSON_PROPERTY_START_STEP_NAMES +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class APITriggerWrapper { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_API_TRIGGER = "apiTrigger"; + private APITrigger apiTrigger; + + public static final String JSON_PROPERTY_START_STEP_NAMES = "startStepNames"; + private List startStepNames = null; + + public APITriggerWrapper() {} + + @JsonCreator + public APITriggerWrapper( + @JsonProperty(required = true, value = JSON_PROPERTY_API_TRIGGER) APITrigger apiTrigger) { + this.apiTrigger = apiTrigger; + this.unparsed |= apiTrigger.unparsed; + } + + public APITriggerWrapper apiTrigger(APITrigger apiTrigger) { + this.apiTrigger = apiTrigger; + this.unparsed |= apiTrigger.unparsed; + return this; + } + + /** + * Trigger a workflow VIA an API. The workflow must be published. + * + * @return apiTrigger + */ + @JsonProperty(JSON_PROPERTY_API_TRIGGER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public APITrigger getApiTrigger() { + return apiTrigger; + } + + public void setApiTrigger(APITrigger apiTrigger) { + this.apiTrigger = apiTrigger; + } + + public APITriggerWrapper startStepNames(List startStepNames) { + this.startStepNames = startStepNames; + return this; + } + + public APITriggerWrapper addStartStepNamesItem(String startStepNamesItem) { + if (this.startStepNames == null) { + this.startStepNames = new ArrayList<>(); + } + this.startStepNames.add(startStepNamesItem); + return this; + } + + /** + * A list of steps that run first after a trigger fires. + * + * @return startStepNames + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_START_STEP_NAMES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getStartStepNames() { + return startStepNames; + } + + public void setStartStepNames(List startStepNames) { + this.startStepNames = startStepNames; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return APITriggerWrapper + */ + @JsonAnySetter + public APITriggerWrapper putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this APITriggerWrapper object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + APITriggerWrapper apiTriggerWrapper = (APITriggerWrapper) o; + return Objects.equals(this.apiTrigger, apiTriggerWrapper.apiTrigger) + && Objects.equals(this.startStepNames, apiTriggerWrapper.startStepNames) + && Objects.equals(this.additionalProperties, apiTriggerWrapper.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(apiTrigger, startStepNames, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class APITriggerWrapper {\n"); + sb.append(" apiTrigger: ").append(toIndentedString(apiTrigger)).append("\n"); + sb.append(" startStepNames: ").append(toIndentedString(startStepNames)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/Annotation.java b/src/main/java/com/datadog/api/client/v2/model/Annotation.java new file mode 100644 index 00000000000..d952efdd430 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/Annotation.java @@ -0,0 +1,209 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** A list of annotations used in the workflow. These are like sticky notes for your workflow! */ +@JsonPropertyOrder({ + Annotation.JSON_PROPERTY_DISPLAY, + Annotation.JSON_PROPERTY_ID, + Annotation.JSON_PROPERTY_MARKDOWN_TEXT_ANNOTATION +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class Annotation { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DISPLAY = "display"; + private AnnotationDisplay display; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_MARKDOWN_TEXT_ANNOTATION = "markdownTextAnnotation"; + private AnnotationMarkdownTextAnnotation markdownTextAnnotation; + + public Annotation() {} + + @JsonCreator + public Annotation( + @JsonProperty(required = true, value = JSON_PROPERTY_DISPLAY) AnnotationDisplay display, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_MARKDOWN_TEXT_ANNOTATION) + AnnotationMarkdownTextAnnotation markdownTextAnnotation) { + this.display = display; + this.unparsed |= display.unparsed; + this.id = id; + this.markdownTextAnnotation = markdownTextAnnotation; + this.unparsed |= markdownTextAnnotation.unparsed; + } + + public Annotation display(AnnotationDisplay display) { + this.display = display; + this.unparsed |= display.unparsed; + return this; + } + + /** + * The definition of AnnotationDisplay object. + * + * @return display + */ + @JsonProperty(JSON_PROPERTY_DISPLAY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public AnnotationDisplay getDisplay() { + return display; + } + + public void setDisplay(AnnotationDisplay display) { + this.display = display; + } + + public Annotation id(String id) { + this.id = id; + return this; + } + + /** + * The Annotation id. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public Annotation markdownTextAnnotation( + AnnotationMarkdownTextAnnotation markdownTextAnnotation) { + this.markdownTextAnnotation = markdownTextAnnotation; + this.unparsed |= markdownTextAnnotation.unparsed; + return this; + } + + /** + * The definition of AnnotationMarkdownTextAnnotation object. + * + * @return markdownTextAnnotation + */ + @JsonProperty(JSON_PROPERTY_MARKDOWN_TEXT_ANNOTATION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public AnnotationMarkdownTextAnnotation getMarkdownTextAnnotation() { + return markdownTextAnnotation; + } + + public void setMarkdownTextAnnotation(AnnotationMarkdownTextAnnotation markdownTextAnnotation) { + this.markdownTextAnnotation = markdownTextAnnotation; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return Annotation + */ + @JsonAnySetter + public Annotation putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this Annotation object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Annotation annotation = (Annotation) o; + return Objects.equals(this.display, annotation.display) + && Objects.equals(this.id, annotation.id) + && Objects.equals(this.markdownTextAnnotation, annotation.markdownTextAnnotation) + && Objects.equals(this.additionalProperties, annotation.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(display, id, markdownTextAnnotation, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Annotation {\n"); + sb.append(" display: ").append(toIndentedString(display)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" markdownTextAnnotation: ") + .append(toIndentedString(markdownTextAnnotation)) + .append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/AnnotationDisplay.java b/src/main/java/com/datadog/api/client/v2/model/AnnotationDisplay.java new file mode 100644 index 00000000000..5c6b6d34ade --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AnnotationDisplay.java @@ -0,0 +1,136 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** The definition of AnnotationDisplay object. */ +@JsonPropertyOrder({AnnotationDisplay.JSON_PROPERTY_BOUNDS}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AnnotationDisplay { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_BOUNDS = "bounds"; + private AnnotationDisplayBounds bounds; + + public AnnotationDisplay bounds(AnnotationDisplayBounds bounds) { + this.bounds = bounds; + this.unparsed |= bounds.unparsed; + return this; + } + + /** + * The definition of AnnotationDisplayBounds object. + * + * @return bounds + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_BOUNDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public AnnotationDisplayBounds getBounds() { + return bounds; + } + + public void setBounds(AnnotationDisplayBounds bounds) { + this.bounds = bounds; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return AnnotationDisplay + */ + @JsonAnySetter + public AnnotationDisplay putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this AnnotationDisplay object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AnnotationDisplay annotationDisplay = (AnnotationDisplay) o; + return Objects.equals(this.bounds, annotationDisplay.bounds) + && Objects.equals(this.additionalProperties, annotationDisplay.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(bounds, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AnnotationDisplay {\n"); + sb.append(" bounds: ").append(toIndentedString(bounds)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/AnnotationDisplayBounds.java b/src/main/java/com/datadog/api/client/v2/model/AnnotationDisplayBounds.java new file mode 100644 index 00000000000..81f4ed80989 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AnnotationDisplayBounds.java @@ -0,0 +1,218 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** The definition of AnnotationDisplayBounds object. */ +@JsonPropertyOrder({ + AnnotationDisplayBounds.JSON_PROPERTY_HEIGHT, + AnnotationDisplayBounds.JSON_PROPERTY_WIDTH, + AnnotationDisplayBounds.JSON_PROPERTY_X, + AnnotationDisplayBounds.JSON_PROPERTY_Y +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AnnotationDisplayBounds { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_HEIGHT = "height"; + private Double height; + + public static final String JSON_PROPERTY_WIDTH = "width"; + private Double width; + + public static final String JSON_PROPERTY_X = "x"; + private Double x; + + public static final String JSON_PROPERTY_Y = "y"; + private Double y; + + public AnnotationDisplayBounds height(Double height) { + this.height = height; + return this; + } + + /** + * The bounds height. + * + * @return height + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_HEIGHT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getHeight() { + return height; + } + + public void setHeight(Double height) { + this.height = height; + } + + public AnnotationDisplayBounds width(Double width) { + this.width = width; + return this; + } + + /** + * The bounds width. + * + * @return width + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WIDTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getWidth() { + return width; + } + + public void setWidth(Double width) { + this.width = width; + } + + public AnnotationDisplayBounds x(Double x) { + this.x = x; + return this; + } + + /** + * The bounds x. + * + * @return x + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_X) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getX() { + return x; + } + + public void setX(Double x) { + this.x = x; + } + + public AnnotationDisplayBounds y(Double y) { + this.y = y; + return this; + } + + /** + * The bounds y. + * + * @return y + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_Y) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getY() { + return y; + } + + public void setY(Double y) { + this.y = y; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return AnnotationDisplayBounds + */ + @JsonAnySetter + public AnnotationDisplayBounds putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this AnnotationDisplayBounds object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AnnotationDisplayBounds annotationDisplayBounds = (AnnotationDisplayBounds) o; + return Objects.equals(this.height, annotationDisplayBounds.height) + && Objects.equals(this.width, annotationDisplayBounds.width) + && Objects.equals(this.x, annotationDisplayBounds.x) + && Objects.equals(this.y, annotationDisplayBounds.y) + && Objects.equals(this.additionalProperties, annotationDisplayBounds.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(height, width, x, y, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AnnotationDisplayBounds {\n"); + sb.append(" height: ").append(toIndentedString(height)).append("\n"); + sb.append(" width: ").append(toIndentedString(width)).append("\n"); + sb.append(" x: ").append(toIndentedString(x)).append("\n"); + sb.append(" y: ").append(toIndentedString(y)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/AnnotationMarkdownTextAnnotation.java b/src/main/java/com/datadog/api/client/v2/model/AnnotationMarkdownTextAnnotation.java new file mode 100644 index 00000000000..adbf8e63089 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AnnotationMarkdownTextAnnotation.java @@ -0,0 +1,137 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** The definition of AnnotationMarkdownTextAnnotation object. */ +@JsonPropertyOrder({AnnotationMarkdownTextAnnotation.JSON_PROPERTY_TEXT}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AnnotationMarkdownTextAnnotation { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_TEXT = "text"; + private String text; + + public AnnotationMarkdownTextAnnotation text(String text) { + this.text = text; + return this; + } + + /** + * The markdownTextAnnotation text. + * + * @return text + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getText() { + return text; + } + + public void setText(String text) { + this.text = text; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return AnnotationMarkdownTextAnnotation + */ + @JsonAnySetter + public AnnotationMarkdownTextAnnotation putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this AnnotationMarkdownTextAnnotation object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AnnotationMarkdownTextAnnotation annotationMarkdownTextAnnotation = + (AnnotationMarkdownTextAnnotation) o; + return Objects.equals(this.text, annotationMarkdownTextAnnotation.text) + && Objects.equals( + this.additionalProperties, annotationMarkdownTextAnnotation.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(text, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AnnotationMarkdownTextAnnotation {\n"); + sb.append(" text: ").append(toIndentedString(text)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/AppTriggerWrapper.java b/src/main/java/com/datadog/api/client/v2/model/AppTriggerWrapper.java new file mode 100644 index 00000000000..4bc14459a3f --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AppTriggerWrapper.java @@ -0,0 +1,182 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Schema for an App-based trigger. */ +@JsonPropertyOrder({ + AppTriggerWrapper.JSON_PROPERTY_APP_TRIGGER, + AppTriggerWrapper.JSON_PROPERTY_START_STEP_NAMES +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AppTriggerWrapper { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_APP_TRIGGER = "appTrigger"; + private Object appTrigger; + + public static final String JSON_PROPERTY_START_STEP_NAMES = "startStepNames"; + private List startStepNames = null; + + public AppTriggerWrapper() {} + + @JsonCreator + public AppTriggerWrapper( + @JsonProperty(required = true, value = JSON_PROPERTY_APP_TRIGGER) Object appTrigger) { + this.appTrigger = appTrigger; + } + + public AppTriggerWrapper appTrigger(Object appTrigger) { + this.appTrigger = appTrigger; + return this; + } + + /** + * Trigger a workflow VIA an App. + * + * @return appTrigger + */ + @JsonProperty(JSON_PROPERTY_APP_TRIGGER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Object getAppTrigger() { + return appTrigger; + } + + public void setAppTrigger(Object appTrigger) { + this.appTrigger = appTrigger; + } + + public AppTriggerWrapper startStepNames(List startStepNames) { + this.startStepNames = startStepNames; + return this; + } + + public AppTriggerWrapper addStartStepNamesItem(String startStepNamesItem) { + if (this.startStepNames == null) { + this.startStepNames = new ArrayList<>(); + } + this.startStepNames.add(startStepNamesItem); + return this; + } + + /** + * A list of steps that run first after a trigger fires. + * + * @return startStepNames + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_START_STEP_NAMES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getStartStepNames() { + return startStepNames; + } + + public void setStartStepNames(List startStepNames) { + this.startStepNames = startStepNames; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return AppTriggerWrapper + */ + @JsonAnySetter + public AppTriggerWrapper putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this AppTriggerWrapper object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AppTriggerWrapper appTriggerWrapper = (AppTriggerWrapper) o; + return Objects.equals(this.appTrigger, appTriggerWrapper.appTrigger) + && Objects.equals(this.startStepNames, appTriggerWrapper.startStepNames) + && Objects.equals(this.additionalProperties, appTriggerWrapper.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(appTrigger, startStepNames, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AppTriggerWrapper {\n"); + sb.append(" appTrigger: ").append(toIndentedString(appTrigger)).append("\n"); + sb.append(" startStepNames: ").append(toIndentedString(startStepNames)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CaseTrigger.java b/src/main/java/com/datadog/api/client/v2/model/CaseTrigger.java new file mode 100644 index 00000000000..d4716f30f49 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CaseTrigger.java @@ -0,0 +1,139 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * Trigger a workflow VIA a Case. For automatic triggering a handle must be configured and the + * workflow must be published. + */ +@JsonPropertyOrder({CaseTrigger.JSON_PROPERTY_RATE_LIMIT}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CaseTrigger { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_RATE_LIMIT = "rateLimit"; + private TriggerRateLimit rateLimit; + + public CaseTrigger rateLimit(TriggerRateLimit rateLimit) { + this.rateLimit = rateLimit; + this.unparsed |= rateLimit.unparsed; + return this; + } + + /** + * Defines a rate limit for a trigger. + * + * @return rateLimit + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RATE_LIMIT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TriggerRateLimit getRateLimit() { + return rateLimit; + } + + public void setRateLimit(TriggerRateLimit rateLimit) { + this.rateLimit = rateLimit; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CaseTrigger + */ + @JsonAnySetter + public CaseTrigger putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CaseTrigger object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CaseTrigger caseTrigger = (CaseTrigger) o; + return Objects.equals(this.rateLimit, caseTrigger.rateLimit) + && Objects.equals(this.additionalProperties, caseTrigger.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(rateLimit, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CaseTrigger {\n"); + sb.append(" rateLimit: ").append(toIndentedString(rateLimit)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CaseTriggerWrapper.java b/src/main/java/com/datadog/api/client/v2/model/CaseTriggerWrapper.java new file mode 100644 index 00000000000..58b535d1843 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CaseTriggerWrapper.java @@ -0,0 +1,185 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Schema for a Case-based trigger. */ +@JsonPropertyOrder({ + CaseTriggerWrapper.JSON_PROPERTY_CASE_TRIGGER, + CaseTriggerWrapper.JSON_PROPERTY_START_STEP_NAMES +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CaseTriggerWrapper { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CASE_TRIGGER = "caseTrigger"; + private CaseTrigger caseTrigger; + + public static final String JSON_PROPERTY_START_STEP_NAMES = "startStepNames"; + private List startStepNames = null; + + public CaseTriggerWrapper() {} + + @JsonCreator + public CaseTriggerWrapper( + @JsonProperty(required = true, value = JSON_PROPERTY_CASE_TRIGGER) CaseTrigger caseTrigger) { + this.caseTrigger = caseTrigger; + this.unparsed |= caseTrigger.unparsed; + } + + public CaseTriggerWrapper caseTrigger(CaseTrigger caseTrigger) { + this.caseTrigger = caseTrigger; + this.unparsed |= caseTrigger.unparsed; + return this; + } + + /** + * Trigger a workflow VIA a Case. For automatic triggering a handle must be configured and the + * workflow must be published. + * + * @return caseTrigger + */ + @JsonProperty(JSON_PROPERTY_CASE_TRIGGER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CaseTrigger getCaseTrigger() { + return caseTrigger; + } + + public void setCaseTrigger(CaseTrigger caseTrigger) { + this.caseTrigger = caseTrigger; + } + + public CaseTriggerWrapper startStepNames(List startStepNames) { + this.startStepNames = startStepNames; + return this; + } + + public CaseTriggerWrapper addStartStepNamesItem(String startStepNamesItem) { + if (this.startStepNames == null) { + this.startStepNames = new ArrayList<>(); + } + this.startStepNames.add(startStepNamesItem); + return this; + } + + /** + * A list of steps that run first after a trigger fires. + * + * @return startStepNames + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_START_STEP_NAMES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getStartStepNames() { + return startStepNames; + } + + public void setStartStepNames(List startStepNames) { + this.startStepNames = startStepNames; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CaseTriggerWrapper + */ + @JsonAnySetter + public CaseTriggerWrapper putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CaseTriggerWrapper object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CaseTriggerWrapper caseTriggerWrapper = (CaseTriggerWrapper) o; + return Objects.equals(this.caseTrigger, caseTriggerWrapper.caseTrigger) + && Objects.equals(this.startStepNames, caseTriggerWrapper.startStepNames) + && Objects.equals(this.additionalProperties, caseTriggerWrapper.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(caseTrigger, startStepNames, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CaseTriggerWrapper {\n"); + sb.append(" caseTrigger: ").append(toIndentedString(caseTrigger)).append("\n"); + sb.append(" startStepNames: ").append(toIndentedString(startStepNames)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ChangeEventTriggerWrapper.java b/src/main/java/com/datadog/api/client/v2/model/ChangeEventTriggerWrapper.java new file mode 100644 index 00000000000..26741f560d0 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ChangeEventTriggerWrapper.java @@ -0,0 +1,184 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Schema for a Change Event-based trigger. */ +@JsonPropertyOrder({ + ChangeEventTriggerWrapper.JSON_PROPERTY_CHANGE_EVENT_TRIGGER, + ChangeEventTriggerWrapper.JSON_PROPERTY_START_STEP_NAMES +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ChangeEventTriggerWrapper { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CHANGE_EVENT_TRIGGER = "changeEventTrigger"; + private Object changeEventTrigger; + + public static final String JSON_PROPERTY_START_STEP_NAMES = "startStepNames"; + private List startStepNames = null; + + public ChangeEventTriggerWrapper() {} + + @JsonCreator + public ChangeEventTriggerWrapper( + @JsonProperty(required = true, value = JSON_PROPERTY_CHANGE_EVENT_TRIGGER) + Object changeEventTrigger) { + this.changeEventTrigger = changeEventTrigger; + } + + public ChangeEventTriggerWrapper changeEventTrigger(Object changeEventTrigger) { + this.changeEventTrigger = changeEventTrigger; + return this; + } + + /** + * Trigger a workflow VIA a Change Event. + * + * @return changeEventTrigger + */ + @JsonProperty(JSON_PROPERTY_CHANGE_EVENT_TRIGGER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Object getChangeEventTrigger() { + return changeEventTrigger; + } + + public void setChangeEventTrigger(Object changeEventTrigger) { + this.changeEventTrigger = changeEventTrigger; + } + + public ChangeEventTriggerWrapper startStepNames(List startStepNames) { + this.startStepNames = startStepNames; + return this; + } + + public ChangeEventTriggerWrapper addStartStepNamesItem(String startStepNamesItem) { + if (this.startStepNames == null) { + this.startStepNames = new ArrayList<>(); + } + this.startStepNames.add(startStepNamesItem); + return this; + } + + /** + * A list of steps that run first after a trigger fires. + * + * @return startStepNames + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_START_STEP_NAMES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getStartStepNames() { + return startStepNames; + } + + public void setStartStepNames(List startStepNames) { + this.startStepNames = startStepNames; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ChangeEventTriggerWrapper + */ + @JsonAnySetter + public ChangeEventTriggerWrapper putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ChangeEventTriggerWrapper object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ChangeEventTriggerWrapper changeEventTriggerWrapper = (ChangeEventTriggerWrapper) o; + return Objects.equals(this.changeEventTrigger, changeEventTriggerWrapper.changeEventTrigger) + && Objects.equals(this.startStepNames, changeEventTriggerWrapper.startStepNames) + && Objects.equals( + this.additionalProperties, changeEventTriggerWrapper.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(changeEventTrigger, startStepNames, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ChangeEventTriggerWrapper {\n"); + sb.append(" changeEventTrigger: ").append(toIndentedString(changeEventTrigger)).append("\n"); + sb.append(" startStepNames: ").append(toIndentedString(startStepNames)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CompletionCondition.java b/src/main/java/com/datadog/api/client/v2/model/CompletionCondition.java new file mode 100644 index 00000000000..8d977b029c7 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CompletionCondition.java @@ -0,0 +1,206 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** The definition of CompletionCondition object. */ +@JsonPropertyOrder({ + CompletionCondition.JSON_PROPERTY_OPERAND1, + CompletionCondition.JSON_PROPERTY_OPERAND2, + CompletionCondition.JSON_PROPERTY_OPERATOR +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CompletionCondition { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_OPERAND1 = "operand1"; + private Object operand1 = new Object(); + + public static final String JSON_PROPERTY_OPERAND2 = "operand2"; + private Object operand2 = null; + + public static final String JSON_PROPERTY_OPERATOR = "operator"; + private CompletionConditionOperator operator; + + public CompletionCondition() {} + + @JsonCreator + public CompletionCondition( + @JsonProperty(required = true, value = JSON_PROPERTY_OPERAND1) Object operand1, + @JsonProperty(required = true, value = JSON_PROPERTY_OPERATOR) + CompletionConditionOperator operator) { + this.operand1 = operand1; + this.operator = operator; + this.unparsed |= !operator.isValid(); + } + + public CompletionCondition operand1(Object operand1) { + this.operand1 = operand1; + return this; + } + + /** + * The CompletionCondition operand1. + * + * @return operand1 + */ + @JsonProperty(JSON_PROPERTY_OPERAND1) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Object getOperand1() { + return operand1; + } + + public void setOperand1(Object operand1) { + this.operand1 = operand1; + } + + public CompletionCondition operand2(Object operand2) { + this.operand2 = operand2; + return this; + } + + /** + * The CompletionCondition operand2. + * + * @return operand2 + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_OPERAND2) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Object getOperand2() { + return operand2; + } + + public void setOperand2(Object operand2) { + this.operand2 = operand2; + } + + public CompletionCondition operator(CompletionConditionOperator operator) { + this.operator = operator; + this.unparsed |= !operator.isValid(); + return this; + } + + /** + * The definition of CompletionConditionOperator object. + * + * @return operator + */ + @JsonProperty(JSON_PROPERTY_OPERATOR) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CompletionConditionOperator getOperator() { + return operator; + } + + public void setOperator(CompletionConditionOperator operator) { + if (!operator.isValid()) { + this.unparsed = true; + } + this.operator = operator; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CompletionCondition + */ + @JsonAnySetter + public CompletionCondition putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CompletionCondition object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CompletionCondition completionCondition = (CompletionCondition) o; + return Objects.equals(this.operand1, completionCondition.operand1) + && Objects.equals(this.operand2, completionCondition.operand2) + && Objects.equals(this.operator, completionCondition.operator) + && Objects.equals(this.additionalProperties, completionCondition.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(operand1, operand2, operator, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CompletionCondition {\n"); + sb.append(" operand1: ").append(toIndentedString(operand1)).append("\n"); + sb.append(" operand2: ").append(toIndentedString(operand2)).append("\n"); + sb.append(" operator: ").append(toIndentedString(operator)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CompletionConditionOperator.java b/src/main/java/com/datadog/api/client/v2/model/CompletionConditionOperator.java new file mode 100644 index 00000000000..c3acf056b09 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CompletionConditionOperator.java @@ -0,0 +1,92 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** The definition of CompletionConditionOperator object. */ +@JsonSerialize(using = CompletionConditionOperator.CompletionConditionOperatorSerializer.class) +public class CompletionConditionOperator extends ModelEnum { + + private static final Set allowedValues = + new HashSet( + Arrays.asList( + "OPERATOR_EQUAL", + "OPERATOR_NOT_EQUAL", + "OPERATOR_GREATER_THAN", + "OPERATOR_LESS_THAN", + "OPERATOR_GREATER_THAN_OR_EQUAL_TO", + "OPERATOR_LESS_THAN_OR_EQUAL_TO", + "OPERATOR_CONTAINS", + "OPERATOR_DOES_NOT_CONTAIN", + "OPERATOR_IS_NULL", + "OPERATOR_IS_NOT_NULL", + "OPERATOR_IS_EMPTY", + "OPERATOR_IS_NOT_EMPTY")); + + public static final CompletionConditionOperator OPERATOR_EQUAL = + new CompletionConditionOperator("OPERATOR_EQUAL"); + public static final CompletionConditionOperator OPERATOR_NOT_EQUAL = + new CompletionConditionOperator("OPERATOR_NOT_EQUAL"); + public static final CompletionConditionOperator OPERATOR_GREATER_THAN = + new CompletionConditionOperator("OPERATOR_GREATER_THAN"); + public static final CompletionConditionOperator OPERATOR_LESS_THAN = + new CompletionConditionOperator("OPERATOR_LESS_THAN"); + public static final CompletionConditionOperator OPERATOR_GREATER_THAN_OR_EQUAL_TO = + new CompletionConditionOperator("OPERATOR_GREATER_THAN_OR_EQUAL_TO"); + public static final CompletionConditionOperator OPERATOR_LESS_THAN_OR_EQUAL_TO = + new CompletionConditionOperator("OPERATOR_LESS_THAN_OR_EQUAL_TO"); + public static final CompletionConditionOperator OPERATOR_CONTAINS = + new CompletionConditionOperator("OPERATOR_CONTAINS"); + public static final CompletionConditionOperator OPERATOR_DOES_NOT_CONTAIN = + new CompletionConditionOperator("OPERATOR_DOES_NOT_CONTAIN"); + public static final CompletionConditionOperator OPERATOR_IS_NULL = + new CompletionConditionOperator("OPERATOR_IS_NULL"); + public static final CompletionConditionOperator OPERATOR_IS_NOT_NULL = + new CompletionConditionOperator("OPERATOR_IS_NOT_NULL"); + public static final CompletionConditionOperator OPERATOR_IS_EMPTY = + new CompletionConditionOperator("OPERATOR_IS_EMPTY"); + public static final CompletionConditionOperator OPERATOR_IS_NOT_EMPTY = + new CompletionConditionOperator("OPERATOR_IS_NOT_EMPTY"); + + CompletionConditionOperator(String value) { + super(value, allowedValues); + } + + public static class CompletionConditionOperatorSerializer + extends StdSerializer { + public CompletionConditionOperatorSerializer(Class t) { + super(t); + } + + public CompletionConditionOperatorSerializer() { + this(null); + } + + @Override + public void serialize( + CompletionConditionOperator value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static CompletionConditionOperator fromValue(String value) { + return new CompletionConditionOperator(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CompletionGate.java b/src/main/java/com/datadog/api/client/v2/model/CompletionGate.java new file mode 100644 index 00000000000..774f8fa5d8f --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CompletionGate.java @@ -0,0 +1,181 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Used to create conditions before running subsequent actions. */ +@JsonPropertyOrder({ + CompletionGate.JSON_PROPERTY_COMPLETION_CONDITION, + CompletionGate.JSON_PROPERTY_RETRY_STRATEGY +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CompletionGate { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_COMPLETION_CONDITION = "completionCondition"; + private CompletionCondition completionCondition; + + public static final String JSON_PROPERTY_RETRY_STRATEGY = "retryStrategy"; + private RetryStrategy retryStrategy; + + public CompletionGate() {} + + @JsonCreator + public CompletionGate( + @JsonProperty(required = true, value = JSON_PROPERTY_COMPLETION_CONDITION) + CompletionCondition completionCondition, + @JsonProperty(required = true, value = JSON_PROPERTY_RETRY_STRATEGY) + RetryStrategy retryStrategy) { + this.completionCondition = completionCondition; + this.unparsed |= completionCondition.unparsed; + this.retryStrategy = retryStrategy; + this.unparsed |= retryStrategy.unparsed; + } + + public CompletionGate completionCondition(CompletionCondition completionCondition) { + this.completionCondition = completionCondition; + this.unparsed |= completionCondition.unparsed; + return this; + } + + /** + * The definition of CompletionCondition object. + * + * @return completionCondition + */ + @JsonProperty(JSON_PROPERTY_COMPLETION_CONDITION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CompletionCondition getCompletionCondition() { + return completionCondition; + } + + public void setCompletionCondition(CompletionCondition completionCondition) { + this.completionCondition = completionCondition; + } + + public CompletionGate retryStrategy(RetryStrategy retryStrategy) { + this.retryStrategy = retryStrategy; + this.unparsed |= retryStrategy.unparsed; + return this; + } + + /** + * The definition of RetryStrategy object. + * + * @return retryStrategy + */ + @JsonProperty(JSON_PROPERTY_RETRY_STRATEGY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public RetryStrategy getRetryStrategy() { + return retryStrategy; + } + + public void setRetryStrategy(RetryStrategy retryStrategy) { + this.retryStrategy = retryStrategy; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CompletionGate + */ + @JsonAnySetter + public CompletionGate putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CompletionGate object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CompletionGate completionGate = (CompletionGate) o; + return Objects.equals(this.completionCondition, completionGate.completionCondition) + && Objects.equals(this.retryStrategy, completionGate.retryStrategy) + && Objects.equals(this.additionalProperties, completionGate.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(completionCondition, retryStrategy, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CompletionGate {\n"); + sb.append(" completionCondition: ") + .append(toIndentedString(completionCondition)) + .append("\n"); + sb.append(" retryStrategy: ").append(toIndentedString(retryStrategy)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/Connection.java b/src/main/java/com/datadog/api/client/v2/model/Connection.java new file mode 100644 index 00000000000..d99f4422f8f --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/Connection.java @@ -0,0 +1,170 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** The definition of Connection object. */ +@JsonPropertyOrder({Connection.JSON_PROPERTY_CONNECTION_ID, Connection.JSON_PROPERTY_LABEL}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class Connection { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CONNECTION_ID = "connectionId"; + private String connectionId; + + public static final String JSON_PROPERTY_LABEL = "label"; + private String label; + + public Connection() {} + + @JsonCreator + public Connection( + @JsonProperty(required = true, value = JSON_PROPERTY_CONNECTION_ID) String connectionId, + @JsonProperty(required = true, value = JSON_PROPERTY_LABEL) String label) { + this.connectionId = connectionId; + this.label = label; + } + + public Connection connectionId(String connectionId) { + this.connectionId = connectionId; + return this; + } + + /** + * The Connection connectionId. + * + * @return connectionId + */ + @JsonProperty(JSON_PROPERTY_CONNECTION_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getConnectionId() { + return connectionId; + } + + public void setConnectionId(String connectionId) { + this.connectionId = connectionId; + } + + public Connection label(String label) { + this.label = label; + return this; + } + + /** + * The Connection label. + * + * @return label + */ + @JsonProperty(JSON_PROPERTY_LABEL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getLabel() { + return label; + } + + public void setLabel(String label) { + this.label = label; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return Connection + */ + @JsonAnySetter + public Connection putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this Connection object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Connection connection = (Connection) o; + return Objects.equals(this.connectionId, connection.connectionId) + && Objects.equals(this.label, connection.label) + && Objects.equals(this.additionalProperties, connection.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(connectionId, label, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Connection {\n"); + sb.append(" connectionId: ").append(toIndentedString(connectionId)).append("\n"); + sb.append(" label: ").append(toIndentedString(label)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ConnectionEnv.java b/src/main/java/com/datadog/api/client/v2/model/ConnectionEnv.java new file mode 100644 index 00000000000..ee5ce4b03b3 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ConnectionEnv.java @@ -0,0 +1,230 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** A list of connections or connection groups used in the workflow. */ +@JsonPropertyOrder({ + ConnectionEnv.JSON_PROPERTY_CONNECTION_GROUPS, + ConnectionEnv.JSON_PROPERTY_CONNECTIONS, + ConnectionEnv.JSON_PROPERTY_ENV +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ConnectionEnv { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CONNECTION_GROUPS = "connectionGroups"; + private List connectionGroups = null; + + public static final String JSON_PROPERTY_CONNECTIONS = "connections"; + private List connections = null; + + public static final String JSON_PROPERTY_ENV = "env"; + private ConnectionEnvEnv env; + + public ConnectionEnv() {} + + @JsonCreator + public ConnectionEnv( + @JsonProperty(required = true, value = JSON_PROPERTY_ENV) ConnectionEnvEnv env) { + this.env = env; + this.unparsed |= !env.isValid(); + } + + public ConnectionEnv connectionGroups(List connectionGroups) { + this.connectionGroups = connectionGroups; + for (ConnectionGroup item : connectionGroups) { + this.unparsed |= item.unparsed; + } + return this; + } + + public ConnectionEnv addConnectionGroupsItem(ConnectionGroup connectionGroupsItem) { + if (this.connectionGroups == null) { + this.connectionGroups = new ArrayList<>(); + } + this.connectionGroups.add(connectionGroupsItem); + this.unparsed |= connectionGroupsItem.unparsed; + return this; + } + + /** + * The ConnectionEnv connectionGroups. + * + * @return connectionGroups + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CONNECTION_GROUPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getConnectionGroups() { + return connectionGroups; + } + + public void setConnectionGroups(List connectionGroups) { + this.connectionGroups = connectionGroups; + } + + public ConnectionEnv connections(List connections) { + this.connections = connections; + for (Connection item : connections) { + this.unparsed |= item.unparsed; + } + return this; + } + + public ConnectionEnv addConnectionsItem(Connection connectionsItem) { + if (this.connections == null) { + this.connections = new ArrayList<>(); + } + this.connections.add(connectionsItem); + this.unparsed |= connectionsItem.unparsed; + return this; + } + + /** + * The ConnectionEnv connections. + * + * @return connections + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CONNECTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getConnections() { + return connections; + } + + public void setConnections(List connections) { + this.connections = connections; + } + + public ConnectionEnv env(ConnectionEnvEnv env) { + this.env = env; + this.unparsed |= !env.isValid(); + return this; + } + + /** + * The definition of ConnectionEnvEnv object. + * + * @return env + */ + @JsonProperty(JSON_PROPERTY_ENV) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ConnectionEnvEnv getEnv() { + return env; + } + + public void setEnv(ConnectionEnvEnv env) { + if (!env.isValid()) { + this.unparsed = true; + } + this.env = env; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ConnectionEnv + */ + @JsonAnySetter + public ConnectionEnv putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ConnectionEnv object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ConnectionEnv connectionEnv = (ConnectionEnv) o; + return Objects.equals(this.connectionGroups, connectionEnv.connectionGroups) + && Objects.equals(this.connections, connectionEnv.connections) + && Objects.equals(this.env, connectionEnv.env) + && Objects.equals(this.additionalProperties, connectionEnv.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(connectionGroups, connections, env, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ConnectionEnv {\n"); + sb.append(" connectionGroups: ").append(toIndentedString(connectionGroups)).append("\n"); + sb.append(" connections: ").append(toIndentedString(connections)).append("\n"); + sb.append(" env: ").append(toIndentedString(env)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ConnectionEnvEnv.java b/src/main/java/com/datadog/api/client/v2/model/ConnectionEnvEnv.java new file mode 100644 index 00000000000..58613ec8123 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ConnectionEnvEnv.java @@ -0,0 +1,53 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** The definition of ConnectionEnvEnv object. */ +@JsonSerialize(using = ConnectionEnvEnv.ConnectionEnvEnvSerializer.class) +public class ConnectionEnvEnv extends ModelEnum { + + private static final Set allowedValues = new HashSet(Arrays.asList("default")); + + public static final ConnectionEnvEnv DEFAULT = new ConnectionEnvEnv("default"); + + ConnectionEnvEnv(String value) { + super(value, allowedValues); + } + + public static class ConnectionEnvEnvSerializer extends StdSerializer { + public ConnectionEnvEnvSerializer(Class t) { + super(t); + } + + public ConnectionEnvEnvSerializer() { + this(null); + } + + @Override + public void serialize(ConnectionEnvEnv value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static ConnectionEnvEnv fromValue(String value) { + return new ConnectionEnvEnv(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ConnectionGroup.java b/src/main/java/com/datadog/api/client/v2/model/ConnectionGroup.java new file mode 100644 index 00000000000..101a37ec2d6 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ConnectionGroup.java @@ -0,0 +1,209 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** The definition of ConnectionGroup object. */ +@JsonPropertyOrder({ + ConnectionGroup.JSON_PROPERTY_CONNECTION_GROUP_ID, + ConnectionGroup.JSON_PROPERTY_LABEL, + ConnectionGroup.JSON_PROPERTY_TAGS +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ConnectionGroup { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CONNECTION_GROUP_ID = "connectionGroupId"; + private String connectionGroupId; + + public static final String JSON_PROPERTY_LABEL = "label"; + private String label; + + public static final String JSON_PROPERTY_TAGS = "tags"; + private List tags = new ArrayList<>(); + + public ConnectionGroup() {} + + @JsonCreator + public ConnectionGroup( + @JsonProperty(required = true, value = JSON_PROPERTY_CONNECTION_GROUP_ID) + String connectionGroupId, + @JsonProperty(required = true, value = JSON_PROPERTY_LABEL) String label, + @JsonProperty(required = true, value = JSON_PROPERTY_TAGS) List tags) { + this.connectionGroupId = connectionGroupId; + this.label = label; + this.tags = tags; + } + + public ConnectionGroup connectionGroupId(String connectionGroupId) { + this.connectionGroupId = connectionGroupId; + return this; + } + + /** + * The ConnectionGroup connectionGroupId. + * + * @return connectionGroupId + */ + @JsonProperty(JSON_PROPERTY_CONNECTION_GROUP_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getConnectionGroupId() { + return connectionGroupId; + } + + public void setConnectionGroupId(String connectionGroupId) { + this.connectionGroupId = connectionGroupId; + } + + public ConnectionGroup label(String label) { + this.label = label; + return this; + } + + /** + * The ConnectionGroup label. + * + * @return label + */ + @JsonProperty(JSON_PROPERTY_LABEL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getLabel() { + return label; + } + + public void setLabel(String label) { + this.label = label; + } + + public ConnectionGroup tags(List tags) { + this.tags = tags; + return this; + } + + public ConnectionGroup addTagsItem(String tagsItem) { + this.tags.add(tagsItem); + return this; + } + + /** + * The ConnectionGroup tags. + * + * @return tags + */ + @JsonProperty(JSON_PROPERTY_TAGS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getTags() { + return tags; + } + + public void setTags(List tags) { + this.tags = tags; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ConnectionGroup + */ + @JsonAnySetter + public ConnectionGroup putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ConnectionGroup object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ConnectionGroup connectionGroup = (ConnectionGroup) o; + return Objects.equals(this.connectionGroupId, connectionGroup.connectionGroupId) + && Objects.equals(this.label, connectionGroup.label) + && Objects.equals(this.tags, connectionGroup.tags) + && Objects.equals(this.additionalProperties, connectionGroup.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(connectionGroupId, label, tags, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ConnectionGroup {\n"); + sb.append(" connectionGroupId: ").append(toIndentedString(connectionGroupId)).append("\n"); + sb.append(" label: ").append(toIndentedString(label)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CreateWorkflowRequest.java b/src/main/java/com/datadog/api/client/v2/model/CreateWorkflowRequest.java new file mode 100644 index 00000000000..f66837a8a7d --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CreateWorkflowRequest.java @@ -0,0 +1,145 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** A request object for creating a new workflow. */ +@JsonPropertyOrder({CreateWorkflowRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CreateWorkflowRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private WorkflowData data; + + public CreateWorkflowRequest() {} + + @JsonCreator + public CreateWorkflowRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) WorkflowData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public CreateWorkflowRequest data(WorkflowData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data related to the workflow. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public WorkflowData getData() { + return data; + } + + public void setData(WorkflowData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CreateWorkflowRequest + */ + @JsonAnySetter + public CreateWorkflowRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CreateWorkflowRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateWorkflowRequest createWorkflowRequest = (CreateWorkflowRequest) o; + return Objects.equals(this.data, createWorkflowRequest.data) + && Objects.equals(this.additionalProperties, createWorkflowRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateWorkflowRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CreateWorkflowResponse.java b/src/main/java/com/datadog/api/client/v2/model/CreateWorkflowResponse.java new file mode 100644 index 00000000000..e1da8b4a82f --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CreateWorkflowResponse.java @@ -0,0 +1,145 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** The response object after creating a new workflow. */ +@JsonPropertyOrder({CreateWorkflowResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CreateWorkflowResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private WorkflowData data; + + public CreateWorkflowResponse() {} + + @JsonCreator + public CreateWorkflowResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) WorkflowData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public CreateWorkflowResponse data(WorkflowData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data related to the workflow. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public WorkflowData getData() { + return data; + } + + public void setData(WorkflowData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CreateWorkflowResponse + */ + @JsonAnySetter + public CreateWorkflowResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CreateWorkflowResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateWorkflowResponse createWorkflowResponse = (CreateWorkflowResponse) o; + return Objects.equals(this.data, createWorkflowResponse.data) + && Objects.equals(this.additionalProperties, createWorkflowResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateWorkflowResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/DashboardTriggerWrapper.java b/src/main/java/com/datadog/api/client/v2/model/DashboardTriggerWrapper.java new file mode 100644 index 00000000000..82477a84063 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DashboardTriggerWrapper.java @@ -0,0 +1,183 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Schema for a Dashboard-based trigger. */ +@JsonPropertyOrder({ + DashboardTriggerWrapper.JSON_PROPERTY_DASHBOARD_TRIGGER, + DashboardTriggerWrapper.JSON_PROPERTY_START_STEP_NAMES +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DashboardTriggerWrapper { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DASHBOARD_TRIGGER = "dashboardTrigger"; + private Object dashboardTrigger; + + public static final String JSON_PROPERTY_START_STEP_NAMES = "startStepNames"; + private List startStepNames = null; + + public DashboardTriggerWrapper() {} + + @JsonCreator + public DashboardTriggerWrapper( + @JsonProperty(required = true, value = JSON_PROPERTY_DASHBOARD_TRIGGER) + Object dashboardTrigger) { + this.dashboardTrigger = dashboardTrigger; + } + + public DashboardTriggerWrapper dashboardTrigger(Object dashboardTrigger) { + this.dashboardTrigger = dashboardTrigger; + return this; + } + + /** + * Trigger a workflow VIA a Dashboard. + * + * @return dashboardTrigger + */ + @JsonProperty(JSON_PROPERTY_DASHBOARD_TRIGGER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Object getDashboardTrigger() { + return dashboardTrigger; + } + + public void setDashboardTrigger(Object dashboardTrigger) { + this.dashboardTrigger = dashboardTrigger; + } + + public DashboardTriggerWrapper startStepNames(List startStepNames) { + this.startStepNames = startStepNames; + return this; + } + + public DashboardTriggerWrapper addStartStepNamesItem(String startStepNamesItem) { + if (this.startStepNames == null) { + this.startStepNames = new ArrayList<>(); + } + this.startStepNames.add(startStepNamesItem); + return this; + } + + /** + * A list of steps that run first after a trigger fires. + * + * @return startStepNames + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_START_STEP_NAMES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getStartStepNames() { + return startStepNames; + } + + public void setStartStepNames(List startStepNames) { + this.startStepNames = startStepNames; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return DashboardTriggerWrapper + */ + @JsonAnySetter + public DashboardTriggerWrapper putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this DashboardTriggerWrapper object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DashboardTriggerWrapper dashboardTriggerWrapper = (DashboardTriggerWrapper) o; + return Objects.equals(this.dashboardTrigger, dashboardTriggerWrapper.dashboardTrigger) + && Objects.equals(this.startStepNames, dashboardTriggerWrapper.startStepNames) + && Objects.equals(this.additionalProperties, dashboardTriggerWrapper.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(dashboardTrigger, startStepNames, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DashboardTriggerWrapper {\n"); + sb.append(" dashboardTrigger: ").append(toIndentedString(dashboardTrigger)).append("\n"); + sb.append(" startStepNames: ").append(toIndentedString(startStepNames)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ErrorHandler.java b/src/main/java/com/datadog/api/client/v2/model/ErrorHandler.java new file mode 100644 index 00000000000..80f9ab53879 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ErrorHandler.java @@ -0,0 +1,177 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Used to handle errors in an action. */ +@JsonPropertyOrder({ + ErrorHandler.JSON_PROPERTY_FALLBACK_STEP_NAME, + ErrorHandler.JSON_PROPERTY_RETRY_STRATEGY +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ErrorHandler { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_FALLBACK_STEP_NAME = "fallbackStepName"; + private String fallbackStepName; + + public static final String JSON_PROPERTY_RETRY_STRATEGY = "retryStrategy"; + private RetryStrategy retryStrategy; + + public ErrorHandler() {} + + @JsonCreator + public ErrorHandler( + @JsonProperty(required = true, value = JSON_PROPERTY_FALLBACK_STEP_NAME) + String fallbackStepName, + @JsonProperty(required = true, value = JSON_PROPERTY_RETRY_STRATEGY) + RetryStrategy retryStrategy) { + this.fallbackStepName = fallbackStepName; + this.retryStrategy = retryStrategy; + this.unparsed |= retryStrategy.unparsed; + } + + public ErrorHandler fallbackStepName(String fallbackStepName) { + this.fallbackStepName = fallbackStepName; + return this; + } + + /** + * The ErrorHandler fallbackStepName. + * + * @return fallbackStepName + */ + @JsonProperty(JSON_PROPERTY_FALLBACK_STEP_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getFallbackStepName() { + return fallbackStepName; + } + + public void setFallbackStepName(String fallbackStepName) { + this.fallbackStepName = fallbackStepName; + } + + public ErrorHandler retryStrategy(RetryStrategy retryStrategy) { + this.retryStrategy = retryStrategy; + this.unparsed |= retryStrategy.unparsed; + return this; + } + + /** + * The definition of RetryStrategy object. + * + * @return retryStrategy + */ + @JsonProperty(JSON_PROPERTY_RETRY_STRATEGY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public RetryStrategy getRetryStrategy() { + return retryStrategy; + } + + public void setRetryStrategy(RetryStrategy retryStrategy) { + this.retryStrategy = retryStrategy; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ErrorHandler + */ + @JsonAnySetter + public ErrorHandler putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ErrorHandler object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ErrorHandler errorHandler = (ErrorHandler) o; + return Objects.equals(this.fallbackStepName, errorHandler.fallbackStepName) + && Objects.equals(this.retryStrategy, errorHandler.retryStrategy) + && Objects.equals(this.additionalProperties, errorHandler.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(fallbackStepName, retryStrategy, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ErrorHandler {\n"); + sb.append(" fallbackStepName: ").append(toIndentedString(fallbackStepName)).append("\n"); + sb.append(" retryStrategy: ").append(toIndentedString(retryStrategy)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/GetWorkflowResponse.java b/src/main/java/com/datadog/api/client/v2/model/GetWorkflowResponse.java new file mode 100644 index 00000000000..fda4c887c47 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GetWorkflowResponse.java @@ -0,0 +1,136 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** The response object after getting a workflow. */ +@JsonPropertyOrder({GetWorkflowResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GetWorkflowResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private WorkflowData data; + + public GetWorkflowResponse data(WorkflowData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data related to the workflow. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public WorkflowData getData() { + return data; + } + + public void setData(WorkflowData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return GetWorkflowResponse + */ + @JsonAnySetter + public GetWorkflowResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this GetWorkflowResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetWorkflowResponse getWorkflowResponse = (GetWorkflowResponse) o; + return Objects.equals(this.data, getWorkflowResponse.data) + && Objects.equals(this.additionalProperties, getWorkflowResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetWorkflowResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/GithubWebhookTrigger.java b/src/main/java/com/datadog/api/client/v2/model/GithubWebhookTrigger.java new file mode 100644 index 00000000000..a027abef548 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GithubWebhookTrigger.java @@ -0,0 +1,142 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * Trigger a workflow VIA GitHub webhook. To trigger a workflow from GitHub, you must set a + * webhookSecret. In your GitHub Webhook Settings, set the Payload URL to + * "base_url"/api/v2/workflows/"workflow_id"/webhook?orgId="org_id", select application/json for the + * content type, and be highly recommend enabling SSL verification for security. The workflow must + * be published. + */ +@JsonPropertyOrder({GithubWebhookTrigger.JSON_PROPERTY_RATE_LIMIT}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GithubWebhookTrigger { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_RATE_LIMIT = "rateLimit"; + private TriggerRateLimit rateLimit; + + public GithubWebhookTrigger rateLimit(TriggerRateLimit rateLimit) { + this.rateLimit = rateLimit; + this.unparsed |= rateLimit.unparsed; + return this; + } + + /** + * Defines a rate limit for a trigger. + * + * @return rateLimit + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RATE_LIMIT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TriggerRateLimit getRateLimit() { + return rateLimit; + } + + public void setRateLimit(TriggerRateLimit rateLimit) { + this.rateLimit = rateLimit; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return GithubWebhookTrigger + */ + @JsonAnySetter + public GithubWebhookTrigger putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this GithubWebhookTrigger object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GithubWebhookTrigger githubWebhookTrigger = (GithubWebhookTrigger) o; + return Objects.equals(this.rateLimit, githubWebhookTrigger.rateLimit) + && Objects.equals(this.additionalProperties, githubWebhookTrigger.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(rateLimit, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GithubWebhookTrigger {\n"); + sb.append(" rateLimit: ").append(toIndentedString(rateLimit)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/GithubWebhookTriggerWrapper.java b/src/main/java/com/datadog/api/client/v2/model/GithubWebhookTriggerWrapper.java new file mode 100644 index 00000000000..02ef2d5cbf1 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GithubWebhookTriggerWrapper.java @@ -0,0 +1,194 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Schema for a GitHub webhook-based trigger. */ +@JsonPropertyOrder({ + GithubWebhookTriggerWrapper.JSON_PROPERTY_GITHUB_WEBHOOK_TRIGGER, + GithubWebhookTriggerWrapper.JSON_PROPERTY_START_STEP_NAMES +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GithubWebhookTriggerWrapper { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_GITHUB_WEBHOOK_TRIGGER = "githubWebhookTrigger"; + private GithubWebhookTrigger githubWebhookTrigger; + + public static final String JSON_PROPERTY_START_STEP_NAMES = "startStepNames"; + private List startStepNames = null; + + public GithubWebhookTriggerWrapper() {} + + @JsonCreator + public GithubWebhookTriggerWrapper( + @JsonProperty(required = true, value = JSON_PROPERTY_GITHUB_WEBHOOK_TRIGGER) + GithubWebhookTrigger githubWebhookTrigger) { + this.githubWebhookTrigger = githubWebhookTrigger; + this.unparsed |= githubWebhookTrigger.unparsed; + } + + public GithubWebhookTriggerWrapper githubWebhookTrigger( + GithubWebhookTrigger githubWebhookTrigger) { + this.githubWebhookTrigger = githubWebhookTrigger; + this.unparsed |= githubWebhookTrigger.unparsed; + return this; + } + + /** + * Trigger a workflow VIA GitHub webhook. To trigger a workflow from GitHub, you must set a + * webhookSecret. In your GitHub Webhook Settings, set the Payload URL to + * "base_url"/api/v2/workflows/"workflow_id"/webhook?orgId="org_id", select application/json for + * the content type, and be highly recommend enabling SSL verification for security. The workflow + * must be published. + * + * @return githubWebhookTrigger + */ + @JsonProperty(JSON_PROPERTY_GITHUB_WEBHOOK_TRIGGER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public GithubWebhookTrigger getGithubWebhookTrigger() { + return githubWebhookTrigger; + } + + public void setGithubWebhookTrigger(GithubWebhookTrigger githubWebhookTrigger) { + this.githubWebhookTrigger = githubWebhookTrigger; + } + + public GithubWebhookTriggerWrapper startStepNames(List startStepNames) { + this.startStepNames = startStepNames; + return this; + } + + public GithubWebhookTriggerWrapper addStartStepNamesItem(String startStepNamesItem) { + if (this.startStepNames == null) { + this.startStepNames = new ArrayList<>(); + } + this.startStepNames.add(startStepNamesItem); + return this; + } + + /** + * A list of steps that run first after a trigger fires. + * + * @return startStepNames + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_START_STEP_NAMES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getStartStepNames() { + return startStepNames; + } + + public void setStartStepNames(List startStepNames) { + this.startStepNames = startStepNames; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return GithubWebhookTriggerWrapper + */ + @JsonAnySetter + public GithubWebhookTriggerWrapper putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this GithubWebhookTriggerWrapper object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GithubWebhookTriggerWrapper githubWebhookTriggerWrapper = (GithubWebhookTriggerWrapper) o; + return Objects.equals( + this.githubWebhookTrigger, githubWebhookTriggerWrapper.githubWebhookTrigger) + && Objects.equals(this.startStepNames, githubWebhookTriggerWrapper.startStepNames) + && Objects.equals( + this.additionalProperties, githubWebhookTriggerWrapper.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(githubWebhookTrigger, startStepNames, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GithubWebhookTriggerWrapper {\n"); + sb.append(" githubWebhookTrigger: ") + .append(toIndentedString(githubWebhookTrigger)) + .append("\n"); + sb.append(" startStepNames: ").append(toIndentedString(startStepNames)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/IncidentTrigger.java b/src/main/java/com/datadog/api/client/v2/model/IncidentTrigger.java new file mode 100644 index 00000000000..b66772e162c --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IncidentTrigger.java @@ -0,0 +1,139 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * Trigger a workflow VIA an Incident. For automatic triggering a handle must be configured and the + * workflow must be published. + */ +@JsonPropertyOrder({IncidentTrigger.JSON_PROPERTY_RATE_LIMIT}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IncidentTrigger { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_RATE_LIMIT = "rateLimit"; + private TriggerRateLimit rateLimit; + + public IncidentTrigger rateLimit(TriggerRateLimit rateLimit) { + this.rateLimit = rateLimit; + this.unparsed |= rateLimit.unparsed; + return this; + } + + /** + * Defines a rate limit for a trigger. + * + * @return rateLimit + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RATE_LIMIT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TriggerRateLimit getRateLimit() { + return rateLimit; + } + + public void setRateLimit(TriggerRateLimit rateLimit) { + this.rateLimit = rateLimit; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return IncidentTrigger + */ + @JsonAnySetter + public IncidentTrigger putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this IncidentTrigger object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IncidentTrigger incidentTrigger = (IncidentTrigger) o; + return Objects.equals(this.rateLimit, incidentTrigger.rateLimit) + && Objects.equals(this.additionalProperties, incidentTrigger.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(rateLimit, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IncidentTrigger {\n"); + sb.append(" rateLimit: ").append(toIndentedString(rateLimit)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/IncidentTriggerWrapper.java b/src/main/java/com/datadog/api/client/v2/model/IncidentTriggerWrapper.java new file mode 100644 index 00000000000..a83c827d378 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IncidentTriggerWrapper.java @@ -0,0 +1,186 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Schema for an Incident-based trigger. */ +@JsonPropertyOrder({ + IncidentTriggerWrapper.JSON_PROPERTY_INCIDENT_TRIGGER, + IncidentTriggerWrapper.JSON_PROPERTY_START_STEP_NAMES +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IncidentTriggerWrapper { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_INCIDENT_TRIGGER = "incidentTrigger"; + private IncidentTrigger incidentTrigger; + + public static final String JSON_PROPERTY_START_STEP_NAMES = "startStepNames"; + private List startStepNames = null; + + public IncidentTriggerWrapper() {} + + @JsonCreator + public IncidentTriggerWrapper( + @JsonProperty(required = true, value = JSON_PROPERTY_INCIDENT_TRIGGER) + IncidentTrigger incidentTrigger) { + this.incidentTrigger = incidentTrigger; + this.unparsed |= incidentTrigger.unparsed; + } + + public IncidentTriggerWrapper incidentTrigger(IncidentTrigger incidentTrigger) { + this.incidentTrigger = incidentTrigger; + this.unparsed |= incidentTrigger.unparsed; + return this; + } + + /** + * Trigger a workflow VIA an Incident. For automatic triggering a handle must be configured and + * the workflow must be published. + * + * @return incidentTrigger + */ + @JsonProperty(JSON_PROPERTY_INCIDENT_TRIGGER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public IncidentTrigger getIncidentTrigger() { + return incidentTrigger; + } + + public void setIncidentTrigger(IncidentTrigger incidentTrigger) { + this.incidentTrigger = incidentTrigger; + } + + public IncidentTriggerWrapper startStepNames(List startStepNames) { + this.startStepNames = startStepNames; + return this; + } + + public IncidentTriggerWrapper addStartStepNamesItem(String startStepNamesItem) { + if (this.startStepNames == null) { + this.startStepNames = new ArrayList<>(); + } + this.startStepNames.add(startStepNamesItem); + return this; + } + + /** + * A list of steps that run first after a trigger fires. + * + * @return startStepNames + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_START_STEP_NAMES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getStartStepNames() { + return startStepNames; + } + + public void setStartStepNames(List startStepNames) { + this.startStepNames = startStepNames; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return IncidentTriggerWrapper + */ + @JsonAnySetter + public IncidentTriggerWrapper putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this IncidentTriggerWrapper object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IncidentTriggerWrapper incidentTriggerWrapper = (IncidentTriggerWrapper) o; + return Objects.equals(this.incidentTrigger, incidentTriggerWrapper.incidentTrigger) + && Objects.equals(this.startStepNames, incidentTriggerWrapper.startStepNames) + && Objects.equals(this.additionalProperties, incidentTriggerWrapper.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(incidentTrigger, startStepNames, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IncidentTriggerWrapper {\n"); + sb.append(" incidentTrigger: ").append(toIndentedString(incidentTrigger)).append("\n"); + sb.append(" startStepNames: ").append(toIndentedString(startStepNames)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/InputSchema.java b/src/main/java/com/datadog/api/client/v2/model/InputSchema.java new file mode 100644 index 00000000000..33824301f96 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/InputSchema.java @@ -0,0 +1,152 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** + * A list of input parameters for the workflow. These can be used as dynamic runtime values in your + * workflow. + */ +@JsonPropertyOrder({InputSchema.JSON_PROPERTY_PARAMETERS}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class InputSchema { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_PARAMETERS = "parameters"; + private List parameters = null; + + public InputSchema parameters(List parameters) { + this.parameters = parameters; + for (InputSchemaParameters item : parameters) { + this.unparsed |= item.unparsed; + } + return this; + } + + public InputSchema addParametersItem(InputSchemaParameters parametersItem) { + if (this.parameters == null) { + this.parameters = new ArrayList<>(); + } + this.parameters.add(parametersItem); + this.unparsed |= parametersItem.unparsed; + return this; + } + + /** + * The InputSchema parameters. + * + * @return parameters + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PARAMETERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getParameters() { + return parameters; + } + + public void setParameters(List parameters) { + this.parameters = parameters; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return InputSchema + */ + @JsonAnySetter + public InputSchema putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this InputSchema object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InputSchema inputSchema = (InputSchema) o; + return Objects.equals(this.parameters, inputSchema.parameters) + && Objects.equals(this.additionalProperties, inputSchema.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(parameters, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InputSchema {\n"); + sb.append(" parameters: ").append(toIndentedString(parameters)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/InputSchemaParameters.java b/src/main/java/com/datadog/api/client/v2/model/InputSchemaParameters.java new file mode 100644 index 00000000000..e01fd72c0d1 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/InputSchemaParameters.java @@ -0,0 +1,259 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** The definition of InputSchemaParameters object. */ +@JsonPropertyOrder({ + InputSchemaParameters.JSON_PROPERTY_DEFAULT_VALUE, + InputSchemaParameters.JSON_PROPERTY_DESCRIPTION, + InputSchemaParameters.JSON_PROPERTY_LABEL, + InputSchemaParameters.JSON_PROPERTY_NAME, + InputSchemaParameters.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class InputSchemaParameters { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DEFAULT_VALUE = "defaultValue"; + private Object defaultValue = null; + + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private String description; + + public static final String JSON_PROPERTY_LABEL = "label"; + private String label; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_TYPE = "type"; + private InputSchemaParametersType type; + + public InputSchemaParameters() {} + + @JsonCreator + public InputSchemaParameters( + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) InputSchemaParametersType type) { + this.name = name; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public InputSchemaParameters defaultValue(Object defaultValue) { + this.defaultValue = defaultValue; + return this; + } + + /** + * The InputSchemaParameters defaultValue. + * + * @return defaultValue + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DEFAULT_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Object getDefaultValue() { + return defaultValue; + } + + public void setDefaultValue(Object defaultValue) { + this.defaultValue = defaultValue; + } + + public InputSchemaParameters description(String description) { + this.description = description; + return this; + } + + /** + * The InputSchemaParameters description. + * + * @return description + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public InputSchemaParameters label(String label) { + this.label = label; + return this; + } + + /** + * The InputSchemaParameters label. + * + * @return label + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LABEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLabel() { + return label; + } + + public void setLabel(String label) { + this.label = label; + } + + public InputSchemaParameters name(String name) { + this.name = name; + return this; + } + + /** + * The InputSchemaParameters name. + * + * @return name + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public InputSchemaParameters type(InputSchemaParametersType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The definition of InputSchemaParametersType object. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public InputSchemaParametersType getType() { + return type; + } + + public void setType(InputSchemaParametersType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return InputSchemaParameters + */ + @JsonAnySetter + public InputSchemaParameters putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this InputSchemaParameters object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InputSchemaParameters inputSchemaParameters = (InputSchemaParameters) o; + return Objects.equals(this.defaultValue, inputSchemaParameters.defaultValue) + && Objects.equals(this.description, inputSchemaParameters.description) + && Objects.equals(this.label, inputSchemaParameters.label) + && Objects.equals(this.name, inputSchemaParameters.name) + && Objects.equals(this.type, inputSchemaParameters.type) + && Objects.equals(this.additionalProperties, inputSchemaParameters.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(defaultValue, description, label, name, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InputSchemaParameters {\n"); + sb.append(" defaultValue: ").append(toIndentedString(defaultValue)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" label: ").append(toIndentedString(label)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/InputSchemaParametersType.java b/src/main/java/com/datadog/api/client/v2/model/InputSchemaParametersType.java new file mode 100644 index 00000000000..506a99e2c59 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/InputSchemaParametersType.java @@ -0,0 +1,76 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** The definition of InputSchemaParametersType object. */ +@JsonSerialize(using = InputSchemaParametersType.InputSchemaParametersTypeSerializer.class) +public class InputSchemaParametersType extends ModelEnum { + + private static final Set allowedValues = + new HashSet( + Arrays.asList( + "STRING", + "NUMBER", + "BOOLEAN", + "OBJECT", + "ARRAY_STRING", + "ARRAY_NUMBER", + "ARRAY_BOOLEAN", + "ARRAY_OBJECT")); + + public static final InputSchemaParametersType STRING = new InputSchemaParametersType("STRING"); + public static final InputSchemaParametersType NUMBER = new InputSchemaParametersType("NUMBER"); + public static final InputSchemaParametersType BOOLEAN = new InputSchemaParametersType("BOOLEAN"); + public static final InputSchemaParametersType OBJECT = new InputSchemaParametersType("OBJECT"); + public static final InputSchemaParametersType ARRAY_STRING = + new InputSchemaParametersType("ARRAY_STRING"); + public static final InputSchemaParametersType ARRAY_NUMBER = + new InputSchemaParametersType("ARRAY_NUMBER"); + public static final InputSchemaParametersType ARRAY_BOOLEAN = + new InputSchemaParametersType("ARRAY_BOOLEAN"); + public static final InputSchemaParametersType ARRAY_OBJECT = + new InputSchemaParametersType("ARRAY_OBJECT"); + + InputSchemaParametersType(String value) { + super(value, allowedValues); + } + + public static class InputSchemaParametersTypeSerializer + extends StdSerializer { + public InputSchemaParametersTypeSerializer(Class t) { + super(t); + } + + public InputSchemaParametersTypeSerializer() { + this(null); + } + + @Override + public void serialize( + InputSchemaParametersType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static InputSchemaParametersType fromValue(String value) { + return new InputSchemaParametersType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/MonitorTrigger.java b/src/main/java/com/datadog/api/client/v2/model/MonitorTrigger.java new file mode 100644 index 00000000000..7f7124a7cc6 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/MonitorTrigger.java @@ -0,0 +1,139 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * Trigger a workflow VIA a Monitor. For automatic triggering a handle must be configured and the + * workflow must be published. + */ +@JsonPropertyOrder({MonitorTrigger.JSON_PROPERTY_RATE_LIMIT}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class MonitorTrigger { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_RATE_LIMIT = "rateLimit"; + private TriggerRateLimit rateLimit; + + public MonitorTrigger rateLimit(TriggerRateLimit rateLimit) { + this.rateLimit = rateLimit; + this.unparsed |= rateLimit.unparsed; + return this; + } + + /** + * Defines a rate limit for a trigger. + * + * @return rateLimit + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RATE_LIMIT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TriggerRateLimit getRateLimit() { + return rateLimit; + } + + public void setRateLimit(TriggerRateLimit rateLimit) { + this.rateLimit = rateLimit; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return MonitorTrigger + */ + @JsonAnySetter + public MonitorTrigger putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this MonitorTrigger object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MonitorTrigger monitorTrigger = (MonitorTrigger) o; + return Objects.equals(this.rateLimit, monitorTrigger.rateLimit) + && Objects.equals(this.additionalProperties, monitorTrigger.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(rateLimit, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MonitorTrigger {\n"); + sb.append(" rateLimit: ").append(toIndentedString(rateLimit)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/MonitorTriggerWrapper.java b/src/main/java/com/datadog/api/client/v2/model/MonitorTriggerWrapper.java new file mode 100644 index 00000000000..7dde250b995 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/MonitorTriggerWrapper.java @@ -0,0 +1,186 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Schema for a Monitor-based trigger. */ +@JsonPropertyOrder({ + MonitorTriggerWrapper.JSON_PROPERTY_MONITOR_TRIGGER, + MonitorTriggerWrapper.JSON_PROPERTY_START_STEP_NAMES +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class MonitorTriggerWrapper { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_MONITOR_TRIGGER = "monitorTrigger"; + private MonitorTrigger monitorTrigger; + + public static final String JSON_PROPERTY_START_STEP_NAMES = "startStepNames"; + private List startStepNames = null; + + public MonitorTriggerWrapper() {} + + @JsonCreator + public MonitorTriggerWrapper( + @JsonProperty(required = true, value = JSON_PROPERTY_MONITOR_TRIGGER) + MonitorTrigger monitorTrigger) { + this.monitorTrigger = monitorTrigger; + this.unparsed |= monitorTrigger.unparsed; + } + + public MonitorTriggerWrapper monitorTrigger(MonitorTrigger monitorTrigger) { + this.monitorTrigger = monitorTrigger; + this.unparsed |= monitorTrigger.unparsed; + return this; + } + + /** + * Trigger a workflow VIA a Monitor. For automatic triggering a handle must be configured and the + * workflow must be published. + * + * @return monitorTrigger + */ + @JsonProperty(JSON_PROPERTY_MONITOR_TRIGGER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public MonitorTrigger getMonitorTrigger() { + return monitorTrigger; + } + + public void setMonitorTrigger(MonitorTrigger monitorTrigger) { + this.monitorTrigger = monitorTrigger; + } + + public MonitorTriggerWrapper startStepNames(List startStepNames) { + this.startStepNames = startStepNames; + return this; + } + + public MonitorTriggerWrapper addStartStepNamesItem(String startStepNamesItem) { + if (this.startStepNames == null) { + this.startStepNames = new ArrayList<>(); + } + this.startStepNames.add(startStepNamesItem); + return this; + } + + /** + * A list of steps that run first after a trigger fires. + * + * @return startStepNames + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_START_STEP_NAMES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getStartStepNames() { + return startStepNames; + } + + public void setStartStepNames(List startStepNames) { + this.startStepNames = startStepNames; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return MonitorTriggerWrapper + */ + @JsonAnySetter + public MonitorTriggerWrapper putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this MonitorTriggerWrapper object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MonitorTriggerWrapper monitorTriggerWrapper = (MonitorTriggerWrapper) o; + return Objects.equals(this.monitorTrigger, monitorTriggerWrapper.monitorTrigger) + && Objects.equals(this.startStepNames, monitorTriggerWrapper.startStepNames) + && Objects.equals(this.additionalProperties, monitorTriggerWrapper.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(monitorTrigger, startStepNames, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MonitorTriggerWrapper {\n"); + sb.append(" monitorTrigger: ").append(toIndentedString(monitorTrigger)).append("\n"); + sb.append(" startStepNames: ").append(toIndentedString(startStepNames)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/OutboundEdge.java b/src/main/java/com/datadog/api/client/v2/model/OutboundEdge.java new file mode 100644 index 00000000000..e10263496be --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/OutboundEdge.java @@ -0,0 +1,173 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** The definition of OutboundEdge object. */ +@JsonPropertyOrder({ + OutboundEdge.JSON_PROPERTY_BRANCH_NAME, + OutboundEdge.JSON_PROPERTY_NEXT_STEP_NAME +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class OutboundEdge { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_BRANCH_NAME = "branchName"; + private String branchName; + + public static final String JSON_PROPERTY_NEXT_STEP_NAME = "nextStepName"; + private String nextStepName; + + public OutboundEdge() {} + + @JsonCreator + public OutboundEdge( + @JsonProperty(required = true, value = JSON_PROPERTY_BRANCH_NAME) String branchName, + @JsonProperty(required = true, value = JSON_PROPERTY_NEXT_STEP_NAME) String nextStepName) { + this.branchName = branchName; + this.nextStepName = nextStepName; + } + + public OutboundEdge branchName(String branchName) { + this.branchName = branchName; + return this; + } + + /** + * The OutboundEdge branchName. + * + * @return branchName + */ + @JsonProperty(JSON_PROPERTY_BRANCH_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getBranchName() { + return branchName; + } + + public void setBranchName(String branchName) { + this.branchName = branchName; + } + + public OutboundEdge nextStepName(String nextStepName) { + this.nextStepName = nextStepName; + return this; + } + + /** + * The OutboundEdge nextStepName. + * + * @return nextStepName + */ + @JsonProperty(JSON_PROPERTY_NEXT_STEP_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getNextStepName() { + return nextStepName; + } + + public void setNextStepName(String nextStepName) { + this.nextStepName = nextStepName; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return OutboundEdge + */ + @JsonAnySetter + public OutboundEdge putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this OutboundEdge object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OutboundEdge outboundEdge = (OutboundEdge) o; + return Objects.equals(this.branchName, outboundEdge.branchName) + && Objects.equals(this.nextStepName, outboundEdge.nextStepName) + && Objects.equals(this.additionalProperties, outboundEdge.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(branchName, nextStepName, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OutboundEdge {\n"); + sb.append(" branchName: ").append(toIndentedString(branchName)).append("\n"); + sb.append(" nextStepName: ").append(toIndentedString(nextStepName)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/OutputSchema.java b/src/main/java/com/datadog/api/client/v2/model/OutputSchema.java new file mode 100644 index 00000000000..09aeddb0723 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/OutputSchema.java @@ -0,0 +1,149 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** A list of output parameters for the workflow. */ +@JsonPropertyOrder({OutputSchema.JSON_PROPERTY_PARAMETERS}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class OutputSchema { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_PARAMETERS = "parameters"; + private List parameters = null; + + public OutputSchema parameters(List parameters) { + this.parameters = parameters; + for (OutputSchemaParameters item : parameters) { + this.unparsed |= item.unparsed; + } + return this; + } + + public OutputSchema addParametersItem(OutputSchemaParameters parametersItem) { + if (this.parameters == null) { + this.parameters = new ArrayList<>(); + } + this.parameters.add(parametersItem); + this.unparsed |= parametersItem.unparsed; + return this; + } + + /** + * The OutputSchema parameters. + * + * @return parameters + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PARAMETERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getParameters() { + return parameters; + } + + public void setParameters(List parameters) { + this.parameters = parameters; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return OutputSchema + */ + @JsonAnySetter + public OutputSchema putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this OutputSchema object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OutputSchema outputSchema = (OutputSchema) o; + return Objects.equals(this.parameters, outputSchema.parameters) + && Objects.equals(this.additionalProperties, outputSchema.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(parameters, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OutputSchema {\n"); + sb.append(" parameters: ").append(toIndentedString(parameters)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/OutputSchemaParameters.java b/src/main/java/com/datadog/api/client/v2/model/OutputSchemaParameters.java new file mode 100644 index 00000000000..ee414676955 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/OutputSchemaParameters.java @@ -0,0 +1,286 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** The definition of OutputSchemaParameters object. */ +@JsonPropertyOrder({ + OutputSchemaParameters.JSON_PROPERTY_DEFAULT_VALUE, + OutputSchemaParameters.JSON_PROPERTY_DESCRIPTION, + OutputSchemaParameters.JSON_PROPERTY_LABEL, + OutputSchemaParameters.JSON_PROPERTY_NAME, + OutputSchemaParameters.JSON_PROPERTY_TYPE, + OutputSchemaParameters.JSON_PROPERTY_VALUE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class OutputSchemaParameters { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DEFAULT_VALUE = "defaultValue"; + private Object defaultValue = null; + + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private String description; + + public static final String JSON_PROPERTY_LABEL = "label"; + private String label; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_TYPE = "type"; + private OutputSchemaParametersType type; + + public static final String JSON_PROPERTY_VALUE = "value"; + private Object value = null; + + public OutputSchemaParameters() {} + + @JsonCreator + public OutputSchemaParameters( + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) OutputSchemaParametersType type) { + this.name = name; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public OutputSchemaParameters defaultValue(Object defaultValue) { + this.defaultValue = defaultValue; + return this; + } + + /** + * The OutputSchemaParameters defaultValue. + * + * @return defaultValue + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DEFAULT_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Object getDefaultValue() { + return defaultValue; + } + + public void setDefaultValue(Object defaultValue) { + this.defaultValue = defaultValue; + } + + public OutputSchemaParameters description(String description) { + this.description = description; + return this; + } + + /** + * The OutputSchemaParameters description. + * + * @return description + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public OutputSchemaParameters label(String label) { + this.label = label; + return this; + } + + /** + * The OutputSchemaParameters label. + * + * @return label + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LABEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLabel() { + return label; + } + + public void setLabel(String label) { + this.label = label; + } + + public OutputSchemaParameters name(String name) { + this.name = name; + return this; + } + + /** + * The OutputSchemaParameters name. + * + * @return name + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public OutputSchemaParameters type(OutputSchemaParametersType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The definition of OutputSchemaParametersType object. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OutputSchemaParametersType getType() { + return type; + } + + public void setType(OutputSchemaParametersType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + public OutputSchemaParameters value(Object value) { + this.value = value; + return this; + } + + /** + * The OutputSchemaParameters value. + * + * @return value + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Object getValue() { + return value; + } + + public void setValue(Object value) { + this.value = value; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return OutputSchemaParameters + */ + @JsonAnySetter + public OutputSchemaParameters putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this OutputSchemaParameters object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OutputSchemaParameters outputSchemaParameters = (OutputSchemaParameters) o; + return Objects.equals(this.defaultValue, outputSchemaParameters.defaultValue) + && Objects.equals(this.description, outputSchemaParameters.description) + && Objects.equals(this.label, outputSchemaParameters.label) + && Objects.equals(this.name, outputSchemaParameters.name) + && Objects.equals(this.type, outputSchemaParameters.type) + && Objects.equals(this.value, outputSchemaParameters.value) + && Objects.equals(this.additionalProperties, outputSchemaParameters.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(defaultValue, description, label, name, type, value, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OutputSchemaParameters {\n"); + sb.append(" defaultValue: ").append(toIndentedString(defaultValue)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" label: ").append(toIndentedString(label)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/OutputSchemaParametersType.java b/src/main/java/com/datadog/api/client/v2/model/OutputSchemaParametersType.java new file mode 100644 index 00000000000..91a91f96bbb --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/OutputSchemaParametersType.java @@ -0,0 +1,77 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** The definition of OutputSchemaParametersType object. */ +@JsonSerialize(using = OutputSchemaParametersType.OutputSchemaParametersTypeSerializer.class) +public class OutputSchemaParametersType extends ModelEnum { + + private static final Set allowedValues = + new HashSet( + Arrays.asList( + "STRING", + "NUMBER", + "BOOLEAN", + "OBJECT", + "ARRAY_STRING", + "ARRAY_NUMBER", + "ARRAY_BOOLEAN", + "ARRAY_OBJECT")); + + public static final OutputSchemaParametersType STRING = new OutputSchemaParametersType("STRING"); + public static final OutputSchemaParametersType NUMBER = new OutputSchemaParametersType("NUMBER"); + public static final OutputSchemaParametersType BOOLEAN = + new OutputSchemaParametersType("BOOLEAN"); + public static final OutputSchemaParametersType OBJECT = new OutputSchemaParametersType("OBJECT"); + public static final OutputSchemaParametersType ARRAY_STRING = + new OutputSchemaParametersType("ARRAY_STRING"); + public static final OutputSchemaParametersType ARRAY_NUMBER = + new OutputSchemaParametersType("ARRAY_NUMBER"); + public static final OutputSchemaParametersType ARRAY_BOOLEAN = + new OutputSchemaParametersType("ARRAY_BOOLEAN"); + public static final OutputSchemaParametersType ARRAY_OBJECT = + new OutputSchemaParametersType("ARRAY_OBJECT"); + + OutputSchemaParametersType(String value) { + super(value, allowedValues); + } + + public static class OutputSchemaParametersTypeSerializer + extends StdSerializer { + public OutputSchemaParametersTypeSerializer(Class t) { + super(t); + } + + public OutputSchemaParametersTypeSerializer() { + this(null); + } + + @Override + public void serialize( + OutputSchemaParametersType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static OutputSchemaParametersType fromValue(String value) { + return new OutputSchemaParametersType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/Parameter.java b/src/main/java/com/datadog/api/client/v2/model/Parameter.java new file mode 100644 index 00000000000..047f75c9083 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/Parameter.java @@ -0,0 +1,170 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** The definition of Parameter object. */ +@JsonPropertyOrder({Parameter.JSON_PROPERTY_NAME, Parameter.JSON_PROPERTY_VALUE}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class Parameter { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_VALUE = "value"; + private Object value = new Object(); + + public Parameter() {} + + @JsonCreator + public Parameter( + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name, + @JsonProperty(required = true, value = JSON_PROPERTY_VALUE) Object value) { + this.name = name; + this.value = value; + } + + public Parameter name(String name) { + this.name = name; + return this; + } + + /** + * The Parameter name. + * + * @return name + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Parameter value(Object value) { + this.value = value; + return this; + } + + /** + * The Parameter value. + * + * @return value + */ + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Object getValue() { + return value; + } + + public void setValue(Object value) { + this.value = value; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return Parameter + */ + @JsonAnySetter + public Parameter putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this Parameter object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Parameter parameter = (Parameter) o; + return Objects.equals(this.name, parameter.name) + && Objects.equals(this.value, parameter.value) + && Objects.equals(this.additionalProperties, parameter.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, value, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Parameter {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ReadinessGate.java b/src/main/java/com/datadog/api/client/v2/model/ReadinessGate.java new file mode 100644 index 00000000000..39bb629919e --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ReadinessGate.java @@ -0,0 +1,149 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Used to merge multiple branches into a single branch. */ +@JsonPropertyOrder({ReadinessGate.JSON_PROPERTY_THRESHOLD_TYPE}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ReadinessGate { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_THRESHOLD_TYPE = "thresholdType"; + private ReadinessGateThresholdType thresholdType; + + public ReadinessGate() {} + + @JsonCreator + public ReadinessGate( + @JsonProperty(required = true, value = JSON_PROPERTY_THRESHOLD_TYPE) + ReadinessGateThresholdType thresholdType) { + this.thresholdType = thresholdType; + this.unparsed |= !thresholdType.isValid(); + } + + public ReadinessGate thresholdType(ReadinessGateThresholdType thresholdType) { + this.thresholdType = thresholdType; + this.unparsed |= !thresholdType.isValid(); + return this; + } + + /** + * The definition of ReadinessGateThresholdType object. + * + * @return thresholdType + */ + @JsonProperty(JSON_PROPERTY_THRESHOLD_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ReadinessGateThresholdType getThresholdType() { + return thresholdType; + } + + public void setThresholdType(ReadinessGateThresholdType thresholdType) { + if (!thresholdType.isValid()) { + this.unparsed = true; + } + this.thresholdType = thresholdType; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ReadinessGate + */ + @JsonAnySetter + public ReadinessGate putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ReadinessGate object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ReadinessGate readinessGate = (ReadinessGate) o; + return Objects.equals(this.thresholdType, readinessGate.thresholdType) + && Objects.equals(this.additionalProperties, readinessGate.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(thresholdType, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReadinessGate {\n"); + sb.append(" thresholdType: ").append(toIndentedString(thresholdType)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ReadinessGateThresholdType.java b/src/main/java/com/datadog/api/client/v2/model/ReadinessGateThresholdType.java new file mode 100644 index 00000000000..221ee89f018 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ReadinessGateThresholdType.java @@ -0,0 +1,56 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** The definition of ReadinessGateThresholdType object. */ +@JsonSerialize(using = ReadinessGateThresholdType.ReadinessGateThresholdTypeSerializer.class) +public class ReadinessGateThresholdType extends ModelEnum { + + private static final Set allowedValues = new HashSet(Arrays.asList("ANY", "ALL")); + + public static final ReadinessGateThresholdType ANY = new ReadinessGateThresholdType("ANY"); + public static final ReadinessGateThresholdType ALL = new ReadinessGateThresholdType("ALL"); + + ReadinessGateThresholdType(String value) { + super(value, allowedValues); + } + + public static class ReadinessGateThresholdTypeSerializer + extends StdSerializer { + public ReadinessGateThresholdTypeSerializer(Class t) { + super(t); + } + + public ReadinessGateThresholdTypeSerializer() { + this(null); + } + + @Override + public void serialize( + ReadinessGateThresholdType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static ReadinessGateThresholdType fromValue(String value) { + return new ReadinessGateThresholdType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/RetryStrategy.java b/src/main/java/com/datadog/api/client/v2/model/RetryStrategy.java new file mode 100644 index 00000000000..593c3831a99 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RetryStrategy.java @@ -0,0 +1,175 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** The definition of RetryStrategy object. */ +@JsonPropertyOrder({RetryStrategy.JSON_PROPERTY_KIND, RetryStrategy.JSON_PROPERTY_LINEAR}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class RetryStrategy { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_KIND = "kind"; + private RetryStrategyKind kind; + + public static final String JSON_PROPERTY_LINEAR = "linear"; + private RetryStrategyLinear linear; + + public RetryStrategy() {} + + @JsonCreator + public RetryStrategy( + @JsonProperty(required = true, value = JSON_PROPERTY_KIND) RetryStrategyKind kind) { + this.kind = kind; + this.unparsed |= !kind.isValid(); + } + + public RetryStrategy kind(RetryStrategyKind kind) { + this.kind = kind; + this.unparsed |= !kind.isValid(); + return this; + } + + /** + * The definition of RetryStrategyKind object. + * + * @return kind + */ + @JsonProperty(JSON_PROPERTY_KIND) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public RetryStrategyKind getKind() { + return kind; + } + + public void setKind(RetryStrategyKind kind) { + if (!kind.isValid()) { + this.unparsed = true; + } + this.kind = kind; + } + + public RetryStrategy linear(RetryStrategyLinear linear) { + this.linear = linear; + this.unparsed |= linear.unparsed; + return this; + } + + /** + * The definition of RetryStrategyLinear object. + * + * @return linear + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LINEAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public RetryStrategyLinear getLinear() { + return linear; + } + + public void setLinear(RetryStrategyLinear linear) { + this.linear = linear; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return RetryStrategy + */ + @JsonAnySetter + public RetryStrategy putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this RetryStrategy object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RetryStrategy retryStrategy = (RetryStrategy) o; + return Objects.equals(this.kind, retryStrategy.kind) + && Objects.equals(this.linear, retryStrategy.linear) + && Objects.equals(this.additionalProperties, retryStrategy.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(kind, linear, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RetryStrategy {\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append(" linear: ").append(toIndentedString(linear)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/RetryStrategyKind.java b/src/main/java/com/datadog/api/client/v2/model/RetryStrategyKind.java new file mode 100644 index 00000000000..1a9e55dc083 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RetryStrategyKind.java @@ -0,0 +1,55 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** The definition of RetryStrategyKind object. */ +@JsonSerialize(using = RetryStrategyKind.RetryStrategyKindSerializer.class) +public class RetryStrategyKind extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("RETRY_STRATEGY_LINEAR")); + + public static final RetryStrategyKind RETRY_STRATEGY_LINEAR = + new RetryStrategyKind("RETRY_STRATEGY_LINEAR"); + + RetryStrategyKind(String value) { + super(value, allowedValues); + } + + public static class RetryStrategyKindSerializer extends StdSerializer { + public RetryStrategyKindSerializer(Class t) { + super(t); + } + + public RetryStrategyKindSerializer() { + this(null); + } + + @Override + public void serialize(RetryStrategyKind value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static RetryStrategyKind fromValue(String value) { + return new RetryStrategyKind(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/RetryStrategyLinear.java b/src/main/java/com/datadog/api/client/v2/model/RetryStrategyLinear.java new file mode 100644 index 00000000000..82a12d1dd6c --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RetryStrategyLinear.java @@ -0,0 +1,174 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** The definition of RetryStrategyLinear object. */ +@JsonPropertyOrder({ + RetryStrategyLinear.JSON_PROPERTY_INTERVAL, + RetryStrategyLinear.JSON_PROPERTY_MAX_RETRIES +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class RetryStrategyLinear { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_INTERVAL = "interval"; + private String interval; + + public static final String JSON_PROPERTY_MAX_RETRIES = "maxRetries"; + private Double maxRetries; + + public RetryStrategyLinear() {} + + @JsonCreator + public RetryStrategyLinear( + @JsonProperty(required = true, value = JSON_PROPERTY_INTERVAL) String interval, + @JsonProperty(required = true, value = JSON_PROPERTY_MAX_RETRIES) Double maxRetries) { + this.interval = interval; + this.maxRetries = maxRetries; + } + + public RetryStrategyLinear interval(String interval) { + this.interval = interval; + return this; + } + + /** + * The RetryStrategyLinear interval. The expected format is the number + * of seconds ending with an s. For example, 1 day is 86400s + * + * @return interval + */ + @JsonProperty(JSON_PROPERTY_INTERVAL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getInterval() { + return interval; + } + + public void setInterval(String interval) { + this.interval = interval; + } + + public RetryStrategyLinear maxRetries(Double maxRetries) { + this.maxRetries = maxRetries; + return this; + } + + /** + * The RetryStrategyLinear maxRetries. + * + * @return maxRetries + */ + @JsonProperty(JSON_PROPERTY_MAX_RETRIES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Double getMaxRetries() { + return maxRetries; + } + + public void setMaxRetries(Double maxRetries) { + this.maxRetries = maxRetries; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return RetryStrategyLinear + */ + @JsonAnySetter + public RetryStrategyLinear putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this RetryStrategyLinear object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RetryStrategyLinear retryStrategyLinear = (RetryStrategyLinear) o; + return Objects.equals(this.interval, retryStrategyLinear.interval) + && Objects.equals(this.maxRetries, retryStrategyLinear.maxRetries) + && Objects.equals(this.additionalProperties, retryStrategyLinear.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(interval, maxRetries, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RetryStrategyLinear {\n"); + sb.append(" interval: ").append(toIndentedString(interval)).append("\n"); + sb.append(" maxRetries: ").append(toIndentedString(maxRetries)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ScheduleTrigger.java b/src/main/java/com/datadog/api/client/v2/model/ScheduleTrigger.java new file mode 100644 index 00000000000..60e7e60e791 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ScheduleTrigger.java @@ -0,0 +1,144 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Trigger a workflow VIA a Schedule. The workflow must be published. */ +@JsonPropertyOrder({ScheduleTrigger.JSON_PROPERTY_RRULE_EXPRESSION}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ScheduleTrigger { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_RRULE_EXPRESSION = "rruleExpression"; + private String rruleExpression; + + public ScheduleTrigger() {} + + @JsonCreator + public ScheduleTrigger( + @JsonProperty(required = true, value = JSON_PROPERTY_RRULE_EXPRESSION) + String rruleExpression) { + this.rruleExpression = rruleExpression; + } + + public ScheduleTrigger rruleExpression(String rruleExpression) { + this.rruleExpression = rruleExpression; + return this; + } + + /** + * Recurrence rule expression for scheduling. + * + * @return rruleExpression + */ + @JsonProperty(JSON_PROPERTY_RRULE_EXPRESSION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getRruleExpression() { + return rruleExpression; + } + + public void setRruleExpression(String rruleExpression) { + this.rruleExpression = rruleExpression; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ScheduleTrigger + */ + @JsonAnySetter + public ScheduleTrigger putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ScheduleTrigger object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ScheduleTrigger scheduleTrigger = (ScheduleTrigger) o; + return Objects.equals(this.rruleExpression, scheduleTrigger.rruleExpression) + && Objects.equals(this.additionalProperties, scheduleTrigger.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(rruleExpression, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ScheduleTrigger {\n"); + sb.append(" rruleExpression: ").append(toIndentedString(rruleExpression)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ScheduleTriggerWrapper.java b/src/main/java/com/datadog/api/client/v2/model/ScheduleTriggerWrapper.java new file mode 100644 index 00000000000..a3e76888bc3 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ScheduleTriggerWrapper.java @@ -0,0 +1,185 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Schema for a Schedule-based trigger. */ +@JsonPropertyOrder({ + ScheduleTriggerWrapper.JSON_PROPERTY_SCHEDULE_TRIGGER, + ScheduleTriggerWrapper.JSON_PROPERTY_START_STEP_NAMES +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ScheduleTriggerWrapper { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_SCHEDULE_TRIGGER = "scheduleTrigger"; + private ScheduleTrigger scheduleTrigger; + + public static final String JSON_PROPERTY_START_STEP_NAMES = "startStepNames"; + private List startStepNames = null; + + public ScheduleTriggerWrapper() {} + + @JsonCreator + public ScheduleTriggerWrapper( + @JsonProperty(required = true, value = JSON_PROPERTY_SCHEDULE_TRIGGER) + ScheduleTrigger scheduleTrigger) { + this.scheduleTrigger = scheduleTrigger; + this.unparsed |= scheduleTrigger.unparsed; + } + + public ScheduleTriggerWrapper scheduleTrigger(ScheduleTrigger scheduleTrigger) { + this.scheduleTrigger = scheduleTrigger; + this.unparsed |= scheduleTrigger.unparsed; + return this; + } + + /** + * Trigger a workflow VIA a Schedule. The workflow must be published. + * + * @return scheduleTrigger + */ + @JsonProperty(JSON_PROPERTY_SCHEDULE_TRIGGER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ScheduleTrigger getScheduleTrigger() { + return scheduleTrigger; + } + + public void setScheduleTrigger(ScheduleTrigger scheduleTrigger) { + this.scheduleTrigger = scheduleTrigger; + } + + public ScheduleTriggerWrapper startStepNames(List startStepNames) { + this.startStepNames = startStepNames; + return this; + } + + public ScheduleTriggerWrapper addStartStepNamesItem(String startStepNamesItem) { + if (this.startStepNames == null) { + this.startStepNames = new ArrayList<>(); + } + this.startStepNames.add(startStepNamesItem); + return this; + } + + /** + * A list of steps that run first after a trigger fires. + * + * @return startStepNames + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_START_STEP_NAMES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getStartStepNames() { + return startStepNames; + } + + public void setStartStepNames(List startStepNames) { + this.startStepNames = startStepNames; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ScheduleTriggerWrapper + */ + @JsonAnySetter + public ScheduleTriggerWrapper putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ScheduleTriggerWrapper object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ScheduleTriggerWrapper scheduleTriggerWrapper = (ScheduleTriggerWrapper) o; + return Objects.equals(this.scheduleTrigger, scheduleTriggerWrapper.scheduleTrigger) + && Objects.equals(this.startStepNames, scheduleTriggerWrapper.startStepNames) + && Objects.equals(this.additionalProperties, scheduleTriggerWrapper.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(scheduleTrigger, startStepNames, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ScheduleTriggerWrapper {\n"); + sb.append(" scheduleTrigger: ").append(toIndentedString(scheduleTrigger)).append("\n"); + sb.append(" startStepNames: ").append(toIndentedString(startStepNames)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/SecurityTrigger.java b/src/main/java/com/datadog/api/client/v2/model/SecurityTrigger.java new file mode 100644 index 00000000000..192f289e0b3 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SecurityTrigger.java @@ -0,0 +1,139 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * Trigger a workflow VIA a Security Signal or Finding. For automatic triggering a handle must be + * configured and the workflow must be published. + */ +@JsonPropertyOrder({SecurityTrigger.JSON_PROPERTY_RATE_LIMIT}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SecurityTrigger { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_RATE_LIMIT = "rateLimit"; + private TriggerRateLimit rateLimit; + + public SecurityTrigger rateLimit(TriggerRateLimit rateLimit) { + this.rateLimit = rateLimit; + this.unparsed |= rateLimit.unparsed; + return this; + } + + /** + * Defines a rate limit for a trigger. + * + * @return rateLimit + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RATE_LIMIT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TriggerRateLimit getRateLimit() { + return rateLimit; + } + + public void setRateLimit(TriggerRateLimit rateLimit) { + this.rateLimit = rateLimit; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return SecurityTrigger + */ + @JsonAnySetter + public SecurityTrigger putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this SecurityTrigger object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SecurityTrigger securityTrigger = (SecurityTrigger) o; + return Objects.equals(this.rateLimit, securityTrigger.rateLimit) + && Objects.equals(this.additionalProperties, securityTrigger.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(rateLimit, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SecurityTrigger {\n"); + sb.append(" rateLimit: ").append(toIndentedString(rateLimit)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/SecurityTriggerWrapper.java b/src/main/java/com/datadog/api/client/v2/model/SecurityTriggerWrapper.java new file mode 100644 index 00000000000..cefa71b3013 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SecurityTriggerWrapper.java @@ -0,0 +1,186 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Schema for a Security-based trigger. */ +@JsonPropertyOrder({ + SecurityTriggerWrapper.JSON_PROPERTY_SECURITY_TRIGGER, + SecurityTriggerWrapper.JSON_PROPERTY_START_STEP_NAMES +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SecurityTriggerWrapper { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_SECURITY_TRIGGER = "securityTrigger"; + private SecurityTrigger securityTrigger; + + public static final String JSON_PROPERTY_START_STEP_NAMES = "startStepNames"; + private List startStepNames = null; + + public SecurityTriggerWrapper() {} + + @JsonCreator + public SecurityTriggerWrapper( + @JsonProperty(required = true, value = JSON_PROPERTY_SECURITY_TRIGGER) + SecurityTrigger securityTrigger) { + this.securityTrigger = securityTrigger; + this.unparsed |= securityTrigger.unparsed; + } + + public SecurityTriggerWrapper securityTrigger(SecurityTrigger securityTrigger) { + this.securityTrigger = securityTrigger; + this.unparsed |= securityTrigger.unparsed; + return this; + } + + /** + * Trigger a workflow VIA a Security Signal or Finding. For automatic triggering a handle must be + * configured and the workflow must be published. + * + * @return securityTrigger + */ + @JsonProperty(JSON_PROPERTY_SECURITY_TRIGGER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public SecurityTrigger getSecurityTrigger() { + return securityTrigger; + } + + public void setSecurityTrigger(SecurityTrigger securityTrigger) { + this.securityTrigger = securityTrigger; + } + + public SecurityTriggerWrapper startStepNames(List startStepNames) { + this.startStepNames = startStepNames; + return this; + } + + public SecurityTriggerWrapper addStartStepNamesItem(String startStepNamesItem) { + if (this.startStepNames == null) { + this.startStepNames = new ArrayList<>(); + } + this.startStepNames.add(startStepNamesItem); + return this; + } + + /** + * A list of steps that run first after a trigger fires. + * + * @return startStepNames + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_START_STEP_NAMES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getStartStepNames() { + return startStepNames; + } + + public void setStartStepNames(List startStepNames) { + this.startStepNames = startStepNames; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return SecurityTriggerWrapper + */ + @JsonAnySetter + public SecurityTriggerWrapper putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this SecurityTriggerWrapper object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SecurityTriggerWrapper securityTriggerWrapper = (SecurityTriggerWrapper) o; + return Objects.equals(this.securityTrigger, securityTriggerWrapper.securityTrigger) + && Objects.equals(this.startStepNames, securityTriggerWrapper.startStepNames) + && Objects.equals(this.additionalProperties, securityTriggerWrapper.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(securityTrigger, startStepNames, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SecurityTriggerWrapper {\n"); + sb.append(" securityTrigger: ").append(toIndentedString(securityTrigger)).append("\n"); + sb.append(" startStepNames: ").append(toIndentedString(startStepNames)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/SlackTriggerWrapper.java b/src/main/java/com/datadog/api/client/v2/model/SlackTriggerWrapper.java new file mode 100644 index 00000000000..ffde0c34079 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SlackTriggerWrapper.java @@ -0,0 +1,182 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Schema for a Slack-based trigger. */ +@JsonPropertyOrder({ + SlackTriggerWrapper.JSON_PROPERTY_SLACK_TRIGGER, + SlackTriggerWrapper.JSON_PROPERTY_START_STEP_NAMES +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SlackTriggerWrapper { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_SLACK_TRIGGER = "slackTrigger"; + private Object slackTrigger; + + public static final String JSON_PROPERTY_START_STEP_NAMES = "startStepNames"; + private List startStepNames = null; + + public SlackTriggerWrapper() {} + + @JsonCreator + public SlackTriggerWrapper( + @JsonProperty(required = true, value = JSON_PROPERTY_SLACK_TRIGGER) Object slackTrigger) { + this.slackTrigger = slackTrigger; + } + + public SlackTriggerWrapper slackTrigger(Object slackTrigger) { + this.slackTrigger = slackTrigger; + return this; + } + + /** + * Trigger a workflow VIA Slack. The workflow must be published. + * + * @return slackTrigger + */ + @JsonProperty(JSON_PROPERTY_SLACK_TRIGGER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Object getSlackTrigger() { + return slackTrigger; + } + + public void setSlackTrigger(Object slackTrigger) { + this.slackTrigger = slackTrigger; + } + + public SlackTriggerWrapper startStepNames(List startStepNames) { + this.startStepNames = startStepNames; + return this; + } + + public SlackTriggerWrapper addStartStepNamesItem(String startStepNamesItem) { + if (this.startStepNames == null) { + this.startStepNames = new ArrayList<>(); + } + this.startStepNames.add(startStepNamesItem); + return this; + } + + /** + * A list of steps that run first after a trigger fires. + * + * @return startStepNames + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_START_STEP_NAMES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getStartStepNames() { + return startStepNames; + } + + public void setStartStepNames(List startStepNames) { + this.startStepNames = startStepNames; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return SlackTriggerWrapper + */ + @JsonAnySetter + public SlackTriggerWrapper putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this SlackTriggerWrapper object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SlackTriggerWrapper slackTriggerWrapper = (SlackTriggerWrapper) o; + return Objects.equals(this.slackTrigger, slackTriggerWrapper.slackTrigger) + && Objects.equals(this.startStepNames, slackTriggerWrapper.startStepNames) + && Objects.equals(this.additionalProperties, slackTriggerWrapper.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(slackTrigger, startStepNames, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SlackTriggerWrapper {\n"); + sb.append(" slackTrigger: ").append(toIndentedString(slackTrigger)).append("\n"); + sb.append(" startStepNames: ").append(toIndentedString(startStepNames)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/Spec.java b/src/main/java/com/datadog/api/client/v2/model/Spec.java new file mode 100644 index 00000000000..180071daca6 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/Spec.java @@ -0,0 +1,362 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** The spec defines what the workflow does. */ +@JsonPropertyOrder({ + Spec.JSON_PROPERTY_ANNOTATIONS, + Spec.JSON_PROPERTY_CONNECTION_ENVS, + Spec.JSON_PROPERTY_HANDLE, + Spec.JSON_PROPERTY_INPUT_SCHEMA, + Spec.JSON_PROPERTY_OUTPUT_SCHEMA, + Spec.JSON_PROPERTY_STEPS, + Spec.JSON_PROPERTY_TRIGGERS +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class Spec { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ANNOTATIONS = "annotations"; + private List annotations = null; + + public static final String JSON_PROPERTY_CONNECTION_ENVS = "connectionEnvs"; + private List connectionEnvs = null; + + public static final String JSON_PROPERTY_HANDLE = "handle"; + private String handle; + + public static final String JSON_PROPERTY_INPUT_SCHEMA = "inputSchema"; + private InputSchema inputSchema; + + public static final String JSON_PROPERTY_OUTPUT_SCHEMA = "outputSchema"; + private OutputSchema outputSchema; + + public static final String JSON_PROPERTY_STEPS = "steps"; + private List steps = null; + + public static final String JSON_PROPERTY_TRIGGERS = "triggers"; + private List triggers = null; + + public Spec annotations(List annotations) { + this.annotations = annotations; + for (Annotation item : annotations) { + this.unparsed |= item.unparsed; + } + return this; + } + + public Spec addAnnotationsItem(Annotation annotationsItem) { + if (this.annotations == null) { + this.annotations = new ArrayList<>(); + } + this.annotations.add(annotationsItem); + this.unparsed |= annotationsItem.unparsed; + return this; + } + + /** + * A list of annotations used in the workflow. These are like sticky notes for your workflow! + * + * @return annotations + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ANNOTATIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getAnnotations() { + return annotations; + } + + public void setAnnotations(List annotations) { + this.annotations = annotations; + } + + public Spec connectionEnvs(List connectionEnvs) { + this.connectionEnvs = connectionEnvs; + for (ConnectionEnv item : connectionEnvs) { + this.unparsed |= item.unparsed; + } + return this; + } + + public Spec addConnectionEnvsItem(ConnectionEnv connectionEnvsItem) { + if (this.connectionEnvs == null) { + this.connectionEnvs = new ArrayList<>(); + } + this.connectionEnvs.add(connectionEnvsItem); + this.unparsed |= connectionEnvsItem.unparsed; + return this; + } + + /** + * A list of connections or connection groups used in the workflow. + * + * @return connectionEnvs + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CONNECTION_ENVS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getConnectionEnvs() { + return connectionEnvs; + } + + public void setConnectionEnvs(List connectionEnvs) { + this.connectionEnvs = connectionEnvs; + } + + public Spec handle(String handle) { + this.handle = handle; + return this; + } + + /** + * Unique identifier used to trigger workflows automatically in Datadog. + * + * @return handle + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_HANDLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getHandle() { + return handle; + } + + public void setHandle(String handle) { + this.handle = handle; + } + + public Spec inputSchema(InputSchema inputSchema) { + this.inputSchema = inputSchema; + this.unparsed |= inputSchema.unparsed; + return this; + } + + /** + * A list of input parameters for the workflow. These can be used as dynamic runtime values in + * your workflow. + * + * @return inputSchema + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INPUT_SCHEMA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public InputSchema getInputSchema() { + return inputSchema; + } + + public void setInputSchema(InputSchema inputSchema) { + this.inputSchema = inputSchema; + } + + public Spec outputSchema(OutputSchema outputSchema) { + this.outputSchema = outputSchema; + this.unparsed |= outputSchema.unparsed; + return this; + } + + /** + * A list of output parameters for the workflow. + * + * @return outputSchema + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_OUTPUT_SCHEMA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OutputSchema getOutputSchema() { + return outputSchema; + } + + public void setOutputSchema(OutputSchema outputSchema) { + this.outputSchema = outputSchema; + } + + public Spec steps(List steps) { + this.steps = steps; + for (Step item : steps) { + this.unparsed |= item.unparsed; + } + return this; + } + + public Spec addStepsItem(Step stepsItem) { + if (this.steps == null) { + this.steps = new ArrayList<>(); + } + this.steps.add(stepsItem); + this.unparsed |= stepsItem.unparsed; + return this; + } + + /** + * A Step is a sub-component of a workflow. Each Step performs an + * action. + * + * @return steps + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_STEPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getSteps() { + return steps; + } + + public void setSteps(List steps) { + this.steps = steps; + } + + public Spec triggers(List triggers) { + this.triggers = triggers; + for (Trigger item : triggers) { + this.unparsed |= item.unparsed; + } + return this; + } + + public Spec addTriggersItem(Trigger triggersItem) { + if (this.triggers == null) { + this.triggers = new ArrayList<>(); + } + this.triggers.add(triggersItem); + this.unparsed |= triggersItem.unparsed; + return this; + } + + /** + * The list of triggers that activate this workflow. At least one trigger is required, and each + * trigger type may appear at most once. + * + * @return triggers + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TRIGGERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getTriggers() { + return triggers; + } + + public void setTriggers(List triggers) { + this.triggers = triggers; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return Spec + */ + @JsonAnySetter + public Spec putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this Spec object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Spec spec = (Spec) o; + return Objects.equals(this.annotations, spec.annotations) + && Objects.equals(this.connectionEnvs, spec.connectionEnvs) + && Objects.equals(this.handle, spec.handle) + && Objects.equals(this.inputSchema, spec.inputSchema) + && Objects.equals(this.outputSchema, spec.outputSchema) + && Objects.equals(this.steps, spec.steps) + && Objects.equals(this.triggers, spec.triggers) + && Objects.equals(this.additionalProperties, spec.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + annotations, + connectionEnvs, + handle, + inputSchema, + outputSchema, + steps, + triggers, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Spec {\n"); + sb.append(" annotations: ").append(toIndentedString(annotations)).append("\n"); + sb.append(" connectionEnvs: ").append(toIndentedString(connectionEnvs)).append("\n"); + sb.append(" handle: ").append(toIndentedString(handle)).append("\n"); + sb.append(" inputSchema: ").append(toIndentedString(inputSchema)).append("\n"); + sb.append(" outputSchema: ").append(toIndentedString(outputSchema)).append("\n"); + sb.append(" steps: ").append(toIndentedString(steps)).append("\n"); + sb.append(" triggers: ").append(toIndentedString(triggers)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/Step.java b/src/main/java/com/datadog/api/client/v2/model/Step.java new file mode 100644 index 00000000000..a33165912cf --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/Step.java @@ -0,0 +1,413 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** A Step is a sub-component of a workflow. Each Step performs an action. */ +@JsonPropertyOrder({ + Step.JSON_PROPERTY_ACTION_ID, + Step.JSON_PROPERTY_COMPLETION_GATE, + Step.JSON_PROPERTY_CONNECTION_LABEL, + Step.JSON_PROPERTY_DISPLAY, + Step.JSON_PROPERTY_ERROR_HANDLERS, + Step.JSON_PROPERTY_NAME, + Step.JSON_PROPERTY_OUTBOUND_EDGES, + Step.JSON_PROPERTY_PARAMETERS, + Step.JSON_PROPERTY_READINESS_GATE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class Step { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ACTION_ID = "actionId"; + private String actionId; + + public static final String JSON_PROPERTY_COMPLETION_GATE = "completionGate"; + private CompletionGate completionGate; + + public static final String JSON_PROPERTY_CONNECTION_LABEL = "connectionLabel"; + private String connectionLabel; + + public static final String JSON_PROPERTY_DISPLAY = "display"; + private StepDisplay display; + + public static final String JSON_PROPERTY_ERROR_HANDLERS = "errorHandlers"; + private List errorHandlers = null; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_OUTBOUND_EDGES = "outboundEdges"; + private List outboundEdges = null; + + public static final String JSON_PROPERTY_PARAMETERS = "parameters"; + private List parameters = null; + + public static final String JSON_PROPERTY_READINESS_GATE = "readinessGate"; + private ReadinessGate readinessGate; + + public Step() {} + + @JsonCreator + public Step( + @JsonProperty(required = true, value = JSON_PROPERTY_ACTION_ID) String actionId, + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name) { + this.actionId = actionId; + this.name = name; + } + + public Step actionId(String actionId) { + this.actionId = actionId; + return this; + } + + /** + * The unique identifier of an action. + * + * @return actionId + */ + @JsonProperty(JSON_PROPERTY_ACTION_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getActionId() { + return actionId; + } + + public void setActionId(String actionId) { + this.actionId = actionId; + } + + public Step completionGate(CompletionGate completionGate) { + this.completionGate = completionGate; + this.unparsed |= completionGate.unparsed; + return this; + } + + /** + * Used to create conditions before running subsequent actions. + * + * @return completionGate + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COMPLETION_GATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CompletionGate getCompletionGate() { + return completionGate; + } + + public void setCompletionGate(CompletionGate completionGate) { + this.completionGate = completionGate; + } + + public Step connectionLabel(String connectionLabel) { + this.connectionLabel = connectionLabel; + return this; + } + + /** + * The unique identifier of a connection defined in the spec. + * + * @return connectionLabel + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CONNECTION_LABEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getConnectionLabel() { + return connectionLabel; + } + + public void setConnectionLabel(String connectionLabel) { + this.connectionLabel = connectionLabel; + } + + public Step display(StepDisplay display) { + this.display = display; + this.unparsed |= display.unparsed; + return this; + } + + /** + * The definition of StepDisplay object. + * + * @return display + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DISPLAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public StepDisplay getDisplay() { + return display; + } + + public void setDisplay(StepDisplay display) { + this.display = display; + } + + public Step errorHandlers(List errorHandlers) { + this.errorHandlers = errorHandlers; + for (ErrorHandler item : errorHandlers) { + this.unparsed |= item.unparsed; + } + return this; + } + + public Step addErrorHandlersItem(ErrorHandler errorHandlersItem) { + if (this.errorHandlers == null) { + this.errorHandlers = new ArrayList<>(); + } + this.errorHandlers.add(errorHandlersItem); + this.unparsed |= errorHandlersItem.unparsed; + return this; + } + + /** + * The Step errorHandlers. + * + * @return errorHandlers + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ERROR_HANDLERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getErrorHandlers() { + return errorHandlers; + } + + public void setErrorHandlers(List errorHandlers) { + this.errorHandlers = errorHandlers; + } + + public Step name(String name) { + this.name = name; + return this; + } + + /** + * Name of the step. + * + * @return name + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Step outboundEdges(List outboundEdges) { + this.outboundEdges = outboundEdges; + for (OutboundEdge item : outboundEdges) { + this.unparsed |= item.unparsed; + } + return this; + } + + public Step addOutboundEdgesItem(OutboundEdge outboundEdgesItem) { + if (this.outboundEdges == null) { + this.outboundEdges = new ArrayList<>(); + } + this.outboundEdges.add(outboundEdgesItem); + this.unparsed |= outboundEdgesItem.unparsed; + return this; + } + + /** + * A list of subsequent actions to run. + * + * @return outboundEdges + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_OUTBOUND_EDGES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getOutboundEdges() { + return outboundEdges; + } + + public void setOutboundEdges(List outboundEdges) { + this.outboundEdges = outboundEdges; + } + + public Step parameters(List parameters) { + this.parameters = parameters; + for (Parameter item : parameters) { + this.unparsed |= item.unparsed; + } + return this; + } + + public Step addParametersItem(Parameter parametersItem) { + if (this.parameters == null) { + this.parameters = new ArrayList<>(); + } + this.parameters.add(parametersItem); + this.unparsed |= parametersItem.unparsed; + return this; + } + + /** + * A list of inputs for an action. + * + * @return parameters + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PARAMETERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getParameters() { + return parameters; + } + + public void setParameters(List parameters) { + this.parameters = parameters; + } + + public Step readinessGate(ReadinessGate readinessGate) { + this.readinessGate = readinessGate; + this.unparsed |= readinessGate.unparsed; + return this; + } + + /** + * Used to merge multiple branches into a single branch. + * + * @return readinessGate + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_READINESS_GATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ReadinessGate getReadinessGate() { + return readinessGate; + } + + public void setReadinessGate(ReadinessGate readinessGate) { + this.readinessGate = readinessGate; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return Step + */ + @JsonAnySetter + public Step putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this Step object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Step step = (Step) o; + return Objects.equals(this.actionId, step.actionId) + && Objects.equals(this.completionGate, step.completionGate) + && Objects.equals(this.connectionLabel, step.connectionLabel) + && Objects.equals(this.display, step.display) + && Objects.equals(this.errorHandlers, step.errorHandlers) + && Objects.equals(this.name, step.name) + && Objects.equals(this.outboundEdges, step.outboundEdges) + && Objects.equals(this.parameters, step.parameters) + && Objects.equals(this.readinessGate, step.readinessGate) + && Objects.equals(this.additionalProperties, step.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + actionId, + completionGate, + connectionLabel, + display, + errorHandlers, + name, + outboundEdges, + parameters, + readinessGate, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Step {\n"); + sb.append(" actionId: ").append(toIndentedString(actionId)).append("\n"); + sb.append(" completionGate: ").append(toIndentedString(completionGate)).append("\n"); + sb.append(" connectionLabel: ").append(toIndentedString(connectionLabel)).append("\n"); + sb.append(" display: ").append(toIndentedString(display)).append("\n"); + sb.append(" errorHandlers: ").append(toIndentedString(errorHandlers)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" outboundEdges: ").append(toIndentedString(outboundEdges)).append("\n"); + sb.append(" parameters: ").append(toIndentedString(parameters)).append("\n"); + sb.append(" readinessGate: ").append(toIndentedString(readinessGate)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/StepDisplay.java b/src/main/java/com/datadog/api/client/v2/model/StepDisplay.java new file mode 100644 index 00000000000..60f3796d827 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/StepDisplay.java @@ -0,0 +1,136 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** The definition of StepDisplay object. */ +@JsonPropertyOrder({StepDisplay.JSON_PROPERTY_BOUNDS}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class StepDisplay { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_BOUNDS = "bounds"; + private StepDisplayBounds bounds; + + public StepDisplay bounds(StepDisplayBounds bounds) { + this.bounds = bounds; + this.unparsed |= bounds.unparsed; + return this; + } + + /** + * The definition of StepDisplayBounds object. + * + * @return bounds + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_BOUNDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public StepDisplayBounds getBounds() { + return bounds; + } + + public void setBounds(StepDisplayBounds bounds) { + this.bounds = bounds; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return StepDisplay + */ + @JsonAnySetter + public StepDisplay putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this StepDisplay object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StepDisplay stepDisplay = (StepDisplay) o; + return Objects.equals(this.bounds, stepDisplay.bounds) + && Objects.equals(this.additionalProperties, stepDisplay.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(bounds, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StepDisplay {\n"); + sb.append(" bounds: ").append(toIndentedString(bounds)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/StepDisplayBounds.java b/src/main/java/com/datadog/api/client/v2/model/StepDisplayBounds.java new file mode 100644 index 00000000000..c015e89d664 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/StepDisplayBounds.java @@ -0,0 +1,161 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** The definition of StepDisplayBounds object. */ +@JsonPropertyOrder({StepDisplayBounds.JSON_PROPERTY_X, StepDisplayBounds.JSON_PROPERTY_Y}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class StepDisplayBounds { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_X = "x"; + private Double x; + + public static final String JSON_PROPERTY_Y = "y"; + private Double y; + + public StepDisplayBounds x(Double x) { + this.x = x; + return this; + } + + /** + * The bounds x. + * + * @return x + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_X) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getX() { + return x; + } + + public void setX(Double x) { + this.x = x; + } + + public StepDisplayBounds y(Double y) { + this.y = y; + return this; + } + + /** + * The bounds y. + * + * @return y + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_Y) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getY() { + return y; + } + + public void setY(Double y) { + this.y = y; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return StepDisplayBounds + */ + @JsonAnySetter + public StepDisplayBounds putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this StepDisplayBounds object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StepDisplayBounds stepDisplayBounds = (StepDisplayBounds) o; + return Objects.equals(this.x, stepDisplayBounds.x) + && Objects.equals(this.y, stepDisplayBounds.y) + && Objects.equals(this.additionalProperties, stepDisplayBounds.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(x, y, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StepDisplayBounds {\n"); + sb.append(" x: ").append(toIndentedString(x)).append("\n"); + sb.append(" y: ").append(toIndentedString(y)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/Trigger.java b/src/main/java/com/datadog/api/client/v2/model/Trigger.java new file mode 100644 index 00000000000..2123b65d2f1 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/Trigger.java @@ -0,0 +1,944 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.AbstractOpenApiSchema; +import com.datadog.api.client.JSON; +import com.datadog.api.client.UnparsedObject; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.JsonToken; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonMappingException; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.MapperFeature; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import jakarta.ws.rs.core.GenericType; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.logging.Level; +import java.util.logging.Logger; + +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +@JsonDeserialize(using = Trigger.TriggerDeserializer.class) +@JsonSerialize(using = Trigger.TriggerSerializer.class) +public class Trigger extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(Trigger.class.getName()); + + @JsonIgnore public boolean unparsed = false; + + public static class TriggerSerializer extends StdSerializer { + public TriggerSerializer(Class t) { + super(t); + } + + public TriggerSerializer() { + this(null); + } + + @Override + public void serialize(Trigger value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.getActualInstance()); + } + } + + public static class TriggerDeserializer extends StdDeserializer { + public TriggerDeserializer() { + this(Trigger.class); + } + + public TriggerDeserializer(Class vc) { + super(vc); + } + + @Override + public Trigger deserialize(JsonParser jp, DeserializationContext ctxt) + throws IOException, JsonProcessingException { + JsonNode tree = jp.readValueAsTree(); + Object deserialized = null; + Object tmp = null; + boolean typeCoercion = ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS); + int match = 0; + JsonToken token = tree.traverse(jp.getCodec()).nextToken(); + // deserialize APITriggerWrapper + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (APITriggerWrapper.class.equals(Integer.class) + || APITriggerWrapper.class.equals(Long.class) + || APITriggerWrapper.class.equals(Float.class) + || APITriggerWrapper.class.equals(Double.class) + || APITriggerWrapper.class.equals(Boolean.class) + || APITriggerWrapper.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((APITriggerWrapper.class.equals(Integer.class) + || APITriggerWrapper.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((APITriggerWrapper.class.equals(Float.class) + || APITriggerWrapper.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (APITriggerWrapper.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (APITriggerWrapper.class.equals(String.class) && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = tree.traverse(jp.getCodec()).readValueAs(APITriggerWrapper.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + if (!((APITriggerWrapper) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log(Level.FINER, "Input data matches schema 'APITriggerWrapper'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'APITriggerWrapper'", e); + } + + // deserialize AppTriggerWrapper + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (AppTriggerWrapper.class.equals(Integer.class) + || AppTriggerWrapper.class.equals(Long.class) + || AppTriggerWrapper.class.equals(Float.class) + || AppTriggerWrapper.class.equals(Double.class) + || AppTriggerWrapper.class.equals(Boolean.class) + || AppTriggerWrapper.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((AppTriggerWrapper.class.equals(Integer.class) + || AppTriggerWrapper.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((AppTriggerWrapper.class.equals(Float.class) + || AppTriggerWrapper.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (AppTriggerWrapper.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (AppTriggerWrapper.class.equals(String.class) && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = tree.traverse(jp.getCodec()).readValueAs(AppTriggerWrapper.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + if (!((AppTriggerWrapper) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log(Level.FINER, "Input data matches schema 'AppTriggerWrapper'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'AppTriggerWrapper'", e); + } + + // deserialize CaseTriggerWrapper + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (CaseTriggerWrapper.class.equals(Integer.class) + || CaseTriggerWrapper.class.equals(Long.class) + || CaseTriggerWrapper.class.equals(Float.class) + || CaseTriggerWrapper.class.equals(Double.class) + || CaseTriggerWrapper.class.equals(Boolean.class) + || CaseTriggerWrapper.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((CaseTriggerWrapper.class.equals(Integer.class) + || CaseTriggerWrapper.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((CaseTriggerWrapper.class.equals(Float.class) + || CaseTriggerWrapper.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (CaseTriggerWrapper.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (CaseTriggerWrapper.class.equals(String.class) && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = tree.traverse(jp.getCodec()).readValueAs(CaseTriggerWrapper.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + if (!((CaseTriggerWrapper) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log(Level.FINER, "Input data matches schema 'CaseTriggerWrapper'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'CaseTriggerWrapper'", e); + } + + // deserialize ChangeEventTriggerWrapper + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (ChangeEventTriggerWrapper.class.equals(Integer.class) + || ChangeEventTriggerWrapper.class.equals(Long.class) + || ChangeEventTriggerWrapper.class.equals(Float.class) + || ChangeEventTriggerWrapper.class.equals(Double.class) + || ChangeEventTriggerWrapper.class.equals(Boolean.class) + || ChangeEventTriggerWrapper.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((ChangeEventTriggerWrapper.class.equals(Integer.class) + || ChangeEventTriggerWrapper.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((ChangeEventTriggerWrapper.class.equals(Float.class) + || ChangeEventTriggerWrapper.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (ChangeEventTriggerWrapper.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (ChangeEventTriggerWrapper.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = tree.traverse(jp.getCodec()).readValueAs(ChangeEventTriggerWrapper.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + if (!((ChangeEventTriggerWrapper) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log(Level.FINER, "Input data matches schema 'ChangeEventTriggerWrapper'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'ChangeEventTriggerWrapper'", e); + } + + // deserialize DashboardTriggerWrapper + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (DashboardTriggerWrapper.class.equals(Integer.class) + || DashboardTriggerWrapper.class.equals(Long.class) + || DashboardTriggerWrapper.class.equals(Float.class) + || DashboardTriggerWrapper.class.equals(Double.class) + || DashboardTriggerWrapper.class.equals(Boolean.class) + || DashboardTriggerWrapper.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((DashboardTriggerWrapper.class.equals(Integer.class) + || DashboardTriggerWrapper.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((DashboardTriggerWrapper.class.equals(Float.class) + || DashboardTriggerWrapper.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (DashboardTriggerWrapper.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (DashboardTriggerWrapper.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = tree.traverse(jp.getCodec()).readValueAs(DashboardTriggerWrapper.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + if (!((DashboardTriggerWrapper) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log(Level.FINER, "Input data matches schema 'DashboardTriggerWrapper'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'DashboardTriggerWrapper'", e); + } + + // deserialize GithubWebhookTriggerWrapper + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (GithubWebhookTriggerWrapper.class.equals(Integer.class) + || GithubWebhookTriggerWrapper.class.equals(Long.class) + || GithubWebhookTriggerWrapper.class.equals(Float.class) + || GithubWebhookTriggerWrapper.class.equals(Double.class) + || GithubWebhookTriggerWrapper.class.equals(Boolean.class) + || GithubWebhookTriggerWrapper.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((GithubWebhookTriggerWrapper.class.equals(Integer.class) + || GithubWebhookTriggerWrapper.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((GithubWebhookTriggerWrapper.class.equals(Float.class) + || GithubWebhookTriggerWrapper.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (GithubWebhookTriggerWrapper.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (GithubWebhookTriggerWrapper.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = tree.traverse(jp.getCodec()).readValueAs(GithubWebhookTriggerWrapper.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + if (!((GithubWebhookTriggerWrapper) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log(Level.FINER, "Input data matches schema 'GithubWebhookTriggerWrapper'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'GithubWebhookTriggerWrapper'", e); + } + + // deserialize IncidentTriggerWrapper + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (IncidentTriggerWrapper.class.equals(Integer.class) + || IncidentTriggerWrapper.class.equals(Long.class) + || IncidentTriggerWrapper.class.equals(Float.class) + || IncidentTriggerWrapper.class.equals(Double.class) + || IncidentTriggerWrapper.class.equals(Boolean.class) + || IncidentTriggerWrapper.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((IncidentTriggerWrapper.class.equals(Integer.class) + || IncidentTriggerWrapper.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((IncidentTriggerWrapper.class.equals(Float.class) + || IncidentTriggerWrapper.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (IncidentTriggerWrapper.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (IncidentTriggerWrapper.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = tree.traverse(jp.getCodec()).readValueAs(IncidentTriggerWrapper.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + if (!((IncidentTriggerWrapper) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log(Level.FINER, "Input data matches schema 'IncidentTriggerWrapper'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'IncidentTriggerWrapper'", e); + } + + // deserialize MonitorTriggerWrapper + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (MonitorTriggerWrapper.class.equals(Integer.class) + || MonitorTriggerWrapper.class.equals(Long.class) + || MonitorTriggerWrapper.class.equals(Float.class) + || MonitorTriggerWrapper.class.equals(Double.class) + || MonitorTriggerWrapper.class.equals(Boolean.class) + || MonitorTriggerWrapper.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((MonitorTriggerWrapper.class.equals(Integer.class) + || MonitorTriggerWrapper.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((MonitorTriggerWrapper.class.equals(Float.class) + || MonitorTriggerWrapper.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (MonitorTriggerWrapper.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (MonitorTriggerWrapper.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = tree.traverse(jp.getCodec()).readValueAs(MonitorTriggerWrapper.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + if (!((MonitorTriggerWrapper) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log(Level.FINER, "Input data matches schema 'MonitorTriggerWrapper'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'MonitorTriggerWrapper'", e); + } + + // deserialize ScheduleTriggerWrapper + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (ScheduleTriggerWrapper.class.equals(Integer.class) + || ScheduleTriggerWrapper.class.equals(Long.class) + || ScheduleTriggerWrapper.class.equals(Float.class) + || ScheduleTriggerWrapper.class.equals(Double.class) + || ScheduleTriggerWrapper.class.equals(Boolean.class) + || ScheduleTriggerWrapper.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((ScheduleTriggerWrapper.class.equals(Integer.class) + || ScheduleTriggerWrapper.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((ScheduleTriggerWrapper.class.equals(Float.class) + || ScheduleTriggerWrapper.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (ScheduleTriggerWrapper.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (ScheduleTriggerWrapper.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = tree.traverse(jp.getCodec()).readValueAs(ScheduleTriggerWrapper.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + if (!((ScheduleTriggerWrapper) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log(Level.FINER, "Input data matches schema 'ScheduleTriggerWrapper'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'ScheduleTriggerWrapper'", e); + } + + // deserialize SecurityTriggerWrapper + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (SecurityTriggerWrapper.class.equals(Integer.class) + || SecurityTriggerWrapper.class.equals(Long.class) + || SecurityTriggerWrapper.class.equals(Float.class) + || SecurityTriggerWrapper.class.equals(Double.class) + || SecurityTriggerWrapper.class.equals(Boolean.class) + || SecurityTriggerWrapper.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((SecurityTriggerWrapper.class.equals(Integer.class) + || SecurityTriggerWrapper.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((SecurityTriggerWrapper.class.equals(Float.class) + || SecurityTriggerWrapper.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (SecurityTriggerWrapper.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (SecurityTriggerWrapper.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = tree.traverse(jp.getCodec()).readValueAs(SecurityTriggerWrapper.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + if (!((SecurityTriggerWrapper) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log(Level.FINER, "Input data matches schema 'SecurityTriggerWrapper'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'SecurityTriggerWrapper'", e); + } + + // deserialize SlackTriggerWrapper + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (SlackTriggerWrapper.class.equals(Integer.class) + || SlackTriggerWrapper.class.equals(Long.class) + || SlackTriggerWrapper.class.equals(Float.class) + || SlackTriggerWrapper.class.equals(Double.class) + || SlackTriggerWrapper.class.equals(Boolean.class) + || SlackTriggerWrapper.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((SlackTriggerWrapper.class.equals(Integer.class) + || SlackTriggerWrapper.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((SlackTriggerWrapper.class.equals(Float.class) + || SlackTriggerWrapper.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (SlackTriggerWrapper.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (SlackTriggerWrapper.class.equals(String.class) && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = tree.traverse(jp.getCodec()).readValueAs(SlackTriggerWrapper.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + if (!((SlackTriggerWrapper) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log(Level.FINER, "Input data matches schema 'SlackTriggerWrapper'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'SlackTriggerWrapper'", e); + } + + // deserialize WorkflowTriggerWrapper + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (WorkflowTriggerWrapper.class.equals(Integer.class) + || WorkflowTriggerWrapper.class.equals(Long.class) + || WorkflowTriggerWrapper.class.equals(Float.class) + || WorkflowTriggerWrapper.class.equals(Double.class) + || WorkflowTriggerWrapper.class.equals(Boolean.class) + || WorkflowTriggerWrapper.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((WorkflowTriggerWrapper.class.equals(Integer.class) + || WorkflowTriggerWrapper.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((WorkflowTriggerWrapper.class.equals(Float.class) + || WorkflowTriggerWrapper.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (WorkflowTriggerWrapper.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (WorkflowTriggerWrapper.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = tree.traverse(jp.getCodec()).readValueAs(WorkflowTriggerWrapper.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + if (!((WorkflowTriggerWrapper) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log(Level.FINER, "Input data matches schema 'WorkflowTriggerWrapper'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'WorkflowTriggerWrapper'", e); + } + + Trigger ret = new Trigger(); + if (match == 1) { + ret.setActualInstance(deserialized); + } else { + Map res = + new ObjectMapper() + .readValue( + tree.traverse(jp.getCodec()).readValueAsTree().toString(), + new TypeReference>() {}); + ret.setActualInstance(new UnparsedObject(res)); + } + return ret; + } + + /** Handle deserialization of the 'null' value. */ + @Override + public Trigger getNullValue(DeserializationContext ctxt) throws JsonMappingException { + throw new JsonMappingException(ctxt.getParser(), "Trigger cannot be null"); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public Trigger() { + super("oneOf", Boolean.FALSE); + } + + public Trigger(APITriggerWrapper o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public Trigger(AppTriggerWrapper o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public Trigger(CaseTriggerWrapper o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public Trigger(ChangeEventTriggerWrapper o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public Trigger(DashboardTriggerWrapper o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public Trigger(GithubWebhookTriggerWrapper o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public Trigger(IncidentTriggerWrapper o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public Trigger(MonitorTriggerWrapper o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public Trigger(ScheduleTriggerWrapper o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public Trigger(SecurityTriggerWrapper o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public Trigger(SlackTriggerWrapper o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public Trigger(WorkflowTriggerWrapper o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("APITriggerWrapper", new GenericType() {}); + schemas.put("AppTriggerWrapper", new GenericType() {}); + schemas.put("CaseTriggerWrapper", new GenericType() {}); + schemas.put("ChangeEventTriggerWrapper", new GenericType() {}); + schemas.put("DashboardTriggerWrapper", new GenericType() {}); + schemas.put("GithubWebhookTriggerWrapper", new GenericType() {}); + schemas.put("IncidentTriggerWrapper", new GenericType() {}); + schemas.put("MonitorTriggerWrapper", new GenericType() {}); + schemas.put("ScheduleTriggerWrapper", new GenericType() {}); + schemas.put("SecurityTriggerWrapper", new GenericType() {}); + schemas.put("SlackTriggerWrapper", new GenericType() {}); + schemas.put("WorkflowTriggerWrapper", new GenericType() {}); + JSON.registerDescendants(Trigger.class, Collections.unmodifiableMap(schemas)); + } + + @Override + public Map getSchemas() { + return Trigger.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check the instance parameter is valid + * against the oneOf child schemas: APITriggerWrapper, AppTriggerWrapper, CaseTriggerWrapper, + * ChangeEventTriggerWrapper, DashboardTriggerWrapper, GithubWebhookTriggerWrapper, + * IncidentTriggerWrapper, MonitorTriggerWrapper, ScheduleTriggerWrapper, SecurityTriggerWrapper, + * SlackTriggerWrapper, WorkflowTriggerWrapper + * + *

It could be an instance of the 'oneOf' schemas. The oneOf child schemas may themselves be a + * composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (JSON.isInstanceOf(APITriggerWrapper.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + if (JSON.isInstanceOf(AppTriggerWrapper.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + if (JSON.isInstanceOf(CaseTriggerWrapper.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + if (JSON.isInstanceOf(ChangeEventTriggerWrapper.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + if (JSON.isInstanceOf(DashboardTriggerWrapper.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + if (JSON.isInstanceOf(GithubWebhookTriggerWrapper.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + if (JSON.isInstanceOf(IncidentTriggerWrapper.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + if (JSON.isInstanceOf(MonitorTriggerWrapper.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + if (JSON.isInstanceOf(ScheduleTriggerWrapper.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + if (JSON.isInstanceOf(SecurityTriggerWrapper.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + if (JSON.isInstanceOf(SlackTriggerWrapper.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + if (JSON.isInstanceOf(WorkflowTriggerWrapper.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(UnparsedObject.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + throw new RuntimeException( + "Invalid instance type. Must be APITriggerWrapper, AppTriggerWrapper, CaseTriggerWrapper," + + " ChangeEventTriggerWrapper, DashboardTriggerWrapper, GithubWebhookTriggerWrapper," + + " IncidentTriggerWrapper, MonitorTriggerWrapper, ScheduleTriggerWrapper," + + " SecurityTriggerWrapper, SlackTriggerWrapper, WorkflowTriggerWrapper"); + } + + /** + * Get the actual instance, which can be the following: APITriggerWrapper, AppTriggerWrapper, + * CaseTriggerWrapper, ChangeEventTriggerWrapper, DashboardTriggerWrapper, + * GithubWebhookTriggerWrapper, IncidentTriggerWrapper, MonitorTriggerWrapper, + * ScheduleTriggerWrapper, SecurityTriggerWrapper, SlackTriggerWrapper, WorkflowTriggerWrapper + * + * @return The actual instance (APITriggerWrapper, AppTriggerWrapper, CaseTriggerWrapper, + * ChangeEventTriggerWrapper, DashboardTriggerWrapper, GithubWebhookTriggerWrapper, + * IncidentTriggerWrapper, MonitorTriggerWrapper, ScheduleTriggerWrapper, + * SecurityTriggerWrapper, SlackTriggerWrapper, WorkflowTriggerWrapper) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `APITriggerWrapper`. If the actual instance is not + * `APITriggerWrapper`, the ClassCastException will be thrown. + * + * @return The actual instance of `APITriggerWrapper` + * @throws ClassCastException if the instance is not `APITriggerWrapper` + */ + public APITriggerWrapper getAPITriggerWrapper() throws ClassCastException { + return (APITriggerWrapper) super.getActualInstance(); + } + + /** + * Get the actual instance of `AppTriggerWrapper`. If the actual instance is not + * `AppTriggerWrapper`, the ClassCastException will be thrown. + * + * @return The actual instance of `AppTriggerWrapper` + * @throws ClassCastException if the instance is not `AppTriggerWrapper` + */ + public AppTriggerWrapper getAppTriggerWrapper() throws ClassCastException { + return (AppTriggerWrapper) super.getActualInstance(); + } + + /** + * Get the actual instance of `CaseTriggerWrapper`. If the actual instance is not + * `CaseTriggerWrapper`, the ClassCastException will be thrown. + * + * @return The actual instance of `CaseTriggerWrapper` + * @throws ClassCastException if the instance is not `CaseTriggerWrapper` + */ + public CaseTriggerWrapper getCaseTriggerWrapper() throws ClassCastException { + return (CaseTriggerWrapper) super.getActualInstance(); + } + + /** + * Get the actual instance of `ChangeEventTriggerWrapper`. If the actual instance is not + * `ChangeEventTriggerWrapper`, the ClassCastException will be thrown. + * + * @return The actual instance of `ChangeEventTriggerWrapper` + * @throws ClassCastException if the instance is not `ChangeEventTriggerWrapper` + */ + public ChangeEventTriggerWrapper getChangeEventTriggerWrapper() throws ClassCastException { + return (ChangeEventTriggerWrapper) super.getActualInstance(); + } + + /** + * Get the actual instance of `DashboardTriggerWrapper`. If the actual instance is not + * `DashboardTriggerWrapper`, the ClassCastException will be thrown. + * + * @return The actual instance of `DashboardTriggerWrapper` + * @throws ClassCastException if the instance is not `DashboardTriggerWrapper` + */ + public DashboardTriggerWrapper getDashboardTriggerWrapper() throws ClassCastException { + return (DashboardTriggerWrapper) super.getActualInstance(); + } + + /** + * Get the actual instance of `GithubWebhookTriggerWrapper`. If the actual instance is not + * `GithubWebhookTriggerWrapper`, the ClassCastException will be thrown. + * + * @return The actual instance of `GithubWebhookTriggerWrapper` + * @throws ClassCastException if the instance is not `GithubWebhookTriggerWrapper` + */ + public GithubWebhookTriggerWrapper getGithubWebhookTriggerWrapper() throws ClassCastException { + return (GithubWebhookTriggerWrapper) super.getActualInstance(); + } + + /** + * Get the actual instance of `IncidentTriggerWrapper`. If the actual instance is not + * `IncidentTriggerWrapper`, the ClassCastException will be thrown. + * + * @return The actual instance of `IncidentTriggerWrapper` + * @throws ClassCastException if the instance is not `IncidentTriggerWrapper` + */ + public IncidentTriggerWrapper getIncidentTriggerWrapper() throws ClassCastException { + return (IncidentTriggerWrapper) super.getActualInstance(); + } + + /** + * Get the actual instance of `MonitorTriggerWrapper`. If the actual instance is not + * `MonitorTriggerWrapper`, the ClassCastException will be thrown. + * + * @return The actual instance of `MonitorTriggerWrapper` + * @throws ClassCastException if the instance is not `MonitorTriggerWrapper` + */ + public MonitorTriggerWrapper getMonitorTriggerWrapper() throws ClassCastException { + return (MonitorTriggerWrapper) super.getActualInstance(); + } + + /** + * Get the actual instance of `ScheduleTriggerWrapper`. If the actual instance is not + * `ScheduleTriggerWrapper`, the ClassCastException will be thrown. + * + * @return The actual instance of `ScheduleTriggerWrapper` + * @throws ClassCastException if the instance is not `ScheduleTriggerWrapper` + */ + public ScheduleTriggerWrapper getScheduleTriggerWrapper() throws ClassCastException { + return (ScheduleTriggerWrapper) super.getActualInstance(); + } + + /** + * Get the actual instance of `SecurityTriggerWrapper`. If the actual instance is not + * `SecurityTriggerWrapper`, the ClassCastException will be thrown. + * + * @return The actual instance of `SecurityTriggerWrapper` + * @throws ClassCastException if the instance is not `SecurityTriggerWrapper` + */ + public SecurityTriggerWrapper getSecurityTriggerWrapper() throws ClassCastException { + return (SecurityTriggerWrapper) super.getActualInstance(); + } + + /** + * Get the actual instance of `SlackTriggerWrapper`. If the actual instance is not + * `SlackTriggerWrapper`, the ClassCastException will be thrown. + * + * @return The actual instance of `SlackTriggerWrapper` + * @throws ClassCastException if the instance is not `SlackTriggerWrapper` + */ + public SlackTriggerWrapper getSlackTriggerWrapper() throws ClassCastException { + return (SlackTriggerWrapper) super.getActualInstance(); + } + + /** + * Get the actual instance of `WorkflowTriggerWrapper`. If the actual instance is not + * `WorkflowTriggerWrapper`, the ClassCastException will be thrown. + * + * @return The actual instance of `WorkflowTriggerWrapper` + * @throws ClassCastException if the instance is not `WorkflowTriggerWrapper` + */ + public WorkflowTriggerWrapper getWorkflowTriggerWrapper() throws ClassCastException { + return (WorkflowTriggerWrapper) super.getActualInstance(); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TriggerRateLimit.java b/src/main/java/com/datadog/api/client/v2/model/TriggerRateLimit.java new file mode 100644 index 00000000000..ec5a890d7bb --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TriggerRateLimit.java @@ -0,0 +1,162 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Defines a rate limit for a trigger. */ +@JsonPropertyOrder({TriggerRateLimit.JSON_PROPERTY_COUNT, TriggerRateLimit.JSON_PROPERTY_INTERVAL}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TriggerRateLimit { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_COUNT = "count"; + private Long count; + + public static final String JSON_PROPERTY_INTERVAL = "interval"; + private String interval; + + public TriggerRateLimit count(Long count) { + this.count = count; + return this; + } + + /** + * The TriggerRateLimit count. + * + * @return count + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getCount() { + return count; + } + + public void setCount(Long count) { + this.count = count; + } + + public TriggerRateLimit interval(String interval) { + this.interval = interval; + return this; + } + + /** + * The TriggerRateLimit interval. The expected format is the number of + * seconds ending with an s. For example, 1 day is 86400s + * + * @return interval + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INTERVAL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getInterval() { + return interval; + } + + public void setInterval(String interval) { + this.interval = interval; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return TriggerRateLimit + */ + @JsonAnySetter + public TriggerRateLimit putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this TriggerRateLimit object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TriggerRateLimit triggerRateLimit = (TriggerRateLimit) o; + return Objects.equals(this.count, triggerRateLimit.count) + && Objects.equals(this.interval, triggerRateLimit.interval) + && Objects.equals(this.additionalProperties, triggerRateLimit.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(count, interval, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TriggerRateLimit {\n"); + sb.append(" count: ").append(toIndentedString(count)).append("\n"); + sb.append(" interval: ").append(toIndentedString(interval)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/UpdateWorkflowRequest.java b/src/main/java/com/datadog/api/client/v2/model/UpdateWorkflowRequest.java new file mode 100644 index 00000000000..73141dc198f --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/UpdateWorkflowRequest.java @@ -0,0 +1,145 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** A request object for updating an existing workflow. */ +@JsonPropertyOrder({UpdateWorkflowRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class UpdateWorkflowRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private WorkflowDataUpdate data; + + public UpdateWorkflowRequest() {} + + @JsonCreator + public UpdateWorkflowRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) WorkflowDataUpdate data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public UpdateWorkflowRequest data(WorkflowDataUpdate data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data related to the workflow being updated. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public WorkflowDataUpdate getData() { + return data; + } + + public void setData(WorkflowDataUpdate data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return UpdateWorkflowRequest + */ + @JsonAnySetter + public UpdateWorkflowRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this UpdateWorkflowRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateWorkflowRequest updateWorkflowRequest = (UpdateWorkflowRequest) o; + return Objects.equals(this.data, updateWorkflowRequest.data) + && Objects.equals(this.additionalProperties, updateWorkflowRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateWorkflowRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/UpdateWorkflowResponse.java b/src/main/java/com/datadog/api/client/v2/model/UpdateWorkflowResponse.java new file mode 100644 index 00000000000..188b2038d28 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/UpdateWorkflowResponse.java @@ -0,0 +1,136 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** The response object after updating a workflow. */ +@JsonPropertyOrder({UpdateWorkflowResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class UpdateWorkflowResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private WorkflowDataUpdate data; + + public UpdateWorkflowResponse data(WorkflowDataUpdate data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data related to the workflow being updated. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public WorkflowDataUpdate getData() { + return data; + } + + public void setData(WorkflowDataUpdate data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return UpdateWorkflowResponse + */ + @JsonAnySetter + public UpdateWorkflowResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this UpdateWorkflowResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateWorkflowResponse updateWorkflowResponse = (UpdateWorkflowResponse) o; + return Objects.equals(this.data, updateWorkflowResponse.data) + && Objects.equals(this.additionalProperties, updateWorkflowResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateWorkflowResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/WorkflowData.java b/src/main/java/com/datadog/api/client/v2/model/WorkflowData.java new file mode 100644 index 00000000000..9968c12e785 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/WorkflowData.java @@ -0,0 +1,217 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Data related to the workflow. */ +@JsonPropertyOrder({ + WorkflowData.JSON_PROPERTY_ATTRIBUTES, + WorkflowData.JSON_PROPERTY_ID, + WorkflowData.JSON_PROPERTY_RELATIONSHIPS, + WorkflowData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class WorkflowData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private WorkflowDataAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_RELATIONSHIPS = "relationships"; + private WorkflowDataRelationships relationships; + + public static final String JSON_PROPERTY_TYPE = "type"; + private WorkflowDataType type; + + public WorkflowData() {} + + @JsonCreator + public WorkflowData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + WorkflowDataAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) WorkflowDataType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public WorkflowData attributes(WorkflowDataAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * The definition of WorkflowDataAttributes object. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public WorkflowDataAttributes getAttributes() { + return attributes; + } + + public void setAttributes(WorkflowDataAttributes attributes) { + this.attributes = attributes; + } + + /** + * The workflow identifier + * + * @return id + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + /** + * The definition of WorkflowDataRelationships object. + * + * @return relationships + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RELATIONSHIPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public WorkflowDataRelationships getRelationships() { + return relationships; + } + + public WorkflowData type(WorkflowDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The definition of WorkflowDataType object. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public WorkflowDataType getType() { + return type; + } + + public void setType(WorkflowDataType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return WorkflowData + */ + @JsonAnySetter + public WorkflowData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this WorkflowData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WorkflowData workflowData = (WorkflowData) o; + return Objects.equals(this.attributes, workflowData.attributes) + && Objects.equals(this.id, workflowData.id) + && Objects.equals(this.relationships, workflowData.relationships) + && Objects.equals(this.type, workflowData.type) + && Objects.equals(this.additionalProperties, workflowData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, relationships, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WorkflowData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" relationships: ").append(toIndentedString(relationships)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/WorkflowDataAttributes.java b/src/main/java/com/datadog/api/client/v2/model/WorkflowDataAttributes.java new file mode 100644 index 00000000000..54d7f05d7b1 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/WorkflowDataAttributes.java @@ -0,0 +1,342 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** The definition of WorkflowDataAttributes object. */ +@JsonPropertyOrder({ + WorkflowDataAttributes.JSON_PROPERTY_CREATED_AT, + WorkflowDataAttributes.JSON_PROPERTY_DESCRIPTION, + WorkflowDataAttributes.JSON_PROPERTY_NAME, + WorkflowDataAttributes.JSON_PROPERTY_PUBLISHED, + WorkflowDataAttributes.JSON_PROPERTY_SPEC, + WorkflowDataAttributes.JSON_PROPERTY_TAGS, + WorkflowDataAttributes.JSON_PROPERTY_UPDATED_AT, + WorkflowDataAttributes.JSON_PROPERTY_WEBHOOK_SECRET +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class WorkflowDataAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CREATED_AT = "createdAt"; + private OffsetDateTime createdAt; + + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private String description; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_PUBLISHED = "published"; + private Boolean published; + + public static final String JSON_PROPERTY_SPEC = "spec"; + private Spec spec; + + public static final String JSON_PROPERTY_TAGS = "tags"; + private List tags = null; + + public static final String JSON_PROPERTY_UPDATED_AT = "updatedAt"; + private OffsetDateTime updatedAt; + + public static final String JSON_PROPERTY_WEBHOOK_SECRET = "webhookSecret"; + private String webhookSecret; + + public WorkflowDataAttributes() {} + + @JsonCreator + public WorkflowDataAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name, + @JsonProperty(required = true, value = JSON_PROPERTY_SPEC) Spec spec) { + this.name = name; + this.spec = spec; + this.unparsed |= spec.unparsed; + } + + /** + * When the workflow was created. + * + * @return createdAt + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + public WorkflowDataAttributes description(String description) { + this.description = description; + return this; + } + + /** + * Description of the workflow. + * + * @return description + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public WorkflowDataAttributes name(String name) { + this.name = name; + return this; + } + + /** + * Name of the workflow. + * + * @return name + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public WorkflowDataAttributes published(Boolean published) { + this.published = published; + return this; + } + + /** + * Set the workflow to published or unpublished. Workflows in an unpublished state will only be + * executable via manual runs. Automatic triggers such as Schedule will not execute the workflow + * until it is published. + * + * @return published + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PUBLISHED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getPublished() { + return published; + } + + public void setPublished(Boolean published) { + this.published = published; + } + + public WorkflowDataAttributes spec(Spec spec) { + this.spec = spec; + this.unparsed |= spec.unparsed; + return this; + } + + /** + * The spec defines what the workflow does. + * + * @return spec + */ + @JsonProperty(JSON_PROPERTY_SPEC) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Spec getSpec() { + return spec; + } + + public void setSpec(Spec spec) { + this.spec = spec; + } + + public WorkflowDataAttributes tags(List tags) { + this.tags = tags; + return this; + } + + public WorkflowDataAttributes addTagsItem(String tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList<>(); + } + this.tags.add(tagsItem); + return this; + } + + /** + * Tags of the workflow. + * + * @return tags + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getTags() { + return tags; + } + + public void setTags(List tags) { + this.tags = tags; + } + + /** + * When the workflow was last updated. + * + * @return updatedAt + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UPDATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + public WorkflowDataAttributes webhookSecret(String webhookSecret) { + this.webhookSecret = webhookSecret; + return this; + } + + /** + * If a Webhook trigger is defined on this workflow, a webhookSecret is required and should be + * provided here. + * + * @return webhookSecret + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WEBHOOK_SECRET) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getWebhookSecret() { + return webhookSecret; + } + + public void setWebhookSecret(String webhookSecret) { + this.webhookSecret = webhookSecret; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return WorkflowDataAttributes + */ + @JsonAnySetter + public WorkflowDataAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this WorkflowDataAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WorkflowDataAttributes workflowDataAttributes = (WorkflowDataAttributes) o; + return Objects.equals(this.createdAt, workflowDataAttributes.createdAt) + && Objects.equals(this.description, workflowDataAttributes.description) + && Objects.equals(this.name, workflowDataAttributes.name) + && Objects.equals(this.published, workflowDataAttributes.published) + && Objects.equals(this.spec, workflowDataAttributes.spec) + && Objects.equals(this.tags, workflowDataAttributes.tags) + && Objects.equals(this.updatedAt, workflowDataAttributes.updatedAt) + && Objects.equals(this.webhookSecret, workflowDataAttributes.webhookSecret) + && Objects.equals(this.additionalProperties, workflowDataAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + createdAt, + description, + name, + published, + spec, + tags, + updatedAt, + webhookSecret, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WorkflowDataAttributes {\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" published: ").append(toIndentedString(published)).append("\n"); + sb.append(" spec: ").append(toIndentedString(spec)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" webhookSecret: ").append(toIndentedString(webhookSecret)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/WorkflowDataRelationships.java b/src/main/java/com/datadog/api/client/v2/model/WorkflowDataRelationships.java new file mode 100644 index 00000000000..845b35da591 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/WorkflowDataRelationships.java @@ -0,0 +1,167 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** The definition of WorkflowDataRelationships object. */ +@JsonPropertyOrder({ + WorkflowDataRelationships.JSON_PROPERTY_CREATOR, + WorkflowDataRelationships.JSON_PROPERTY_OWNER +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class WorkflowDataRelationships { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CREATOR = "creator"; + private WorkflowUserRelationship creator; + + public static final String JSON_PROPERTY_OWNER = "owner"; + private WorkflowUserRelationship owner; + + public WorkflowDataRelationships creator(WorkflowUserRelationship creator) { + this.creator = creator; + this.unparsed |= creator.unparsed; + return this; + } + + /** + * The definition of WorkflowUserRelationship object. + * + * @return creator + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CREATOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public WorkflowUserRelationship getCreator() { + return creator; + } + + public void setCreator(WorkflowUserRelationship creator) { + this.creator = creator; + } + + public WorkflowDataRelationships owner(WorkflowUserRelationship owner) { + this.owner = owner; + this.unparsed |= owner.unparsed; + return this; + } + + /** + * The definition of WorkflowUserRelationship object. + * + * @return owner + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_OWNER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public WorkflowUserRelationship getOwner() { + return owner; + } + + public void setOwner(WorkflowUserRelationship owner) { + this.owner = owner; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return WorkflowDataRelationships + */ + @JsonAnySetter + public WorkflowDataRelationships putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this WorkflowDataRelationships object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WorkflowDataRelationships workflowDataRelationships = (WorkflowDataRelationships) o; + return Objects.equals(this.creator, workflowDataRelationships.creator) + && Objects.equals(this.owner, workflowDataRelationships.owner) + && Objects.equals( + this.additionalProperties, workflowDataRelationships.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(creator, owner, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WorkflowDataRelationships {\n"); + sb.append(" creator: ").append(toIndentedString(creator)).append("\n"); + sb.append(" owner: ").append(toIndentedString(owner)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/WorkflowDataType.java b/src/main/java/com/datadog/api/client/v2/model/WorkflowDataType.java new file mode 100644 index 00000000000..0392931f9a2 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/WorkflowDataType.java @@ -0,0 +1,53 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** The definition of WorkflowDataType object. */ +@JsonSerialize(using = WorkflowDataType.WorkflowDataTypeSerializer.class) +public class WorkflowDataType extends ModelEnum { + + private static final Set allowedValues = new HashSet(Arrays.asList("workflows")); + + public static final WorkflowDataType WORKFLOWS = new WorkflowDataType("workflows"); + + WorkflowDataType(String value) { + super(value, allowedValues); + } + + public static class WorkflowDataTypeSerializer extends StdSerializer { + public WorkflowDataTypeSerializer(Class t) { + super(t); + } + + public WorkflowDataTypeSerializer() { + this(null); + } + + @Override + public void serialize(WorkflowDataType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static WorkflowDataType fromValue(String value) { + return new WorkflowDataType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/WorkflowDataUpdate.java b/src/main/java/com/datadog/api/client/v2/model/WorkflowDataUpdate.java new file mode 100644 index 00000000000..779d1bd1b29 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/WorkflowDataUpdate.java @@ -0,0 +1,226 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Data related to the workflow being updated. */ +@JsonPropertyOrder({ + WorkflowDataUpdate.JSON_PROPERTY_ATTRIBUTES, + WorkflowDataUpdate.JSON_PROPERTY_ID, + WorkflowDataUpdate.JSON_PROPERTY_RELATIONSHIPS, + WorkflowDataUpdate.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class WorkflowDataUpdate { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private WorkflowDataUpdateAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_RELATIONSHIPS = "relationships"; + private WorkflowDataRelationships relationships; + + public static final String JSON_PROPERTY_TYPE = "type"; + private WorkflowDataType type; + + public WorkflowDataUpdate() {} + + @JsonCreator + public WorkflowDataUpdate( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + WorkflowDataUpdateAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) WorkflowDataType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public WorkflowDataUpdate attributes(WorkflowDataUpdateAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * The definition of WorkflowDataUpdateAttributes object. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public WorkflowDataUpdateAttributes getAttributes() { + return attributes; + } + + public void setAttributes(WorkflowDataUpdateAttributes attributes) { + this.attributes = attributes; + } + + public WorkflowDataUpdate id(String id) { + this.id = id; + return this; + } + + /** + * The workflow identifier + * + * @return id + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + /** + * The definition of WorkflowDataRelationships object. + * + * @return relationships + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RELATIONSHIPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public WorkflowDataRelationships getRelationships() { + return relationships; + } + + public WorkflowDataUpdate type(WorkflowDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The definition of WorkflowDataType object. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public WorkflowDataType getType() { + return type; + } + + public void setType(WorkflowDataType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return WorkflowDataUpdate + */ + @JsonAnySetter + public WorkflowDataUpdate putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this WorkflowDataUpdate object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WorkflowDataUpdate workflowDataUpdate = (WorkflowDataUpdate) o; + return Objects.equals(this.attributes, workflowDataUpdate.attributes) + && Objects.equals(this.id, workflowDataUpdate.id) + && Objects.equals(this.relationships, workflowDataUpdate.relationships) + && Objects.equals(this.type, workflowDataUpdate.type) + && Objects.equals(this.additionalProperties, workflowDataUpdate.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, relationships, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WorkflowDataUpdate {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" relationships: ").append(toIndentedString(relationships)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/WorkflowDataUpdateAttributes.java b/src/main/java/com/datadog/api/client/v2/model/WorkflowDataUpdateAttributes.java new file mode 100644 index 00000000000..c2626ad9461 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/WorkflowDataUpdateAttributes.java @@ -0,0 +1,333 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** The definition of WorkflowDataUpdateAttributes object. */ +@JsonPropertyOrder({ + WorkflowDataUpdateAttributes.JSON_PROPERTY_CREATED_AT, + WorkflowDataUpdateAttributes.JSON_PROPERTY_DESCRIPTION, + WorkflowDataUpdateAttributes.JSON_PROPERTY_NAME, + WorkflowDataUpdateAttributes.JSON_PROPERTY_PUBLISHED, + WorkflowDataUpdateAttributes.JSON_PROPERTY_SPEC, + WorkflowDataUpdateAttributes.JSON_PROPERTY_TAGS, + WorkflowDataUpdateAttributes.JSON_PROPERTY_UPDATED_AT, + WorkflowDataUpdateAttributes.JSON_PROPERTY_WEBHOOK_SECRET +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class WorkflowDataUpdateAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CREATED_AT = "createdAt"; + private OffsetDateTime createdAt; + + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private String description; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_PUBLISHED = "published"; + private Boolean published; + + public static final String JSON_PROPERTY_SPEC = "spec"; + private Spec spec; + + public static final String JSON_PROPERTY_TAGS = "tags"; + private List tags = null; + + public static final String JSON_PROPERTY_UPDATED_AT = "updatedAt"; + private OffsetDateTime updatedAt; + + public static final String JSON_PROPERTY_WEBHOOK_SECRET = "webhookSecret"; + private String webhookSecret; + + /** + * When the workflow was created. + * + * @return createdAt + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + public WorkflowDataUpdateAttributes description(String description) { + this.description = description; + return this; + } + + /** + * Description of the workflow. + * + * @return description + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public WorkflowDataUpdateAttributes name(String name) { + this.name = name; + return this; + } + + /** + * Name of the workflow. + * + * @return name + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public WorkflowDataUpdateAttributes published(Boolean published) { + this.published = published; + return this; + } + + /** + * Set the workflow to published or unpublished. Workflows in an unpublished state will only be + * executable via manual runs. Automatic triggers such as Schedule will not execute the workflow + * until it is published. + * + * @return published + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PUBLISHED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getPublished() { + return published; + } + + public void setPublished(Boolean published) { + this.published = published; + } + + public WorkflowDataUpdateAttributes spec(Spec spec) { + this.spec = spec; + this.unparsed |= spec.unparsed; + return this; + } + + /** + * The spec defines what the workflow does. + * + * @return spec + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SPEC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Spec getSpec() { + return spec; + } + + public void setSpec(Spec spec) { + this.spec = spec; + } + + public WorkflowDataUpdateAttributes tags(List tags) { + this.tags = tags; + return this; + } + + public WorkflowDataUpdateAttributes addTagsItem(String tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList<>(); + } + this.tags.add(tagsItem); + return this; + } + + /** + * Tags of the workflow. + * + * @return tags + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getTags() { + return tags; + } + + public void setTags(List tags) { + this.tags = tags; + } + + /** + * When the workflow was last updated. + * + * @return updatedAt + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UPDATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + public WorkflowDataUpdateAttributes webhookSecret(String webhookSecret) { + this.webhookSecret = webhookSecret; + return this; + } + + /** + * If a Webhook trigger is defined on this workflow, a webhookSecret is required and should be + * provided here. + * + * @return webhookSecret + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WEBHOOK_SECRET) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getWebhookSecret() { + return webhookSecret; + } + + public void setWebhookSecret(String webhookSecret) { + this.webhookSecret = webhookSecret; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return WorkflowDataUpdateAttributes + */ + @JsonAnySetter + public WorkflowDataUpdateAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this WorkflowDataUpdateAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WorkflowDataUpdateAttributes workflowDataUpdateAttributes = (WorkflowDataUpdateAttributes) o; + return Objects.equals(this.createdAt, workflowDataUpdateAttributes.createdAt) + && Objects.equals(this.description, workflowDataUpdateAttributes.description) + && Objects.equals(this.name, workflowDataUpdateAttributes.name) + && Objects.equals(this.published, workflowDataUpdateAttributes.published) + && Objects.equals(this.spec, workflowDataUpdateAttributes.spec) + && Objects.equals(this.tags, workflowDataUpdateAttributes.tags) + && Objects.equals(this.updatedAt, workflowDataUpdateAttributes.updatedAt) + && Objects.equals(this.webhookSecret, workflowDataUpdateAttributes.webhookSecret) + && Objects.equals( + this.additionalProperties, workflowDataUpdateAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + createdAt, + description, + name, + published, + spec, + tags, + updatedAt, + webhookSecret, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WorkflowDataUpdateAttributes {\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" published: ").append(toIndentedString(published)).append("\n"); + sb.append(" spec: ").append(toIndentedString(spec)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" webhookSecret: ").append(toIndentedString(webhookSecret)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/WorkflowTriggerWrapper.java b/src/main/java/com/datadog/api/client/v2/model/WorkflowTriggerWrapper.java new file mode 100644 index 00000000000..4860a6db274 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/WorkflowTriggerWrapper.java @@ -0,0 +1,183 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Schema for a Workflow-based trigger. */ +@JsonPropertyOrder({ + WorkflowTriggerWrapper.JSON_PROPERTY_START_STEP_NAMES, + WorkflowTriggerWrapper.JSON_PROPERTY_WORKFLOW_TRIGGER +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class WorkflowTriggerWrapper { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_START_STEP_NAMES = "startStepNames"; + private List startStepNames = null; + + public static final String JSON_PROPERTY_WORKFLOW_TRIGGER = "workflowTrigger"; + private Object workflowTrigger; + + public WorkflowTriggerWrapper() {} + + @JsonCreator + public WorkflowTriggerWrapper( + @JsonProperty(required = true, value = JSON_PROPERTY_WORKFLOW_TRIGGER) + Object workflowTrigger) { + this.workflowTrigger = workflowTrigger; + } + + public WorkflowTriggerWrapper startStepNames(List startStepNames) { + this.startStepNames = startStepNames; + return this; + } + + public WorkflowTriggerWrapper addStartStepNamesItem(String startStepNamesItem) { + if (this.startStepNames == null) { + this.startStepNames = new ArrayList<>(); + } + this.startStepNames.add(startStepNamesItem); + return this; + } + + /** + * A list of steps that run first after a trigger fires. + * + * @return startStepNames + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_START_STEP_NAMES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getStartStepNames() { + return startStepNames; + } + + public void setStartStepNames(List startStepNames) { + this.startStepNames = startStepNames; + } + + public WorkflowTriggerWrapper workflowTrigger(Object workflowTrigger) { + this.workflowTrigger = workflowTrigger; + return this; + } + + /** + * Trigger a workflow VIA the Datadog UI. Only required if no other trigger exists. + * + * @return workflowTrigger + */ + @JsonProperty(JSON_PROPERTY_WORKFLOW_TRIGGER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Object getWorkflowTrigger() { + return workflowTrigger; + } + + public void setWorkflowTrigger(Object workflowTrigger) { + this.workflowTrigger = workflowTrigger; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return WorkflowTriggerWrapper + */ + @JsonAnySetter + public WorkflowTriggerWrapper putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this WorkflowTriggerWrapper object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WorkflowTriggerWrapper workflowTriggerWrapper = (WorkflowTriggerWrapper) o; + return Objects.equals(this.startStepNames, workflowTriggerWrapper.startStepNames) + && Objects.equals(this.workflowTrigger, workflowTriggerWrapper.workflowTrigger) + && Objects.equals(this.additionalProperties, workflowTriggerWrapper.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(startStepNames, workflowTrigger, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WorkflowTriggerWrapper {\n"); + sb.append(" startStepNames: ").append(toIndentedString(startStepNames)).append("\n"); + sb.append(" workflowTrigger: ").append(toIndentedString(workflowTrigger)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/WorkflowUserRelationship.java b/src/main/java/com/datadog/api/client/v2/model/WorkflowUserRelationship.java new file mode 100644 index 00000000000..72eb6656109 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/WorkflowUserRelationship.java @@ -0,0 +1,136 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** The definition of WorkflowUserRelationship object. */ +@JsonPropertyOrder({WorkflowUserRelationship.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class WorkflowUserRelationship { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private WorkflowUserRelationshipData data; + + public WorkflowUserRelationship data(WorkflowUserRelationshipData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * The definition of WorkflowUserRelationshipData object. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public WorkflowUserRelationshipData getData() { + return data; + } + + public void setData(WorkflowUserRelationshipData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return WorkflowUserRelationship + */ + @JsonAnySetter + public WorkflowUserRelationship putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this WorkflowUserRelationship object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WorkflowUserRelationship workflowUserRelationship = (WorkflowUserRelationship) o; + return Objects.equals(this.data, workflowUserRelationship.data) + && Objects.equals(this.additionalProperties, workflowUserRelationship.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WorkflowUserRelationship {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/WorkflowUserRelationshipData.java b/src/main/java/com/datadog/api/client/v2/model/WorkflowUserRelationshipData.java new file mode 100644 index 00000000000..08daa2c99d0 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/WorkflowUserRelationshipData.java @@ -0,0 +1,180 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** The definition of WorkflowUserRelationshipData object. */ +@JsonPropertyOrder({ + WorkflowUserRelationshipData.JSON_PROPERTY_ID, + WorkflowUserRelationshipData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class WorkflowUserRelationshipData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private WorkflowUserRelationshipType type; + + public WorkflowUserRelationshipData() {} + + @JsonCreator + public WorkflowUserRelationshipData( + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + WorkflowUserRelationshipType type) { + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public WorkflowUserRelationshipData id(String id) { + this.id = id; + return this; + } + + /** + * The user identifier + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public WorkflowUserRelationshipData type(WorkflowUserRelationshipType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The definition of WorkflowUserRelationshipType object. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public WorkflowUserRelationshipType getType() { + return type; + } + + public void setType(WorkflowUserRelationshipType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return WorkflowUserRelationshipData + */ + @JsonAnySetter + public WorkflowUserRelationshipData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this WorkflowUserRelationshipData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WorkflowUserRelationshipData workflowUserRelationshipData = (WorkflowUserRelationshipData) o; + return Objects.equals(this.id, workflowUserRelationshipData.id) + && Objects.equals(this.type, workflowUserRelationshipData.type) + && Objects.equals( + this.additionalProperties, workflowUserRelationshipData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WorkflowUserRelationshipData {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/WorkflowUserRelationshipType.java b/src/main/java/com/datadog/api/client/v2/model/WorkflowUserRelationshipType.java new file mode 100644 index 00000000000..89225aa721c --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/WorkflowUserRelationshipType.java @@ -0,0 +1,56 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** The definition of WorkflowUserRelationshipType object. */ +@JsonSerialize(using = WorkflowUserRelationshipType.WorkflowUserRelationshipTypeSerializer.class) +public class WorkflowUserRelationshipType extends ModelEnum { + + private static final Set allowedValues = new HashSet(Arrays.asList("users")); + + public static final WorkflowUserRelationshipType USERS = + new WorkflowUserRelationshipType("users"); + + WorkflowUserRelationshipType(String value) { + super(value, allowedValues); + } + + public static class WorkflowUserRelationshipTypeSerializer + extends StdSerializer { + public WorkflowUserRelationshipTypeSerializer(Class t) { + super(t); + } + + public WorkflowUserRelationshipTypeSerializer() { + this(null); + } + + @Override + public void serialize( + WorkflowUserRelationshipType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static WorkflowUserRelationshipType fromValue(String value) { + return new WorkflowUserRelationshipType(value); + } +} diff --git a/src/test/resources/cassettes/features/v2/Create_Workflow_returns_Bad_request_response.freeze b/src/test/resources/cassettes/features/v2/Create_Workflow_returns_Bad_request_response.freeze new file mode 100644 index 00000000000..ad0605b17d8 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_Workflow_returns_Bad_request_response.freeze @@ -0,0 +1 @@ +2025-02-04T04:34:39.241Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_Workflow_returns_Bad_request_response.json b/src/test/resources/cassettes/features/v2/Create_Workflow_returns_Bad_request_response.json new file mode 100644 index 00000000000..95a9b514916 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_Workflow_returns_Bad_request_response.json @@ -0,0 +1,32 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"description\":\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"name\":\"Too many characters in description\",\"spec\":{}},\"type\":\"workflows\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/workflows", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"detail\":\"workflow description exceeds size limit of [300] characters\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 400, + "reasonPhrase": "Bad Request" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "9dbbb4fe-ff77-d906-2de1-752f55e537f6" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_Workflow_returns_Successfully_created_a_workflow_response.freeze b/src/test/resources/cassettes/features/v2/Create_Workflow_returns_Successfully_created_a_workflow_response.freeze new file mode 100644 index 00000000000..8b2b65b8392 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_Workflow_returns_Successfully_created_a_workflow_response.freeze @@ -0,0 +1 @@ +2025-02-04T04:34:39.387Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_Workflow_returns_Successfully_created_a_workflow_response.json b/src/test/resources/cassettes/features/v2/Create_Workflow_returns_Successfully_created_a_workflow_response.json new file mode 100644 index 00000000000..67ccc9c880d --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_Workflow_returns_Successfully_created_a_workflow_response.json @@ -0,0 +1,53 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"description\":\"A sample workflow.\",\"name\":\"Example Workflow\",\"published\":true,\"spec\":{\"connectionEnvs\":[{\"connections\":[{\"connectionId\":\"11111111-1111-1111-1111-111111111111\",\"label\":\"INTEGRATION_DATADOG\"}],\"env\":\"default\"}],\"handle\":\"my-handle\",\"inputSchema\":{\"parameters\":[{\"defaultValue\":\"default\",\"name\":\"input\",\"type\":\"STRING\"}]},\"outputSchema\":{\"parameters\":[{\"name\":\"output\",\"type\":\"ARRAY_OBJECT\",\"value\":\"outputValue\"}]},\"steps\":[{\"actionId\":\"com.datadoghq.dd.monitor.listMonitors\",\"connectionLabel\":\"INTEGRATION_DATADOG\",\"name\":\"Step1\",\"outboundEdges\":[{\"branchName\":\"main\",\"nextStepName\":\"Step2\"}],\"parameters\":[{\"name\":\"tags\",\"value\":\"service:monitoring\"}]},{\"actionId\":\"com.datadoghq.core.noop\",\"name\":\"Step2\"}],\"triggers\":[{\"monitorTrigger\":{\"rateLimit\":{\"count\":1,\"interval\":\"3600s\"}},\"startStepNames\":[\"Step1\"]},{\"githubWebhookTrigger\":{},\"startStepNames\":[\"Step1\"]}]},\"tags\":[\"team:infra\",\"service:monitoring\",\"foo:bar\"]},\"type\":\"workflows\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/workflows", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"9c250b4e-3d0c-433d-84e6-60a6bde81adb\",\"type\":\"workflows\",\"attributes\":{\"createdAt\":\"2025-02-04T04:34:39.501028Z\",\"description\":\"A sample workflow.\",\"name\":\"Example Workflow\",\"published\":true,\"spec\":{\"triggers\":[{\"startStepNames\":[\"Step1\"],\"monitorTrigger\":{\"rateLimit\":{\"count\":1,\"interval\":\"3600s\"}}},{\"startStepNames\":[\"Step1\"],\"githubWebhookTrigger\":{}}],\"steps\":[{\"name\":\"Step1\",\"actionId\":\"com.datadoghq.dd.monitor.listMonitors\",\"connectionLabel\":\"INTEGRATION_DATADOG\",\"parameters\":[{\"name\":\"tags\",\"value\":\"service:monitoring\"}],\"outboundEdges\":[{\"nextStepName\":\"Step2\",\"branchName\":\"main\"}]},{\"name\":\"Step2\",\"actionId\":\"com.datadoghq.core.noop\"}],\"handle\":\"my-handle\",\"connectionEnvs\":[{\"env\":\"default\",\"connections\":[{\"connectionId\":\"11111111-1111-1111-1111-111111111111\",\"label\":\"INTEGRATION_DATADOG\"}]}],\"inputSchema\":{\"parameters\":[{\"name\":\"input\",\"type\":\"STRING\",\"defaultValue\":\"default\"}]},\"outputSchema\":{\"parameters\":[{\"name\":\"output\",\"type\":\"ARRAY_OBJECT\",\"value\":\"outputValue\"}]}},\"tags\":[\"foo:bar\",\"team:infra\",\"service:monitoring\"],\"updatedAt\":\"2025-02-04T04:34:39.501028Z\"},\"relationships\":{\"creator\":{\"data\":{\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"type\":\"users\"}},\"owner\":{\"data\":{\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"type\":\"users\"}}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "4ea99b6c-255c-1141-3fea-0a5165d54bd8" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/workflows/9c250b4e-3d0c-433d-84e6-60a6bde81adb", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "93732a72-a510-f7cf-2b46-f3fbe8a57d21" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_a_Workflow_returns_Bad_request_response.freeze b/src/test/resources/cassettes/features/v2/Create_a_Workflow_returns_Bad_request_response.freeze new file mode 100644 index 00000000000..8fc4fe6507c --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_a_Workflow_returns_Bad_request_response.freeze @@ -0,0 +1 @@ +2025-02-04T04:58:32.931Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_a_Workflow_returns_Bad_request_response.json b/src/test/resources/cassettes/features/v2/Create_a_Workflow_returns_Bad_request_response.json new file mode 100644 index 00000000000..18bfaac3c98 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_a_Workflow_returns_Bad_request_response.json @@ -0,0 +1,32 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"description\":\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"name\":\"Too many characters in description\",\"spec\":{}},\"type\":\"workflows\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/workflows", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"detail\":\"workflow description exceeds size limit of [300] characters\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 400, + "reasonPhrase": "Bad Request" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "9dbbb4fe-ff77-d906-2de1-752f55e537f5" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_a_Workflow_returns_Successfully_created_a_workflow_response.freeze b/src/test/resources/cassettes/features/v2/Create_a_Workflow_returns_Successfully_created_a_workflow_response.freeze new file mode 100644 index 00000000000..5a61727b754 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_a_Workflow_returns_Successfully_created_a_workflow_response.freeze @@ -0,0 +1 @@ +2025-02-04T04:58:33.114Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_a_Workflow_returns_Successfully_created_a_workflow_response.json b/src/test/resources/cassettes/features/v2/Create_a_Workflow_returns_Successfully_created_a_workflow_response.json new file mode 100644 index 00000000000..eac1670b1b2 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_a_Workflow_returns_Successfully_created_a_workflow_response.json @@ -0,0 +1,53 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"description\":\"A sample workflow.\",\"name\":\"Example Workflow\",\"published\":true,\"spec\":{\"connectionEnvs\":[{\"connections\":[{\"connectionId\":\"11111111-1111-1111-1111-111111111111\",\"label\":\"INTEGRATION_DATADOG\"}],\"env\":\"default\"}],\"handle\":\"my-handle\",\"inputSchema\":{\"parameters\":[{\"defaultValue\":\"default\",\"name\":\"input\",\"type\":\"STRING\"}]},\"outputSchema\":{\"parameters\":[{\"name\":\"output\",\"type\":\"ARRAY_OBJECT\",\"value\":\"outputValue\"}]},\"steps\":[{\"actionId\":\"com.datadoghq.dd.monitor.listMonitors\",\"connectionLabel\":\"INTEGRATION_DATADOG\",\"name\":\"Step1\",\"outboundEdges\":[{\"branchName\":\"main\",\"nextStepName\":\"Step2\"}],\"parameters\":[{\"name\":\"tags\",\"value\":\"service:monitoring\"}]},{\"actionId\":\"com.datadoghq.core.noop\",\"name\":\"Step2\"}],\"triggers\":[{\"monitorTrigger\":{\"rateLimit\":{\"count\":1,\"interval\":\"3600s\"}},\"startStepNames\":[\"Step1\"]},{\"githubWebhookTrigger\":{},\"startStepNames\":[\"Step1\"]}]},\"tags\":[\"team:infra\",\"service:monitoring\",\"foo:bar\"]},\"type\":\"workflows\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/workflows", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"cb8dd95a-1463-495d-99d6-95efcd86e74e\",\"type\":\"workflows\",\"attributes\":{\"createdAt\":\"2025-02-04T04:58:33.224986Z\",\"description\":\"A sample workflow.\",\"name\":\"Example Workflow\",\"published\":true,\"spec\":{\"triggers\":[{\"startStepNames\":[\"Step1\"],\"monitorTrigger\":{\"rateLimit\":{\"count\":1,\"interval\":\"3600s\"}}},{\"startStepNames\":[\"Step1\"],\"githubWebhookTrigger\":{}}],\"steps\":[{\"name\":\"Step1\",\"actionId\":\"com.datadoghq.dd.monitor.listMonitors\",\"connectionLabel\":\"INTEGRATION_DATADOG\",\"parameters\":[{\"name\":\"tags\",\"value\":\"service:monitoring\"}],\"outboundEdges\":[{\"nextStepName\":\"Step2\",\"branchName\":\"main\"}]},{\"name\":\"Step2\",\"actionId\":\"com.datadoghq.core.noop\"}],\"handle\":\"my-handle\",\"connectionEnvs\":[{\"env\":\"default\",\"connections\":[{\"connectionId\":\"11111111-1111-1111-1111-111111111111\",\"label\":\"INTEGRATION_DATADOG\"}]}],\"inputSchema\":{\"parameters\":[{\"name\":\"input\",\"type\":\"STRING\",\"defaultValue\":\"default\"}]},\"outputSchema\":{\"parameters\":[{\"name\":\"output\",\"type\":\"ARRAY_OBJECT\",\"value\":\"outputValue\"}]}},\"tags\":[\"foo:bar\",\"team:infra\",\"service:monitoring\"],\"updatedAt\":\"2025-02-04T04:58:33.224986Z\"},\"relationships\":{\"creator\":{\"data\":{\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"type\":\"users\"}},\"owner\":{\"data\":{\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"type\":\"users\"}}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "4ea99b6c-255c-1141-3fea-0a5165d54bd7" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/workflows/cb8dd95a-1463-495d-99d6-95efcd86e74e", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "9384953c-7e69-c85a-3baf-0296d8482df5" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Delete_an_existing_Workflow_returns_Not_found_response.freeze b/src/test/resources/cassettes/features/v2/Delete_an_existing_Workflow_returns_Not_found_response.freeze new file mode 100644 index 00000000000..8ffae6cef74 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Delete_an_existing_Workflow_returns_Not_found_response.freeze @@ -0,0 +1 @@ +2025-02-04T04:58:33.338Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Delete_an_existing_Workflow_returns_Not_found_response.json b/src/test/resources/cassettes/features/v2/Delete_an_existing_Workflow_returns_Not_found_response.json new file mode 100644 index 00000000000..85c7afd08c0 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Delete_an_existing_Workflow_returns_Not_found_response.json @@ -0,0 +1,28 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/workflows/aaa11111-aa11-aa11-aaaa-aaaaaa111111", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"detail\":\"workflow not found\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 404, + "reasonPhrase": "Not Found" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "f0427d21-bf91-831e-9d00-1c2036a4cfaf" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Delete_an_existing_Workflow_returns_Successfully_deleted_a_workflow_response.freeze b/src/test/resources/cassettes/features/v2/Delete_an_existing_Workflow_returns_Successfully_deleted_a_workflow_response.freeze new file mode 100644 index 00000000000..eb026ef178f --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Delete_an_existing_Workflow_returns_Successfully_deleted_a_workflow_response.freeze @@ -0,0 +1 @@ +2025-02-04T04:58:33.426Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Delete_an_existing_Workflow_returns_Successfully_deleted_a_workflow_response.json b/src/test/resources/cassettes/features/v2/Delete_an_existing_Workflow_returns_Successfully_deleted_a_workflow_response.json new file mode 100644 index 00000000000..db9ab0c8bcf --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Delete_an_existing_Workflow_returns_Successfully_deleted_a_workflow_response.json @@ -0,0 +1,79 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"name\":\"Cassette Workflow x-given\",\"spec\":{\"steps\":[{\"actionId\":\"com.datadoghq.core.noop\",\"name\":\"No_op\"}],\"triggers\":[{\"startStepNames\":[\"No_op\"],\"workflowTrigger\":{}}]}},\"type\":\"workflows\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/workflows", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"94300e37-bf51-498b-b56b-83d17ef45e6b\",\"type\":\"workflows\",\"attributes\":{\"createdAt\":\"2025-02-04T04:58:33.538848Z\",\"description\":\"\",\"name\":\"Cassette Workflow x-given\",\"published\":true,\"spec\":{\"triggers\":[{\"startStepNames\":[\"No_op\"],\"workflowTrigger\":{}}],\"steps\":[{\"name\":\"No_op\",\"actionId\":\"com.datadoghq.core.noop\"}]},\"tags\":[],\"updatedAt\":\"2025-02-04T04:58:33.538848Z\"},\"relationships\":{\"creator\":{\"data\":{\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"type\":\"users\"}},\"owner\":{\"data\":{\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"type\":\"users\"}}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "ef58c8e5-8d44-f741-5735-0d8c01ffa21d" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/workflows/94300e37-bf51-498b-b56b-83d17ef45e6b", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "e8341d25-c544-632e-afe2-e81fd2bcba07" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/workflows/94300e37-bf51-498b-b56b-83d17ef45e6b", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"detail\":\"workflow not found\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 404, + "reasonPhrase": "Not Found" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "e8341d25-c544-632e-afe2-e81fd2bcba08" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_an_existing_Workflow_returns_Bad_request_response.freeze b/src/test/resources/cassettes/features/v2/Get_an_existing_Workflow_returns_Bad_request_response.freeze new file mode 100644 index 00000000000..728a4fc6d9a --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_an_existing_Workflow_returns_Bad_request_response.freeze @@ -0,0 +1 @@ +2025-02-04T04:58:33.693Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_an_existing_Workflow_returns_Bad_request_response.json b/src/test/resources/cassettes/features/v2/Get_an_existing_Workflow_returns_Bad_request_response.json new file mode 100644 index 00000000000..fcde1b1d822 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_an_existing_Workflow_returns_Bad_request_response.json @@ -0,0 +1,28 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/workflows/bad-format", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"400\",\"title\":\"Invalid Parameter\",\"detail\":\"invalid parameter \\\"workflowId\\\" in \\\"path\\\"; expected type \\\"uuid\\\"\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 400, + "reasonPhrase": "Bad Request" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "b7132748-d1b3-a702-d3cf-dfd009bcf538" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_an_existing_Workflow_returns_Not_found_response.freeze b/src/test/resources/cassettes/features/v2/Get_an_existing_Workflow_returns_Not_found_response.freeze new file mode 100644 index 00000000000..1192c2758c0 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_an_existing_Workflow_returns_Not_found_response.freeze @@ -0,0 +1 @@ +2025-02-04T04:58:33.759Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_an_existing_Workflow_returns_Not_found_response.json b/src/test/resources/cassettes/features/v2/Get_an_existing_Workflow_returns_Not_found_response.json new file mode 100644 index 00000000000..ce54a9cb96b --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_an_existing_Workflow_returns_Not_found_response.json @@ -0,0 +1,28 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/workflows/aaa11111-aa11-aa11-aaaa-aaaaaa111111", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"detail\":\"workflow not found\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 404, + "reasonPhrase": "Not Found" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "63210b51-684c-beff-ef97-cd221bf07b63" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_an_existing_Workflow_returns_Successfully_got_a_workflow_response.freeze b/src/test/resources/cassettes/features/v2/Get_an_existing_Workflow_returns_Successfully_got_a_workflow_response.freeze new file mode 100644 index 00000000000..c1bb2bc7d00 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_an_existing_Workflow_returns_Successfully_got_a_workflow_response.freeze @@ -0,0 +1 @@ +2025-02-04T04:58:33.829Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_an_existing_Workflow_returns_Successfully_got_a_workflow_response.json b/src/test/resources/cassettes/features/v2/Get_an_existing_Workflow_returns_Successfully_got_a_workflow_response.json new file mode 100644 index 00000000000..25db76f7d19 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_an_existing_Workflow_returns_Successfully_got_a_workflow_response.json @@ -0,0 +1,79 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"name\":\"Cassette Workflow x-given\",\"spec\":{\"steps\":[{\"actionId\":\"com.datadoghq.core.noop\",\"name\":\"No_op\"}],\"triggers\":[{\"startStepNames\":[\"No_op\"],\"workflowTrigger\":{}}]}},\"type\":\"workflows\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/workflows", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"6ffa14c3-816b-4463-9386-cb8eb5b73438\",\"type\":\"workflows\",\"attributes\":{\"createdAt\":\"2025-02-04T04:58:33.952654Z\",\"description\":\"\",\"name\":\"Cassette Workflow x-given\",\"published\":true,\"spec\":{\"triggers\":[{\"startStepNames\":[\"No_op\"],\"workflowTrigger\":{}}],\"steps\":[{\"name\":\"No_op\",\"actionId\":\"com.datadoghq.core.noop\"}]},\"tags\":[],\"updatedAt\":\"2025-02-04T04:58:33.952654Z\"},\"relationships\":{\"creator\":{\"data\":{\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"type\":\"users\"}},\"owner\":{\"data\":{\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"type\":\"users\"}}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "ef58c8e5-8d44-f741-5735-0d8c01ffa21f" + }, + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/workflows/6ffa14c3-816b-4463-9386-cb8eb5b73438", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"6ffa14c3-816b-4463-9386-cb8eb5b73438\",\"type\":\"workflows\",\"attributes\":{\"createdAt\":\"2025-02-04T04:58:33.952654Z\",\"description\":\"\",\"name\":\"Cassette Workflow x-given\",\"published\":true,\"spec\":{\"triggers\":[{\"startStepNames\":[\"No_op\"],\"workflowTrigger\":{}}],\"steps\":[{\"name\":\"No_op\",\"actionId\":\"com.datadoghq.core.noop\"}]},\"tags\":[],\"updatedAt\":\"2025-02-04T04:58:33.952654Z\"},\"relationships\":{\"creator\":{\"data\":{\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"type\":\"users\"}},\"owner\":{\"data\":{\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"type\":\"users\"}}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "27cb74b4-39b5-1a32-253f-039d781db16f" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/workflows/6ffa14c3-816b-4463-9386-cb8eb5b73438", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "394bd3a4-9cbd-9afd-0ced-e3d9311c8247" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_an_existing_Workflow_returns_Bad_request_response.freeze b/src/test/resources/cassettes/features/v2/Update_an_existing_Workflow_returns_Bad_request_response.freeze new file mode 100644 index 00000000000..d1b627bbdd3 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_an_existing_Workflow_returns_Bad_request_response.freeze @@ -0,0 +1 @@ +2025-02-04T04:58:34.162Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_an_existing_Workflow_returns_Bad_request_response.json b/src/test/resources/cassettes/features/v2/Update_an_existing_Workflow_returns_Bad_request_response.json new file mode 100644 index 00000000000..1247c1814db --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_an_existing_Workflow_returns_Bad_request_response.json @@ -0,0 +1,83 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"name\":\"Cassette Workflow x-given\",\"spec\":{\"steps\":[{\"actionId\":\"com.datadoghq.core.noop\",\"name\":\"No_op\"}],\"triggers\":[{\"startStepNames\":[\"No_op\"],\"workflowTrigger\":{}}]}},\"type\":\"workflows\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/workflows", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"748a9d1b-a9a5-415b-9360-3d8374329957\",\"type\":\"workflows\",\"attributes\":{\"createdAt\":\"2025-02-04T04:58:34.263325Z\",\"description\":\"\",\"name\":\"Cassette Workflow x-given\",\"published\":true,\"spec\":{\"triggers\":[{\"startStepNames\":[\"No_op\"],\"workflowTrigger\":{}}],\"steps\":[{\"name\":\"No_op\",\"actionId\":\"com.datadoghq.core.noop\"}]},\"tags\":[],\"updatedAt\":\"2025-02-04T04:58:34.263325Z\"},\"relationships\":{\"creator\":{\"data\":{\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"type\":\"users\"}},\"owner\":{\"data\":{\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"type\":\"users\"}}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "ef58c8e5-8d44-f741-5735-0d8c01ffa21c" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"description\":\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"name\":\"Too many characters in description\",\"spec\":{}},\"id\":\"22222222-2222-2222-2222-222222222222\",\"type\":\"workflows\"}}" + }, + "headers": {}, + "method": "PATCH", + "path": "/api/v2/workflows/748a9d1b-a9a5-415b-9360-3d8374329957", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"detail\":\"workflow description exceeds size limit of [300] characters\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 400, + "reasonPhrase": "Bad Request" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "2a88c302-487a-a9dc-d84a-6250dba77e2b" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/workflows/748a9d1b-a9a5-415b-9360-3d8374329957", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "68664620-392a-c355-4d90-95f4155a8b5c" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_an_existing_Workflow_returns_Not_found_response.freeze b/src/test/resources/cassettes/features/v2/Update_an_existing_Workflow_returns_Not_found_response.freeze new file mode 100644 index 00000000000..41cf3852306 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_an_existing_Workflow_returns_Not_found_response.freeze @@ -0,0 +1 @@ +2025-02-04T04:58:34.413Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_an_existing_Workflow_returns_Not_found_response.json b/src/test/resources/cassettes/features/v2/Update_an_existing_Workflow_returns_Not_found_response.json new file mode 100644 index 00000000000..c2fbd7202e4 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_an_existing_Workflow_returns_Not_found_response.json @@ -0,0 +1,32 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"description\":\"A sample workflow.\",\"name\":\"Example Workflow\",\"published\":true,\"spec\":{\"connectionEnvs\":[{\"connections\":[{\"connectionId\":\"11111111-1111-1111-1111-111111111111\",\"label\":\"INTEGRATION_DATADOG\"}],\"env\":\"default\"}],\"handle\":\"my-handle\",\"inputSchema\":{\"parameters\":[{\"defaultValue\":\"default\",\"name\":\"input\",\"type\":\"STRING\"}]},\"outputSchema\":{\"parameters\":[{\"name\":\"output\",\"type\":\"ARRAY_OBJECT\",\"value\":\"outputValue\"}]},\"steps\":[{\"actionId\":\"com.datadoghq.dd.monitor.listMonitors\",\"connectionLabel\":\"INTEGRATION_DATADOG\",\"name\":\"Step1\",\"outboundEdges\":[{\"branchName\":\"main\",\"nextStepName\":\"Step2\"}],\"parameters\":[{\"name\":\"tags\",\"value\":\"service:monitoring\"}]},{\"actionId\":\"com.datadoghq.core.noop\",\"name\":\"Step2\"}],\"triggers\":[{\"monitorTrigger\":{\"rateLimit\":{\"count\":1,\"interval\":\"3600s\"}},\"startStepNames\":[\"Step1\"]},{\"githubWebhookTrigger\":{},\"startStepNames\":[\"Step1\"]}]},\"tags\":[\"team:infra\",\"service:monitoring\",\"foo:bar\"]},\"id\":\"22222222-2222-2222-2222-222222222222\",\"type\":\"workflows\"}}" + }, + "headers": {}, + "method": "PATCH", + "path": "/api/v2/workflows/aaa11111-aa11-aa11-aaaa-aaaaaa111111", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"detail\":\"workflow not found\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 404, + "reasonPhrase": "Not Found" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "c82ad1aa-2d39-b2d9-3b1d-b9060ae2a476" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_an_existing_Workflow_returns_Successfully_updated_a_workflow_response.freeze b/src/test/resources/cassettes/features/v2/Update_an_existing_Workflow_returns_Successfully_updated_a_workflow_response.freeze new file mode 100644 index 00000000000..e1127f3d402 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_an_existing_Workflow_returns_Successfully_updated_a_workflow_response.freeze @@ -0,0 +1 @@ +2025-02-04T04:58:34.496Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_an_existing_Workflow_returns_Successfully_updated_a_workflow_response.json b/src/test/resources/cassettes/features/v2/Update_an_existing_Workflow_returns_Successfully_updated_a_workflow_response.json new file mode 100644 index 00000000000..243143e1bfc --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_an_existing_Workflow_returns_Successfully_updated_a_workflow_response.json @@ -0,0 +1,83 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"name\":\"Cassette Workflow x-given\",\"spec\":{\"steps\":[{\"actionId\":\"com.datadoghq.core.noop\",\"name\":\"No_op\"}],\"triggers\":[{\"startStepNames\":[\"No_op\"],\"workflowTrigger\":{}}]}},\"type\":\"workflows\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/workflows", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"b7a23134-f18e-4896-acd6-73c9b8b813a5\",\"type\":\"workflows\",\"attributes\":{\"createdAt\":\"2025-02-04T04:58:34.597357Z\",\"description\":\"\",\"name\":\"Cassette Workflow x-given\",\"published\":true,\"spec\":{\"triggers\":[{\"startStepNames\":[\"No_op\"],\"workflowTrigger\":{}}],\"steps\":[{\"name\":\"No_op\",\"actionId\":\"com.datadoghq.core.noop\"}]},\"tags\":[],\"updatedAt\":\"2025-02-04T04:58:34.597357Z\"},\"relationships\":{\"creator\":{\"data\":{\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"type\":\"users\"}},\"owner\":{\"data\":{\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"type\":\"users\"}}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "ef58c8e5-8d44-f741-5735-0d8c01ffa21e" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"description\":\"A sample workflow.\",\"name\":\"Example Workflow\",\"published\":true,\"spec\":{\"connectionEnvs\":[{\"connections\":[{\"connectionId\":\"11111111-1111-1111-1111-111111111111\",\"label\":\"INTEGRATION_DATADOG\"}],\"env\":\"default\"}],\"handle\":\"my-handle\",\"inputSchema\":{\"parameters\":[{\"defaultValue\":\"default\",\"name\":\"input\",\"type\":\"STRING\"}]},\"outputSchema\":{\"parameters\":[{\"name\":\"output\",\"type\":\"ARRAY_OBJECT\",\"value\":\"outputValue\"}]},\"steps\":[{\"actionId\":\"com.datadoghq.dd.monitor.listMonitors\",\"connectionLabel\":\"INTEGRATION_DATADOG\",\"name\":\"Step1\",\"outboundEdges\":[{\"branchName\":\"main\",\"nextStepName\":\"Step2\"}],\"parameters\":[{\"name\":\"tags\",\"value\":\"service:monitoring\"}]},{\"actionId\":\"com.datadoghq.core.noop\",\"name\":\"Step2\"}],\"triggers\":[{\"monitorTrigger\":{\"rateLimit\":{\"count\":1,\"interval\":\"3600s\"}},\"startStepNames\":[\"Step1\"]},{\"githubWebhookTrigger\":{},\"startStepNames\":[\"Step1\"]}]},\"tags\":[\"team:infra\",\"service:monitoring\",\"foo:bar\"]},\"id\":\"22222222-2222-2222-2222-222222222222\",\"type\":\"workflows\"}}" + }, + "headers": {}, + "method": "PATCH", + "path": "/api/v2/workflows/b7a23134-f18e-4896-acd6-73c9b8b813a5", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"b7a23134-f18e-4896-acd6-73c9b8b813a5\",\"type\":\"workflows\",\"attributes\":{\"createdAt\":\"2025-02-04T04:58:34.597357Z\",\"description\":\"A sample workflow.\",\"name\":\"Example Workflow\",\"published\":true,\"spec\":{\"triggers\":[{\"startStepNames\":[\"Step1\"],\"monitorTrigger\":{\"rateLimit\":{\"count\":1,\"interval\":\"3600s\"}}},{\"startStepNames\":[\"Step1\"],\"githubWebhookTrigger\":{}}],\"steps\":[{\"name\":\"Step1\",\"actionId\":\"com.datadoghq.dd.monitor.listMonitors\",\"connectionLabel\":\"INTEGRATION_DATADOG\",\"parameters\":[{\"name\":\"tags\",\"value\":\"service:monitoring\"}],\"outboundEdges\":[{\"nextStepName\":\"Step2\",\"branchName\":\"main\"}]},{\"name\":\"Step2\",\"actionId\":\"com.datadoghq.core.noop\"}],\"handle\":\"my-handle\",\"connectionEnvs\":[{\"env\":\"default\",\"connections\":[{\"connectionId\":\"11111111-1111-1111-1111-111111111111\",\"label\":\"INTEGRATION_DATADOG\"}]}],\"inputSchema\":{\"parameters\":[{\"name\":\"input\",\"type\":\"STRING\",\"defaultValue\":\"default\"}]},\"outputSchema\":{\"parameters\":[{\"name\":\"output\",\"type\":\"ARRAY_OBJECT\",\"value\":\"outputValue\"}]}},\"tags\":[\"foo:bar\",\"team:infra\",\"service:monitoring\"],\"updatedAt\":\"2025-02-04T04:58:34.728719Z\"},\"relationships\":{\"creator\":{\"data\":{\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"type\":\"users\"}},\"owner\":{\"data\":{\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"type\":\"users\"}}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "3fe5398e-0bd7-7af3-6231-5f9149489a61" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/workflows/b7a23134-f18e-4896-acd6-73c9b8b813a5", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "073431aa-3fe5-9682-fc26-5b77ec6963f3" + } +] \ No newline at end of file diff --git a/src/test/resources/com/datadog/api/client/v2/api/given.json b/src/test/resources/com/datadog/api/client/v2/api/given.json index b33ac88a36d..57348eb2af3 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/given.json +++ b/src/test/resources/com/datadog/api/client/v2/api/given.json @@ -837,5 +837,17 @@ "key": "user", "tag": "Users", "operationId": "CreateUser" + }, + { + "parameters": [ + { + "name": "body", + "value": "{\n \"data\": {\n \"type\": \"workflows\",\n \"attributes\": {\n \"name\": \"Cassette Workflow x-given\",\n \"spec\": {\n \"triggers\": [\n {\n \"startStepNames\": [\"No_op\"],\n \"workflowTrigger\": {}\n }\n ],\n \"steps\": [\n {\n \"name\": \"No_op\",\n \"actionId\": \"com.datadoghq.core.noop\"\n }\n ]\n }\n }\n }\n}" + } + ], + "step": "there is a valid \"workflow\" in the system", + "key": "workflow", + "tag": "Workflow Automation", + "operationId": "CreateWorkflow" } ] diff --git a/src/test/resources/com/datadog/api/client/v2/api/undo.json b/src/test/resources/com/datadog/api/client/v2/api/undo.json index 03717048ec6..288ca835fe7 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/undo.json +++ b/src/test/resources/com/datadog/api/client/v2/api/undo.json @@ -2970,6 +2970,37 @@ "type": "safe" } }, + "CreateWorkflow": { + "tag": "Workflow Automation", + "undo": { + "operationId": "DeleteWorkflow", + "parameters": [ + { + "name": "workflow_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "DeleteWorkflow": { + "tag": "Workflow Automation", + "undo": { + "type": "idempotent" + } + }, + "GetWorkflow": { + "tag": "Workflow Automation", + "undo": { + "type": "safe" + } + }, + "UpdateWorkflow": { + "tag": "Workflow Automation", + "undo": { + "type": "idempotent" + } + }, "ListWorkflowInstances": { "tag": "Workflow Automation", "undo": { diff --git a/src/test/resources/com/datadog/api/client/v2/api/workflow_automation.feature b/src/test/resources/com/datadog/api/client/v2/api/workflow_automation.feature index fe979f72dd0..57882b43d64 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/workflow_automation.feature +++ b/src/test/resources/com/datadog/api/client/v2/api/workflow_automation.feature @@ -32,6 +32,35 @@ Feature: Workflow Automation When the request is sent Then the response status is 200 OK + @team:DataDog/workflow-automation-dev + Scenario: Create a Workflow returns "Bad request" response + Given new "CreateWorkflow" request + And body with value {"data": {"attributes": {"name": "Too many characters in description", "description": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "spec": {}}, "type": "workflows"}} + When the request is sent + Then the response status is 400 Bad request + + @team:DataDog/workflow-automation-dev + Scenario: Create a Workflow returns "Successfully created a workflow." response + Given new "CreateWorkflow" request + And body with value {"data": {"attributes": {"description": "A sample workflow.", "name": "Example Workflow", "published": true, "spec": {"connectionEnvs": [{"connections": [{"connectionId": "11111111-1111-1111-1111-111111111111", "label": "INTEGRATION_DATADOG"}], "env": "default"}], "handle": "my-handle", "inputSchema": {"parameters": [{"defaultValue": "default", "name": "input", "type": "STRING"}]}, "outputSchema": {"parameters": [{"name": "output", "type": "ARRAY_OBJECT", "value": "outputValue"}]}, "steps": [{"actionId": "com.datadoghq.dd.monitor.listMonitors", "connectionLabel": "INTEGRATION_DATADOG", "name": "Step1", "outboundEdges": [{"branchName": "main", "nextStepName": "Step2"}], "parameters": [{"name": "tags", "value": "service:monitoring"}]}, {"actionId": "com.datadoghq.core.noop", "name": "Step2"}], "triggers": [{"monitorTrigger": {"rateLimit": {"count": 1, "interval": "3600s"}}, "startStepNames": ["Step1"]}, {"startStepNames": ["Step1"], "githubWebhookTrigger": {}}]}, "tags": ["team:infra", "service:monitoring", "foo:bar"]}, "type": "workflows"}} + When the request is sent + Then the response status is 201 Successfully created a workflow. + + @team:DataDog/workflow-automation-dev + Scenario: Delete an existing Workflow returns "Not found" response + Given new "DeleteWorkflow" request + And request contains "workflow_id" parameter with value "aaa11111-aa11-aa11-aaaa-aaaaaa111111" + When the request is sent + Then the response status is 404 Not found + + @team:DataDog/workflow-automation-dev + Scenario: Delete an existing Workflow returns "Successfully deleted a workflow." response + Given there is a valid "workflow" in the system + And new "DeleteWorkflow" request + And request contains "workflow_id" parameter from "workflow.data.id" + When the request is sent + Then the response status is 204 Successfully deleted a workflow. + @replay-only @team:DataDog/workflow-automation-dev Scenario: Execute a workflow returns "Bad Request" response Given new "CreateWorkflowInstance" request @@ -72,6 +101,28 @@ Feature: Workflow Automation When the request is sent Then the response status is 200 OK + @team:DataDog/workflow-automation-dev + Scenario: Get an existing Workflow returns "Bad request" response + Given new "GetWorkflow" request + And request contains "workflow_id" parameter with value "bad-format" + When the request is sent + Then the response status is 400 Bad request + + @team:DataDog/workflow-automation-dev + Scenario: Get an existing Workflow returns "Not found" response + Given new "GetWorkflow" request + And request contains "workflow_id" parameter with value "aaa11111-aa11-aa11-aaaa-aaaaaa111111" + When the request is sent + Then the response status is 404 Not found + + @team:DataDog/workflow-automation-dev + Scenario: Get an existing Workflow returns "Successfully got a workflow." response + Given there is a valid "workflow" in the system + And new "GetWorkflow" request + And request contains "workflow_id" parameter from "workflow.data.id" + When the request is sent + Then the response status is 200 Successfully got a workflow. + @replay-only @team:DataDog/workflow-automation-dev Scenario: List workflow instances returns "Bad Request" response Given new "ListWorkflowInstances" request @@ -85,3 +136,29 @@ Feature: Workflow Automation And request contains "workflow_id" parameter with value "ccf73164-1998-4785-a7a3-8d06c7e5f558" When the request is sent Then the response status is 200 OK + + @team:DataDog/workflow-automation-dev + Scenario: Update an existing Workflow returns "Bad request" response + Given there is a valid "workflow" in the system + And new "UpdateWorkflow" request + And request contains "workflow_id" parameter from "workflow.data.id" + And body with value {"data": {"attributes": {"name": "Too many characters in description", "description": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "spec": {}}, "id": "22222222-2222-2222-2222-222222222222", "type": "workflows"}} + When the request is sent + Then the response status is 400 Bad request + + @team:DataDog/workflow-automation-dev + Scenario: Update an existing Workflow returns "Not found" response + Given new "UpdateWorkflow" request + And request contains "workflow_id" parameter with value "aaa11111-aa11-aa11-aaaa-aaaaaa111111" + And body with value {"data": {"attributes": {"description": "A sample workflow.", "name": "Example Workflow", "published": true, "spec": {"connectionEnvs": [{"connections": [{"connectionId": "11111111-1111-1111-1111-111111111111", "label": "INTEGRATION_DATADOG"}], "env": "default"}], "handle": "my-handle", "inputSchema": {"parameters": [{"defaultValue": "default", "name": "input", "type": "STRING"}]}, "outputSchema": {"parameters": [{"name": "output", "type": "ARRAY_OBJECT", "value": "outputValue"}]}, "steps": [{"actionId": "com.datadoghq.dd.monitor.listMonitors", "connectionLabel": "INTEGRATION_DATADOG", "name": "Step1", "outboundEdges": [{"branchName": "main", "nextStepName": "Step2"}], "parameters": [{"name": "tags", "value": "service:monitoring"}]}, {"actionId": "com.datadoghq.core.noop", "name": "Step2"}], "triggers": [{"monitorTrigger": {"rateLimit": {"count": 1, "interval": "3600s"}}, "startStepNames": ["Step1"]}, {"startStepNames": ["Step1"], "githubWebhookTrigger": {}}]}, "tags": ["team:infra", "service:monitoring", "foo:bar"]}, "id": "22222222-2222-2222-2222-222222222222", "type": "workflows"}} + When the request is sent + Then the response status is 404 Not found + + @team:DataDog/workflow-automation-dev + Scenario: Update an existing Workflow returns "Successfully updated a workflow." response + Given there is a valid "workflow" in the system + And new "UpdateWorkflow" request + And request contains "workflow_id" parameter from "workflow.data.id" + And body with value {"data": {"attributes": {"description": "A sample workflow.", "name": "Example Workflow", "published": true, "spec": {"connectionEnvs": [{"connections": [{"connectionId": "11111111-1111-1111-1111-111111111111", "label": "INTEGRATION_DATADOG"}], "env": "default"}], "handle": "my-handle", "inputSchema": {"parameters": [{"defaultValue": "default", "name": "input", "type": "STRING"}]}, "outputSchema": {"parameters": [{"name": "output", "type": "ARRAY_OBJECT", "value": "outputValue"}]}, "steps": [{"actionId": "com.datadoghq.dd.monitor.listMonitors", "connectionLabel": "INTEGRATION_DATADOG", "name": "Step1", "outboundEdges": [{"branchName": "main", "nextStepName": "Step2"}], "parameters": [{"name": "tags", "value": "service:monitoring"}]}, {"actionId": "com.datadoghq.core.noop", "name": "Step2"}], "triggers": [{"monitorTrigger": {"rateLimit": {"count": 1, "interval": "3600s"}}, "startStepNames": ["Step1"]}, {"startStepNames": ["Step1"], "githubWebhookTrigger": {}}]}, "tags": ["team:infra", "service:monitoring", "foo:bar"]}, "id": "22222222-2222-2222-2222-222222222222", "type": "workflows"}} + When the request is sent + Then the response status is 200 Successfully updated a workflow.