Skip to content
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 Team relationship to AuthNMappings #60

Merged
Merged
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
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.6",
"regenerated": "2024-04-05 19:46:20.796817",
"spec_repo_commit": "cdcf2ed6"
"regenerated": "2024-04-08 20:24:02.356402",
"spec_repo_commit": "037e376a"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2024-04-05 19:46:20.814022",
"spec_repo_commit": "cdcf2ed6"
"regenerated": "2024-04-08 20:24:02.377503",
"spec_repo_commit": "037e376a"
}
}
}
107 changes: 97 additions & 10 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1325,11 +1325,10 @@ components:
- type
type: object
AuthNMappingCreateRelationships:
description: Relationship of AuthN Mapping create object to Role.
properties:
role:
$ref: '#/components/schemas/RelationshipToRole'
type: object
description: Relationship of AuthN Mapping create object to a Role or Team.
oneOf:
- $ref: '#/components/schemas/AuthNMappingRelationshipToRole'
- $ref: '#/components/schemas/AuthNMappingRelationshipToTeam'
AuthNMappingCreateRequest:
description: Request for creating an AuthN Mapping.
properties:
Expand All @@ -1343,13 +1342,32 @@ components:
oneOf:
- $ref: '#/components/schemas/SAMLAssertionAttribute'
- $ref: '#/components/schemas/Role'
- $ref: '#/components/schemas/AuthNMappingTeam'
AuthNMappingRelationshipToRole:
description: Relationship of AuthN Mapping to a Role.
properties:
role:
$ref: '#/components/schemas/RelationshipToRole'
required:
- role
type: object
AuthNMappingRelationshipToTeam:
description: Relationship of AuthN Mapping to a Team.
properties:
team:
$ref: '#/components/schemas/RelationshipToTeam'
required:
- team
type: object
AuthNMappingRelationships:
description: All relationships associated with AuthN Mapping.
properties:
role:
$ref: '#/components/schemas/RelationshipToRole'
saml_assertion_attribute:
$ref: '#/components/schemas/RelationshipToSAMLAssertionAttribute'
team:
$ref: '#/components/schemas/RelationshipToTeam'
type: object
AuthNMappingResponse:
description: AuthN Mapping response from the API.
Expand All @@ -1362,6 +1380,60 @@ components:
$ref: '#/components/schemas/AuthNMappingIncluded'
type: array
type: object
AuthNMappingTeam:
description: Team.
properties:
attributes:
$ref: '#/components/schemas/AuthNMappingTeamAttributes'
id:
description: The ID of the Team.
example: f9bb8444-af7f-11ec-ac2c-da7ad0900001
type: string
type:
$ref: '#/components/schemas/TeamType'
type: object
AuthNMappingTeamAttributes:
description: Team attributes.
properties:
avatar:
description: Unicode representation of the avatar for the team, limited
to a single grapheme
example: "\U0001F951"
nullable: true
type: string
banner:
description: Banner selection for the team
format: int64
nullable: true
type: integer
handle:
description: The team's identifier
example: example-team
maxLength: 195
type: string
link_count:
description: The number of links belonging to the team
format: int32
maximum: 2147483647
readOnly: true
type: integer
name:
description: The name of the team
example: Example Team
maxLength: 200
type: string
summary:
description: A brief summary of the team, derived from the `description`
maxLength: 120
nullable: true
type: string
user_count:
description: The number of users belonging to the team
format: int32
maximum: 2147483647
readOnly: true
type: integer
type: object
AuthNMappingUpdateAttributes:
description: Key/Value pair of attributes used for update request.
properties:
Expand Down Expand Up @@ -1394,11 +1466,10 @@ components:
- type
type: object
AuthNMappingUpdateRelationships:
description: Relationship of AuthN Mapping update object to Role.
properties:
role:
$ref: '#/components/schemas/RelationshipToRole'
type: object
description: Relationship of AuthN Mapping update object to a Role or Team.
oneOf:
- $ref: '#/components/schemas/AuthNMappingRelationshipToRole'
- $ref: '#/components/schemas/AuthNMappingRelationshipToTeam'
AuthNMappingUpdateRequest:
description: Request to update an AuthN Mapping.
properties:
Expand Down Expand Up @@ -15667,6 +15738,22 @@ components:
- id
- type
type: object
RelationshipToTeam:
description: Relationship to team.
properties:
data:
$ref: '#/components/schemas/RelationshipToTeamData'
type: object
RelationshipToTeamData:
description: Relationship to Team object.
properties:
id:
description: The unique identifier of the team.
example: f9bb8444-af7f-11ec-ac2c-da7ad0900001
type: string
type:
$ref: '#/components/schemas/TeamType'
type: object
RelationshipToTeamLinkData:
description: Relationship between a link and a team
properties:
Expand Down
15 changes: 9 additions & 6 deletions examples/v2_authn-mappings_create_authn_mapping.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use datadog_api_client::datadogV2::model::AuthNMappingCreateAttributes;
use datadog_api_client::datadogV2::model::AuthNMappingCreateData;
use datadog_api_client::datadogV2::model::AuthNMappingCreateRelationships;
use datadog_api_client::datadogV2::model::AuthNMappingCreateRequest;
use datadog_api_client::datadogV2::model::AuthNMappingRelationshipToRole;
use datadog_api_client::datadogV2::model::AuthNMappingsType;
use datadog_api_client::datadogV2::model::RelationshipToRole;
use datadog_api_client::datadogV2::model::RelationshipToRoleData;
Expand All @@ -22,13 +23,15 @@ async fn main() {
.attribute_value("Example-AuthN-Mapping".to_string()),
)
.relationships(
AuthNMappingCreateRelationships::new().role(
RelationshipToRole::new().data(
RelationshipToRoleData::new()
.id(role_data_id.clone())
.type_(RolesType::ROLES),
AuthNMappingCreateRelationships::AuthNMappingRelationshipToRole(Box::new(
AuthNMappingRelationshipToRole::new(
RelationshipToRole::new().data(
RelationshipToRoleData::new()
.id(role_data_id.clone())
.type_(RolesType::ROLES),
),
),
),
)),
),
);
let configuration = Configuration::new();
Expand Down
15 changes: 9 additions & 6 deletions examples/v2_authn-mappings_update_authn_mapping.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Edit an AuthN Mapping returns "OK" response
use datadog_api_client::datadog::configuration::Configuration;
use datadog_api_client::datadogV2::api::api_authn_mappings::AuthNMappingsAPI;
use datadog_api_client::datadogV2::model::AuthNMappingRelationshipToRole;
use datadog_api_client::datadogV2::model::AuthNMappingUpdateAttributes;
use datadog_api_client::datadogV2::model::AuthNMappingUpdateData;
use datadog_api_client::datadogV2::model::AuthNMappingUpdateRelationships;
Expand Down Expand Up @@ -28,13 +29,15 @@ async fn main() {
.attribute_value("Development".to_string()),
)
.relationships(
AuthNMappingUpdateRelationships::new().role(
RelationshipToRole::new().data(
RelationshipToRoleData::new()
.id(role_data_id.clone())
.type_(RolesType::ROLES),
AuthNMappingUpdateRelationships::AuthNMappingRelationshipToRole(Box::new(
AuthNMappingRelationshipToRole::new(
RelationshipToRole::new().data(
RelationshipToRoleData::new()
.id(role_data_id.clone())
.type_(RolesType::ROLES),
),
),
),
)),
),
);
let configuration = Configuration::new();
Expand Down
16 changes: 14 additions & 2 deletions src/datadogV2/model/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -250,12 +250,22 @@ pub mod model_relationship_to_saml_assertion_attribute_data;
pub use self::model_relationship_to_saml_assertion_attribute_data::RelationshipToSAMLAssertionAttributeData;
pub mod model_saml_assertion_attributes_type;
pub use self::model_saml_assertion_attributes_type::SAMLAssertionAttributesType;
pub mod model_relationship_to_team;
pub use self::model_relationship_to_team::RelationshipToTeam;
pub mod model_relationship_to_team_data;
pub use self::model_relationship_to_team_data::RelationshipToTeamData;
pub mod model_team_type;
pub use self::model_team_type::TeamType;
pub mod model_authn_mappings_type;
pub use self::model_authn_mappings_type::AuthNMappingsType;
pub mod model_saml_assertion_attribute;
pub use self::model_saml_assertion_attribute::SAMLAssertionAttribute;
pub mod model_saml_assertion_attribute_attributes;
pub use self::model_saml_assertion_attribute_attributes::SAMLAssertionAttributeAttributes;
pub mod model_authn_mapping_team;
pub use self::model_authn_mapping_team::AuthNMappingTeam;
pub mod model_authn_mapping_team_attributes;
pub use self::model_authn_mapping_team_attributes::AuthNMappingTeamAttributes;
pub mod model_authn_mapping_included;
pub use self::model_authn_mapping_included::AuthNMappingIncluded;
pub mod model_response_meta_attributes;
Expand All @@ -268,6 +278,10 @@ pub mod model_authn_mapping_create_data;
pub use self::model_authn_mapping_create_data::AuthNMappingCreateData;
pub mod model_authn_mapping_create_attributes;
pub use self::model_authn_mapping_create_attributes::AuthNMappingCreateAttributes;
pub mod model_authn_mapping_relationship_to_role;
pub use self::model_authn_mapping_relationship_to_role::AuthNMappingRelationshipToRole;
pub mod model_authn_mapping_relationship_to_team;
pub use self::model_authn_mapping_relationship_to_team::AuthNMappingRelationshipToTeam;
pub mod model_authn_mapping_create_relationships;
pub use self::model_authn_mapping_create_relationships::AuthNMappingCreateRelationships;
pub mod model_authn_mapping_response;
Expand Down Expand Up @@ -2676,8 +2690,6 @@ pub mod model_relationship_to_user_team_permission_data;
pub use self::model_relationship_to_user_team_permission_data::RelationshipToUserTeamPermissionData;
pub mod model_user_team_permission_type;
pub use self::model_user_team_permission_type::UserTeamPermissionType;
pub mod model_team_type;
pub use self::model_team_type::TeamType;
pub mod model_team_link;
pub use self::model_team_link::TeamLink;
pub mod model_team_link_attributes;
Expand Down
10 changes: 9 additions & 1 deletion src/datadogV2/model/model_authn_mapping_create_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pub struct AuthNMappingCreateData {
/// Key/Value pair of attributes used for create request.
#[serde(rename = "attributes")]
pub attributes: Option<crate::datadogV2::model::AuthNMappingCreateAttributes>,
/// Relationship of AuthN Mapping create object to Role.
/// Relationship of AuthN Mapping create object to a Role or Team.
#[serde(rename = "relationships")]
pub relationships: Option<crate::datadogV2::model::AuthNMappingCreateRelationships>,
/// AuthN Mappings resource type.
Expand Down Expand Up @@ -91,6 +91,14 @@ impl<'de> Deserialize<'de> for AuthNMappingCreateData {
}
relationships =
Some(serde_json::from_value(v).map_err(M::Error::custom)?);
if let Some(ref _relationships) = relationships {
match _relationships {
crate::datadogV2::model::AuthNMappingCreateRelationships::UnparsedObject(_relationships) => {
_unparsed = true;
},
_ => {}
}
}
}
"type" => {
type_ = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
Expand Down
Loading
Loading