-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add MSTeams integration metadata info #2045
Merged
api-clients-generation-pipeline
merged 1 commit into
master
from
datadog-api-spec/generated/3174
Oct 4, 2024
+357
−5
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10640,6 +10640,7 @@ components: | |
oneOf: | ||
- $ref: '#/components/schemas/SlackIntegrationMetadata' | ||
- $ref: '#/components/schemas/JiraIntegrationMetadata' | ||
- $ref: '#/components/schemas/MSTeamsIntegrationMetadata' | ||
IncidentIntegrationMetadataPatchData: | ||
description: Incident integration metadata data for a patch request. | ||
properties: | ||
|
@@ -13634,6 +13635,43 @@ components: | |
from the other indexes | ||
type: string | ||
type: object | ||
MSTeamsIntegrationMetadata: | ||
description: Incident integration metadata for the Microsoft Teams integration. | ||
properties: | ||
teams: | ||
description: Array of Microsoft Teams in this integration metadata. | ||
example: [] | ||
items: | ||
$ref: '#/components/schemas/MSTeamsIntegrationMetadataTeamsItem' | ||
type: array | ||
required: | ||
- teams | ||
type: object | ||
MSTeamsIntegrationMetadataTeamsItem: | ||
description: Item in the Microsoft Teams integration metadata teams array. | ||
properties: | ||
ms_channel_id: | ||
description: Microsoft Teams channel ID. | ||
example: 19:[email protected] | ||
type: string | ||
ms_channel_name: | ||
description: Microsoft Teams channel name. | ||
example: incident-0001-example | ||
type: string | ||
ms_tenant_id: | ||
description: Microsoft Teams tenant ID. | ||
example: 00000000-abcd-0005-0000-000000000000 | ||
type: string | ||
redirect_url: | ||
description: URL redirecting to the Microsoft Teams channel. | ||
example: https://teams.microsoft.com/l/channel/19%3Aabc00abcdef00a0abcdef0abcdef0a%40thread.tacv2/conversations?groupId=12345678-abcd-dcba-abcd-1234567890ab&tenantId=00000000-abcd-0005-0000-000000000000 | ||
type: string | ||
required: | ||
- ms_tenant_id | ||
- ms_channel_id | ||
- ms_channel_name | ||
- redirect_url | ||
type: object | ||
Metric: | ||
description: Object for a single metric tag configuration. | ||
example: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
125 changes: 125 additions & 0 deletions
125
lib/datadog_api_client/v2/models/ms_teams_integration_metadata.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
=begin | ||
#Datadog API V2 Collection | ||
#Collection of all Datadog Public endpoints. | ||
The version of the OpenAPI document: 1.0 | ||
Contact: [email protected] | ||
Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator | ||
Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. | ||
This product includes software developed at Datadog (https://www.datadoghq.com/). | ||
Copyright 2020-Present Datadog, Inc. | ||
=end | ||
|
||
require 'date' | ||
require 'time' | ||
|
||
module DatadogAPIClient::V2 | ||
# Incident integration metadata for the Microsoft Teams integration. | ||
class MSTeamsIntegrationMetadata | ||
include BaseGenericModel | ||
|
||
# Array of Microsoft Teams in this integration metadata. | ||
attr_reader :teams | ||
|
||
attr_accessor :additional_properties | ||
|
||
# Attribute mapping from ruby-style variable name to JSON key. | ||
# @!visibility private | ||
def self.attribute_map | ||
{ | ||
:'teams' => :'teams' | ||
} | ||
end | ||
|
||
# Attribute type mapping. | ||
# @!visibility private | ||
def self.openapi_types | ||
{ | ||
:'teams' => :'Array<MSTeamsIntegrationMetadataTeamsItem>' | ||
} | ||
end | ||
|
||
# Initializes the object | ||
# @param attributes [Hash] Model attributes in the form of hash | ||
# @!visibility private | ||
def initialize(attributes = {}) | ||
if (!attributes.is_a?(Hash)) | ||
fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::MSTeamsIntegrationMetadata` initialize method" | ||
end | ||
|
||
self.additional_properties = {} | ||
# check to see if the attribute exists and convert string to symbol for hash key | ||
attributes = attributes.each_with_object({}) { |(k, v), h| | ||
if (!self.class.attribute_map.key?(k.to_sym)) | ||
self.additional_properties[k.to_sym] = v | ||
else | ||
h[k.to_sym] = v | ||
end | ||
} | ||
|
||
if attributes.key?(:'teams') | ||
if (value = attributes[:'teams']).is_a?(Array) | ||
self.teams = value | ||
end | ||
end | ||
end | ||
|
||
# Check to see if the all the properties in the model are valid | ||
# @return true if the model is valid | ||
# @!visibility private | ||
def valid? | ||
return false if @teams.nil? | ||
true | ||
end | ||
|
||
# Custom attribute writer method with validation | ||
# @param teams [Object] Object to be assigned | ||
# @!visibility private | ||
def teams=(teams) | ||
if teams.nil? | ||
fail ArgumentError, 'invalid value for "teams", teams cannot be nil.' | ||
end | ||
@teams = teams | ||
end | ||
|
||
# Returns the object in the form of hash, with additionalProperties support. | ||
# @return [Hash] Returns the object in the form of hash | ||
# @!visibility private | ||
def to_hash | ||
hash = {} | ||
self.class.attribute_map.each_pair do |attr, param| | ||
value = self.send(attr) | ||
if value.nil? | ||
is_nullable = self.class.openapi_nullable.include?(attr) | ||
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) | ||
end | ||
|
||
hash[param] = _to_hash(value) | ||
end | ||
self.additional_properties.each_pair do |attr, value| | ||
hash[attr] = value | ||
end | ||
hash | ||
end | ||
|
||
# Checks equality by comparing each attribute. | ||
# @param o [Object] Object to be compared | ||
# @!visibility private | ||
def ==(o) | ||
return true if self.equal?(o) | ||
self.class == o.class && | ||
teams == o.teams | ||
additional_properties == o.additional_properties | ||
end | ||
|
||
# Calculates hash code according to all attributes. | ||
# @return [Integer] Hash code | ||
# @!visibility private | ||
def hash | ||
[teams].hash | ||
end | ||
end | ||
end |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⚪ Code Quality Violation
Consider using Array() to ensure the type is that of an array (...read more)
The rule "Use
Array()
to ensure your variable is an array" is important for ensuring your code behaves as expected, regardless of the type of data it receives. It is common in Ruby to need to iterate through an array of items. However, if the variable is not an array, this can lead to unexpected behavior or errors.The
Array()
method in Ruby is a Kernel method that converts its argument to an Array. If the argument is already an Array, it returns the argument. If the argument is nil, it returns an empty Array. This can be used to ensure that a variable is an array before trying to iterate over it, preventing potential errors or unexpected behavior.By using
Array(foos)
, you can ensure thatfoos
is an array before you try to iterate over it witheach
. This prevents the need to check iffoos
is an array withfoos.is_a?(Array)
and makes your code cleaner and easier to understand.