Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -120947,6 +120947,8 @@ components:
$ref: "#/components/schemas/TeamNotificationRuleAttributesMsTeams"
pagerduty:
$ref: "#/components/schemas/TeamNotificationRuleAttributesPagerduty"
servicenow:
$ref: "#/components/schemas/TeamNotificationRuleAttributesServiceNow"
slack:
$ref: "#/components/schemas/TeamNotificationRuleAttributesSlack"
type: object
Expand All @@ -120956,6 +120958,10 @@ components:
enabled:
description: Flag indicating email notification
type: boolean
recipient_email:
description: >-
Email address to notify. When omitted and email notifications are enabled, notifications are sent to all team members.
type: string
type: object
TeamNotificationRuleAttributesMsTeams:
description: MS Teams notification settings for the team
Expand All @@ -120971,6 +120977,15 @@ components:
description: Service name for PagerDuty
type: string
type: object
TeamNotificationRuleAttributesServiceNow:
description: ServiceNow notification settings for the team.
properties:
templates:
description: ServiceNow template handle names to use for notifications.
items:
type: string
type: array
type: object
TeamNotificationRuleAttributesSlack:
description: Slack notification settings for the team
properties:
Expand Down Expand Up @@ -227286,6 +227301,10 @@ paths:
- attributes:
email:
enabled: true
recipient_email: alerts@example.com
servicenow:
templates:
- incident-template
slack:
channel: test-channel
workspace: Datadog
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
TeamNotificationRuleAttributes.JSON_PROPERTY_EMAIL,
TeamNotificationRuleAttributes.JSON_PROPERTY_MS_TEAMS,
TeamNotificationRuleAttributes.JSON_PROPERTY_PAGERDUTY,
TeamNotificationRuleAttributes.JSON_PROPERTY_SERVICENOW,
TeamNotificationRuleAttributes.JSON_PROPERTY_SLACK
})
@jakarta.annotation.Generated(
Expand All @@ -36,6 +37,9 @@ public class TeamNotificationRuleAttributes {
public static final String JSON_PROPERTY_PAGERDUTY = "pagerduty";
private TeamNotificationRuleAttributesPagerduty pagerduty;

public static final String JSON_PROPERTY_SERVICENOW = "servicenow";
private TeamNotificationRuleAttributesServiceNow servicenow;

public static final String JSON_PROPERTY_SLACK = "slack";
private TeamNotificationRuleAttributesSlack slack;

Expand Down Expand Up @@ -115,6 +119,32 @@ public void setPagerduty(TeamNotificationRuleAttributesPagerduty pagerduty) {
}
}

public TeamNotificationRuleAttributes servicenow(
TeamNotificationRuleAttributesServiceNow servicenow) {
this.servicenow = servicenow;
this.unparsed |= servicenow.unparsed;
return this;
}

/**
* ServiceNow notification settings for the team.
*
* @return servicenow
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_SERVICENOW)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public TeamNotificationRuleAttributesServiceNow getServicenow() {
return servicenow;
}

public void setServicenow(TeamNotificationRuleAttributesServiceNow servicenow) {
this.servicenow = servicenow;
if (servicenow != null) {
this.unparsed |= servicenow.unparsed;
}
}

public TeamNotificationRuleAttributes slack(TeamNotificationRuleAttributesSlack slack) {
this.slack = slack;
this.unparsed |= slack.unparsed;
Expand Down Expand Up @@ -200,14 +230,15 @@ public boolean equals(Object o) {
return Objects.equals(this.email, teamNotificationRuleAttributes.email)
&& Objects.equals(this.msTeams, teamNotificationRuleAttributes.msTeams)
&& Objects.equals(this.pagerduty, teamNotificationRuleAttributes.pagerduty)
&& Objects.equals(this.servicenow, teamNotificationRuleAttributes.servicenow)
&& Objects.equals(this.slack, teamNotificationRuleAttributes.slack)
&& Objects.equals(
this.additionalProperties, teamNotificationRuleAttributes.additionalProperties);
}

@Override
public int hashCode() {
return Objects.hash(email, msTeams, pagerduty, slack, additionalProperties);
return Objects.hash(email, msTeams, pagerduty, servicenow, slack, additionalProperties);
}

@Override
Expand All @@ -217,6 +248,7 @@ public String toString() {
sb.append(" email: ").append(toIndentedString(email)).append("\n");
sb.append(" msTeams: ").append(toIndentedString(msTeams)).append("\n");
sb.append(" pagerduty: ").append(toIndentedString(pagerduty)).append("\n");
sb.append(" servicenow: ").append(toIndentedString(servicenow)).append("\n");
sb.append(" slack: ").append(toIndentedString(slack)).append("\n");
sb.append(" additionalProperties: ")
.append(toIndentedString(additionalProperties))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,20 @@
import java.util.Objects;

/** Email notification settings for the team */
@JsonPropertyOrder({TeamNotificationRuleAttributesEmail.JSON_PROPERTY_ENABLED})
@JsonPropertyOrder({
TeamNotificationRuleAttributesEmail.JSON_PROPERTY_ENABLED,
TeamNotificationRuleAttributesEmail.JSON_PROPERTY_RECIPIENT_EMAIL
})
@jakarta.annotation.Generated(
value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
public class TeamNotificationRuleAttributesEmail {
@JsonIgnore public boolean unparsed = false;
public static final String JSON_PROPERTY_ENABLED = "enabled";
private Boolean enabled;

public static final String JSON_PROPERTY_RECIPIENT_EMAIL = "recipient_email";
private String recipientEmail;

public TeamNotificationRuleAttributesEmail enabled(Boolean enabled) {
this.enabled = enabled;
return this;
Expand All @@ -46,6 +52,28 @@ public void setEnabled(Boolean enabled) {
this.enabled = enabled;
}

public TeamNotificationRuleAttributesEmail recipientEmail(String recipientEmail) {
this.recipientEmail = recipientEmail;
return this;
}

/**
* Email address to notify. When omitted and email notifications are enabled, notifications are
* sent to all team members.
*
* @return recipientEmail
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_RECIPIENT_EMAIL)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getRecipientEmail() {
return recipientEmail;
}

public void setRecipientEmail(String recipientEmail) {
this.recipientEmail = recipientEmail;
}

/**
* A container for additional, undeclared properties. This is a holder for any undeclared
* properties as specified with the 'additionalProperties' keyword in the OAS document.
Expand Down Expand Up @@ -104,20 +132,22 @@ public boolean equals(Object o) {
TeamNotificationRuleAttributesEmail teamNotificationRuleAttributesEmail =
(TeamNotificationRuleAttributesEmail) o;
return Objects.equals(this.enabled, teamNotificationRuleAttributesEmail.enabled)
&& Objects.equals(this.recipientEmail, teamNotificationRuleAttributesEmail.recipientEmail)
&& Objects.equals(
this.additionalProperties, teamNotificationRuleAttributesEmail.additionalProperties);
}

@Override
public int hashCode() {
return Objects.hash(enabled, additionalProperties);
return Objects.hash(enabled, recipientEmail, additionalProperties);
}

@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class TeamNotificationRuleAttributesEmail {\n");
sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n");
sb.append(" recipientEmail: ").append(toIndentedString(recipientEmail)).append("\n");
sb.append(" additionalProperties: ")
.append(toIndentedString(additionalProperties))
.append("\n");
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
/*
* 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;

/** ServiceNow notification settings for the team. */
@JsonPropertyOrder({TeamNotificationRuleAttributesServiceNow.JSON_PROPERTY_TEMPLATES})
@jakarta.annotation.Generated(
value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
public class TeamNotificationRuleAttributesServiceNow {
@JsonIgnore public boolean unparsed = false;
public static final String JSON_PROPERTY_TEMPLATES = "templates";
private List<String> templates = null;

public TeamNotificationRuleAttributesServiceNow templates(List<String> templates) {
this.templates = templates;
return this;
}

public TeamNotificationRuleAttributesServiceNow addTemplatesItem(String templatesItem) {
if (this.templates == null) {
this.templates = new ArrayList<>();
}
this.templates.add(templatesItem);
return this;
}

/**
* ServiceNow template handle names to use for notifications.
*
* @return templates
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_TEMPLATES)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public List<String> getTemplates() {
return templates;
}

public void setTemplates(List<String> templates) {
this.templates = templates;
}

/**
* 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<String, Object> 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 TeamNotificationRuleAttributesServiceNow
*/
@JsonAnySetter
public TeamNotificationRuleAttributesServiceNow putAdditionalProperty(String key, Object value) {
if (this.additionalProperties == null) {
this.additionalProperties = new HashMap<String, Object>();
}
this.additionalProperties.put(key, value);
return this;
}

/**
* Return the additional (undeclared) property.
*
* @return The additional properties
*/
@JsonAnyGetter
public Map<String, Object> 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 TeamNotificationRuleAttributesServiceNow object is equal to o. */
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
TeamNotificationRuleAttributesServiceNow teamNotificationRuleAttributesServiceNow =
(TeamNotificationRuleAttributesServiceNow) o;
return Objects.equals(this.templates, teamNotificationRuleAttributesServiceNow.templates)
&& Objects.equals(
this.additionalProperties,
teamNotificationRuleAttributesServiceNow.additionalProperties);
}

@Override
public int hashCode() {
return Objects.hash(templates, additionalProperties);
}

@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class TeamNotificationRuleAttributesServiceNow {\n");
sb.append(" templates: ").append(toIndentedString(templates)).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 ");
}
}
Loading