From e36410814ca8eabf91f751f9f855443614490bb0 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 1 Jul 2024 14:10:30 -0700 Subject: [PATCH] Regenerate Swagger code a6af56e4 (#76) Co-authored-by: FireHydrant Bot <44629778+firehydrant-ops@users.noreply.github.com> --- models/entitlement_entity.go | 7 +- ...tions_microsoft_teams_v2_channel_entity.go | 125 ++++++++++++++++++ ..._v1_incidents_incident_id_tasks_task_id.go | 27 ++++ models/patch_v1_signals_email_targets_id.go | 10 +- models/patch_v1_teams_team_id.go | 120 +++++++++++++++++ .../patch_v1_teams_team_id_signal_rules_id.go | 56 ++++++++ models/post_v1_incidents_incident_id_tasks.go | 20 +++ models/post_v1_signals_email_targets.go | 10 +- models/post_v1_teams.go | 119 +++++++++++++++++ models/post_v1_teams_team_id_signal_rules.go | 56 ++++++++ models/signals_api_rule_entity.go | 54 ++++++++ models/task_entity.go | 20 +++ models/team_entity.go | 46 +++++++ models/ticketing_ticket_entity.go | 20 +++ 14 files changed, 678 insertions(+), 12 deletions(-) create mode 100644 models/integrations_microsoft_teams_v2_channel_entity.go diff --git a/models/entitlement_entity.go b/models/entitlement_entity.go index 890f403..df2b0f2 100644 --- a/models/entitlement_entity.go +++ b/models/entitlement_entity.go @@ -42,7 +42,7 @@ type EntitlementEntity struct { Slug string `json:"slug,omitempty"` // tier - // Enum: [free essentials enterprise] + // Enum: [free essentials enterprise signals_only] Tier string `json:"tier,omitempty"` } @@ -64,7 +64,7 @@ var entitlementEntityTypeTierPropEnum []interface{} func init() { var res []string - if err := json.Unmarshal([]byte(`["free","essentials","enterprise"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["free","essentials","enterprise","signals_only"]`), &res); err != nil { panic(err) } for _, v := range res { @@ -82,6 +82,9 @@ const ( // EntitlementEntityTierEnterprise captures enum value "enterprise" EntitlementEntityTierEnterprise string = "enterprise" + + // EntitlementEntityTierSignalsOnly captures enum value "signals_only" + EntitlementEntityTierSignalsOnly string = "signals_only" ) // prop value enum diff --git a/models/integrations_microsoft_teams_v2_channel_entity.go b/models/integrations_microsoft_teams_v2_channel_entity.go new file mode 100644 index 0000000..5cc8a33 --- /dev/null +++ b/models/integrations_microsoft_teams_v2_channel_entity.go @@ -0,0 +1,125 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// IntegrationsMicrosoftTeamsV2ChannelEntity integrations microsoft teams v2 channel entity +// +// swagger:model Integrations_MicrosoftTeamsV2_ChannelEntity +type IntegrationsMicrosoftTeamsV2ChannelEntity struct { + + // channel id + ChannelID string `json:"channel_id,omitempty"` + + // channel name + ChannelName string `json:"channel_name,omitempty"` + + // channel url + ChannelURL string `json:"channel_url,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // incident + Incident *IncidentEntity `json:"incident,omitempty"` + + // ms team id + MsTeamID string `json:"ms_team_id,omitempty"` + + // status + Status string `json:"status,omitempty"` + + // team name + TeamName string `json:"team_name,omitempty"` +} + +// Validate validates this integrations microsoft teams v2 channel entity +func (m *IntegrationsMicrosoftTeamsV2ChannelEntity) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateIncident(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *IntegrationsMicrosoftTeamsV2ChannelEntity) validateIncident(formats strfmt.Registry) error { + if swag.IsZero(m.Incident) { // not required + return nil + } + + if m.Incident != nil { + if err := m.Incident.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("incident") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("incident") + } + return err + } + } + + return nil +} + +// ContextValidate validate this integrations microsoft teams v2 channel entity based on the context it is used +func (m *IntegrationsMicrosoftTeamsV2ChannelEntity) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateIncident(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *IntegrationsMicrosoftTeamsV2ChannelEntity) contextValidateIncident(ctx context.Context, formats strfmt.Registry) error { + + if m.Incident != nil { + if err := m.Incident.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("incident") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("incident") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *IntegrationsMicrosoftTeamsV2ChannelEntity) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *IntegrationsMicrosoftTeamsV2ChannelEntity) UnmarshalBinary(b []byte) error { + var res IntegrationsMicrosoftTeamsV2ChannelEntity + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/patch_v1_incidents_incident_id_tasks_task_id.go b/models/patch_v1_incidents_incident_id_tasks_task_id.go index 0619e74..2e1ec38 100644 --- a/models/patch_v1_incidents_incident_id_tasks_task_id.go +++ b/models/patch_v1_incidents_incident_id_tasks_task_id.go @@ -8,8 +8,10 @@ package models import ( "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // PatchV1IncidentsIncidentIDTasksTaskID Update a task's attributes @@ -23,6 +25,10 @@ type PatchV1IncidentsIncidentIDTasksTaskID struct { // A description of what the task is for. Description string `json:"description,omitempty"` + // The due date of the task. + // Format: date-time + DueAt strfmt.DateTime `json:"due_at,omitempty"` + // The state of the task. One of: open, in_progress, cancelled, done State string `json:"state,omitempty"` @@ -32,6 +38,27 @@ type PatchV1IncidentsIncidentIDTasksTaskID struct { // Validate validates this patch v1 incidents incident Id tasks task Id func (m *PatchV1IncidentsIncidentIDTasksTaskID) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDueAt(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PatchV1IncidentsIncidentIDTasksTaskID) validateDueAt(formats strfmt.Registry) error { + if swag.IsZero(m.DueAt) { // not required + return nil + } + + if err := validate.FormatOf("due_at", "body", "date-time", m.DueAt.String(), formats); err != nil { + return err + } + return nil } diff --git a/models/patch_v1_signals_email_targets_id.go b/models/patch_v1_signals_email_targets_id.go index af4ee1a..d752253 100644 --- a/models/patch_v1_signals_email_targets_id.go +++ b/models/patch_v1_signals_email_targets_id.go @@ -190,7 +190,7 @@ type PatchV1SignalsEmailTargetsIDTarget struct { // The type of target that the inbound email will notify when matched. // Required: true - // Enum: [EscalationPolicy OnCallSchedule Team User SlackChannel] + // Enum: [Team EscalationPolicy OnCallSchedule User SlackChannel] Type *string `json:"type"` } @@ -225,7 +225,7 @@ var patchV1SignalsEmailTargetsIdTargetTypeTypePropEnum []interface{} func init() { var res []string - if err := json.Unmarshal([]byte(`["EscalationPolicy","OnCallSchedule","Team","User","SlackChannel"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["Team","EscalationPolicy","OnCallSchedule","User","SlackChannel"]`), &res); err != nil { panic(err) } for _, v := range res { @@ -235,15 +235,15 @@ func init() { const ( + // PatchV1SignalsEmailTargetsIDTargetTypeTeam captures enum value "Team" + PatchV1SignalsEmailTargetsIDTargetTypeTeam string = "Team" + // PatchV1SignalsEmailTargetsIDTargetTypeEscalationPolicy captures enum value "EscalationPolicy" PatchV1SignalsEmailTargetsIDTargetTypeEscalationPolicy string = "EscalationPolicy" // PatchV1SignalsEmailTargetsIDTargetTypeOnCallSchedule captures enum value "OnCallSchedule" PatchV1SignalsEmailTargetsIDTargetTypeOnCallSchedule string = "OnCallSchedule" - // PatchV1SignalsEmailTargetsIDTargetTypeTeam captures enum value "Team" - PatchV1SignalsEmailTargetsIDTargetTypeTeam string = "Team" - // PatchV1SignalsEmailTargetsIDTargetTypeUser captures enum value "User" PatchV1SignalsEmailTargetsIDTargetTypeUser string = "User" diff --git a/models/patch_v1_teams_team_id.go b/models/patch_v1_teams_team_id.go index 3c5a919..232ea99 100644 --- a/models/patch_v1_teams_team_id.go +++ b/models/patch_v1_teams_team_id.go @@ -12,6 +12,7 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/go-openapi/validate" ) // PatchV1TeamsTeamID Update a single team from its ID @@ -25,6 +26,9 @@ type PatchV1TeamsTeamID struct { // memberships Memberships []*PatchV1TeamsTeamIDMembershipsItems0 `json:"memberships"` + // ms teams channel + MsTeamsChannel *PatchV1TeamsTeamIDMsTeamsChannel `json:"ms_teams_channel,omitempty"` + // name Name string `json:"name,omitempty"` @@ -43,6 +47,10 @@ func (m *PatchV1TeamsTeamID) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateMsTeamsChannel(formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -75,6 +83,25 @@ func (m *PatchV1TeamsTeamID) validateMemberships(formats strfmt.Registry) error return nil } +func (m *PatchV1TeamsTeamID) validateMsTeamsChannel(formats strfmt.Registry) error { + if swag.IsZero(m.MsTeamsChannel) { // not required + return nil + } + + if m.MsTeamsChannel != nil { + if err := m.MsTeamsChannel.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ms_teams_channel") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ms_teams_channel") + } + return err + } + } + + return nil +} + // ContextValidate validate this patch v1 teams team Id based on the context it is used func (m *PatchV1TeamsTeamID) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error @@ -83,6 +110,10 @@ func (m *PatchV1TeamsTeamID) ContextValidate(ctx context.Context, formats strfmt res = append(res, err) } + if err := m.contextValidateMsTeamsChannel(ctx, formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -109,6 +140,22 @@ func (m *PatchV1TeamsTeamID) contextValidateMemberships(ctx context.Context, for return nil } +func (m *PatchV1TeamsTeamID) contextValidateMsTeamsChannel(ctx context.Context, formats strfmt.Registry) error { + + if m.MsTeamsChannel != nil { + if err := m.MsTeamsChannel.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ms_teams_channel") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ms_teams_channel") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *PatchV1TeamsTeamID) MarshalBinary() ([]byte, error) { if m == nil { @@ -169,3 +216,76 @@ func (m *PatchV1TeamsTeamIDMembershipsItems0) UnmarshalBinary(b []byte) error { *m = res return nil } + +// PatchV1TeamsTeamIDMsTeamsChannel MS Teams channel identity for channel associated with this team +// +// swagger:model PatchV1TeamsTeamIDMsTeamsChannel +type PatchV1TeamsTeamIDMsTeamsChannel struct { + + // channel id + // Required: true + ChannelID *string `json:"channel_id"` + + // ms team id + // Required: true + MsTeamID *string `json:"ms_team_id"` +} + +// Validate validates this patch v1 teams team ID ms teams channel +func (m *PatchV1TeamsTeamIDMsTeamsChannel) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateChannelID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMsTeamID(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PatchV1TeamsTeamIDMsTeamsChannel) validateChannelID(formats strfmt.Registry) error { + + if err := validate.Required("ms_teams_channel"+"."+"channel_id", "body", m.ChannelID); err != nil { + return err + } + + return nil +} + +func (m *PatchV1TeamsTeamIDMsTeamsChannel) validateMsTeamID(formats strfmt.Registry) error { + + if err := validate.Required("ms_teams_channel"+"."+"ms_team_id", "body", m.MsTeamID); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this patch v1 teams team ID ms teams channel based on context it is used +func (m *PatchV1TeamsTeamIDMsTeamsChannel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *PatchV1TeamsTeamIDMsTeamsChannel) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PatchV1TeamsTeamIDMsTeamsChannel) UnmarshalBinary(b []byte) error { + var res PatchV1TeamsTeamIDMsTeamsChannel + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/patch_v1_teams_team_id_signal_rules_id.go b/models/patch_v1_teams_team_id_signal_rules_id.go index 3c864c9..1a3fa01 100644 --- a/models/patch_v1_teams_team_id_signal_rules_id.go +++ b/models/patch_v1_teams_team_id_signal_rules_id.go @@ -29,6 +29,10 @@ type PatchV1TeamsTeamIDSignalRulesID struct { // The rule's name. Name string `json:"name,omitempty"` + // A notification priority that will be set on the resulting alert (default: HIGH) + // Enum: [HIGH MEDIUM LOW ] + NotificationPriorityOverride string `json:"notification_priority_override,omitempty"` + // The ID of the target that the rule will notify when matched. TargetID string `json:"target_id,omitempty"` @@ -41,6 +45,10 @@ type PatchV1TeamsTeamIDSignalRulesID struct { func (m *PatchV1TeamsTeamIDSignalRulesID) Validate(formats strfmt.Registry) error { var res []error + if err := m.validateNotificationPriorityOverride(formats); err != nil { + res = append(res, err) + } + if err := m.validateTargetType(formats); err != nil { res = append(res, err) } @@ -51,6 +59,54 @@ func (m *PatchV1TeamsTeamIDSignalRulesID) Validate(formats strfmt.Registry) erro return nil } +var patchV1TeamsTeamIdSignalRulesIdTypeNotificationPriorityOverridePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["HIGH","MEDIUM","LOW",""]`), &res); err != nil { + panic(err) + } + for _, v := range res { + patchV1TeamsTeamIdSignalRulesIdTypeNotificationPriorityOverridePropEnum = append(patchV1TeamsTeamIdSignalRulesIdTypeNotificationPriorityOverridePropEnum, v) + } +} + +const ( + + // PatchV1TeamsTeamIDSignalRulesIDNotificationPriorityOverrideHIGH captures enum value "HIGH" + PatchV1TeamsTeamIDSignalRulesIDNotificationPriorityOverrideHIGH string = "HIGH" + + // PatchV1TeamsTeamIDSignalRulesIDNotificationPriorityOverrideMEDIUM captures enum value "MEDIUM" + PatchV1TeamsTeamIDSignalRulesIDNotificationPriorityOverrideMEDIUM string = "MEDIUM" + + // PatchV1TeamsTeamIDSignalRulesIDNotificationPriorityOverrideLOW captures enum value "LOW" + PatchV1TeamsTeamIDSignalRulesIDNotificationPriorityOverrideLOW string = "LOW" + + // PatchV1TeamsTeamIDSignalRulesIDNotificationPriorityOverrideEmpty captures enum value "" + PatchV1TeamsTeamIDSignalRulesIDNotificationPriorityOverrideEmpty string = "" +) + +// prop value enum +func (m *PatchV1TeamsTeamIDSignalRulesID) validateNotificationPriorityOverrideEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, patchV1TeamsTeamIdSignalRulesIdTypeNotificationPriorityOverridePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *PatchV1TeamsTeamIDSignalRulesID) validateNotificationPriorityOverride(formats strfmt.Registry) error { + if swag.IsZero(m.NotificationPriorityOverride) { // not required + return nil + } + + // value enum + if err := m.validateNotificationPriorityOverrideEnum("notification_priority_override", "body", m.NotificationPriorityOverride); err != nil { + return err + } + + return nil +} + var patchV1TeamsTeamIdSignalRulesIdTypeTargetTypePropEnum []interface{} func init() { diff --git a/models/post_v1_incidents_incident_id_tasks.go b/models/post_v1_incidents_incident_id_tasks.go index 1f0ec24..3245724 100644 --- a/models/post_v1_incidents_incident_id_tasks.go +++ b/models/post_v1_incidents_incident_id_tasks.go @@ -25,6 +25,10 @@ type PostV1IncidentsIncidentIDTasks struct { // A description of what the task is for. Description string `json:"description,omitempty"` + // The due date of the task. + // Format: date-time + DueAt strfmt.DateTime `json:"due_at,omitempty"` + // The state of the task. One of: open, in_progress, cancelled, done State string `json:"state,omitempty"` @@ -37,6 +41,10 @@ type PostV1IncidentsIncidentIDTasks struct { func (m *PostV1IncidentsIncidentIDTasks) Validate(formats strfmt.Registry) error { var res []error + if err := m.validateDueAt(formats); err != nil { + res = append(res, err) + } + if err := m.validateTitle(formats); err != nil { res = append(res, err) } @@ -47,6 +55,18 @@ func (m *PostV1IncidentsIncidentIDTasks) Validate(formats strfmt.Registry) error return nil } +func (m *PostV1IncidentsIncidentIDTasks) validateDueAt(formats strfmt.Registry) error { + if swag.IsZero(m.DueAt) { // not required + return nil + } + + if err := validate.FormatOf("due_at", "body", "date-time", m.DueAt.String(), formats); err != nil { + return err + } + + return nil +} + func (m *PostV1IncidentsIncidentIDTasks) validateTitle(formats strfmt.Registry) error { if err := validate.Required("title", "body", m.Title); err != nil { diff --git a/models/post_v1_signals_email_targets.go b/models/post_v1_signals_email_targets.go index 7022948..9eab085 100644 --- a/models/post_v1_signals_email_targets.go +++ b/models/post_v1_signals_email_targets.go @@ -204,7 +204,7 @@ type PostV1SignalsEmailTargetsTarget struct { // The type of target that the inbound email will notify when matched. // Required: true - // Enum: [EscalationPolicy OnCallSchedule Team User SlackChannel] + // Enum: [Team EscalationPolicy OnCallSchedule User SlackChannel] Type *string `json:"type"` } @@ -239,7 +239,7 @@ var postV1SignalsEmailTargetsTargetTypeTypePropEnum []interface{} func init() { var res []string - if err := json.Unmarshal([]byte(`["EscalationPolicy","OnCallSchedule","Team","User","SlackChannel"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["Team","EscalationPolicy","OnCallSchedule","User","SlackChannel"]`), &res); err != nil { panic(err) } for _, v := range res { @@ -249,15 +249,15 @@ func init() { const ( + // PostV1SignalsEmailTargetsTargetTypeTeam captures enum value "Team" + PostV1SignalsEmailTargetsTargetTypeTeam string = "Team" + // PostV1SignalsEmailTargetsTargetTypeEscalationPolicy captures enum value "EscalationPolicy" PostV1SignalsEmailTargetsTargetTypeEscalationPolicy string = "EscalationPolicy" // PostV1SignalsEmailTargetsTargetTypeOnCallSchedule captures enum value "OnCallSchedule" PostV1SignalsEmailTargetsTargetTypeOnCallSchedule string = "OnCallSchedule" - // PostV1SignalsEmailTargetsTargetTypeTeam captures enum value "Team" - PostV1SignalsEmailTargetsTargetTypeTeam string = "Team" - // PostV1SignalsEmailTargetsTargetTypeUser captures enum value "User" PostV1SignalsEmailTargetsTargetTypeUser string = "User" diff --git a/models/post_v1_teams.go b/models/post_v1_teams.go index 7de8caa..795ec42 100644 --- a/models/post_v1_teams.go +++ b/models/post_v1_teams.go @@ -26,6 +26,9 @@ type PostV1Teams struct { // memberships Memberships []*PostV1TeamsMembershipsItems0 `json:"memberships"` + // ms teams channel + MsTeamsChannel *PostV1TeamsMsTeamsChannel `json:"ms_teams_channel,omitempty"` + // name // Required: true Name *string `json:"name"` @@ -45,6 +48,10 @@ func (m *PostV1Teams) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateMsTeamsChannel(formats); err != nil { + res = append(res, err) + } + if err := m.validateName(formats); err != nil { res = append(res, err) } @@ -81,6 +88,25 @@ func (m *PostV1Teams) validateMemberships(formats strfmt.Registry) error { return nil } +func (m *PostV1Teams) validateMsTeamsChannel(formats strfmt.Registry) error { + if swag.IsZero(m.MsTeamsChannel) { // not required + return nil + } + + if m.MsTeamsChannel != nil { + if err := m.MsTeamsChannel.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ms_teams_channel") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ms_teams_channel") + } + return err + } + } + + return nil +} + func (m *PostV1Teams) validateName(formats strfmt.Registry) error { if err := validate.Required("name", "body", m.Name); err != nil { @@ -98,6 +124,10 @@ func (m *PostV1Teams) ContextValidate(ctx context.Context, formats strfmt.Regist res = append(res, err) } + if err := m.contextValidateMsTeamsChannel(ctx, formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -124,6 +154,22 @@ func (m *PostV1Teams) contextValidateMemberships(ctx context.Context, formats st return nil } +func (m *PostV1Teams) contextValidateMsTeamsChannel(ctx context.Context, formats strfmt.Registry) error { + + if m.MsTeamsChannel != nil { + if err := m.MsTeamsChannel.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ms_teams_channel") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ms_teams_channel") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *PostV1Teams) MarshalBinary() ([]byte, error) { if m == nil { @@ -184,3 +230,76 @@ func (m *PostV1TeamsMembershipsItems0) UnmarshalBinary(b []byte) error { *m = res return nil } + +// PostV1TeamsMsTeamsChannel MS Teams channel identity for channel associated with this team +// +// swagger:model PostV1TeamsMsTeamsChannel +type PostV1TeamsMsTeamsChannel struct { + + // channel id + // Required: true + ChannelID *string `json:"channel_id"` + + // ms team id + // Required: true + MsTeamID *string `json:"ms_team_id"` +} + +// Validate validates this post v1 teams ms teams channel +func (m *PostV1TeamsMsTeamsChannel) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateChannelID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMsTeamID(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PostV1TeamsMsTeamsChannel) validateChannelID(formats strfmt.Registry) error { + + if err := validate.Required("ms_teams_channel"+"."+"channel_id", "body", m.ChannelID); err != nil { + return err + } + + return nil +} + +func (m *PostV1TeamsMsTeamsChannel) validateMsTeamID(formats strfmt.Registry) error { + + if err := validate.Required("ms_teams_channel"+"."+"ms_team_id", "body", m.MsTeamID); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this post v1 teams ms teams channel based on context it is used +func (m *PostV1TeamsMsTeamsChannel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *PostV1TeamsMsTeamsChannel) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PostV1TeamsMsTeamsChannel) UnmarshalBinary(b []byte) error { + var res PostV1TeamsMsTeamsChannel + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/models/post_v1_teams_team_id_signal_rules.go b/models/post_v1_teams_team_id_signal_rules.go index 1c0151d..1fca453 100644 --- a/models/post_v1_teams_team_id_signal_rules.go +++ b/models/post_v1_teams_team_id_signal_rules.go @@ -31,6 +31,10 @@ type PostV1TeamsTeamIDSignalRules struct { // Required: true Name *string `json:"name"` + // A notification priority that will be set on the resulting alert (default: HIGH) + // Enum: [HIGH MEDIUM LOW ] + NotificationPriorityOverride string `json:"notification_priority_override,omitempty"` + // The ID of the target that the rule will notify when matched. // Required: true TargetID *string `json:"target_id"` @@ -53,6 +57,10 @@ func (m *PostV1TeamsTeamIDSignalRules) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateNotificationPriorityOverride(formats); err != nil { + res = append(res, err) + } + if err := m.validateTargetID(formats); err != nil { res = append(res, err) } @@ -85,6 +93,54 @@ func (m *PostV1TeamsTeamIDSignalRules) validateName(formats strfmt.Registry) err return nil } +var postV1TeamsTeamIdSignalRulesTypeNotificationPriorityOverridePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["HIGH","MEDIUM","LOW",""]`), &res); err != nil { + panic(err) + } + for _, v := range res { + postV1TeamsTeamIdSignalRulesTypeNotificationPriorityOverridePropEnum = append(postV1TeamsTeamIdSignalRulesTypeNotificationPriorityOverridePropEnum, v) + } +} + +const ( + + // PostV1TeamsTeamIDSignalRulesNotificationPriorityOverrideHIGH captures enum value "HIGH" + PostV1TeamsTeamIDSignalRulesNotificationPriorityOverrideHIGH string = "HIGH" + + // PostV1TeamsTeamIDSignalRulesNotificationPriorityOverrideMEDIUM captures enum value "MEDIUM" + PostV1TeamsTeamIDSignalRulesNotificationPriorityOverrideMEDIUM string = "MEDIUM" + + // PostV1TeamsTeamIDSignalRulesNotificationPriorityOverrideLOW captures enum value "LOW" + PostV1TeamsTeamIDSignalRulesNotificationPriorityOverrideLOW string = "LOW" + + // PostV1TeamsTeamIDSignalRulesNotificationPriorityOverrideEmpty captures enum value "" + PostV1TeamsTeamIDSignalRulesNotificationPriorityOverrideEmpty string = "" +) + +// prop value enum +func (m *PostV1TeamsTeamIDSignalRules) validateNotificationPriorityOverrideEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, postV1TeamsTeamIdSignalRulesTypeNotificationPriorityOverridePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *PostV1TeamsTeamIDSignalRules) validateNotificationPriorityOverride(formats strfmt.Registry) error { + if swag.IsZero(m.NotificationPriorityOverride) { // not required + return nil + } + + // value enum + if err := m.validateNotificationPriorityOverrideEnum("notification_priority_override", "body", m.NotificationPriorityOverride); err != nil { + return err + } + + return nil +} + func (m *PostV1TeamsTeamIDSignalRules) validateTargetID(formats strfmt.Registry) error { if err := validate.Required("target_id", "body", m.TargetID); err != nil { diff --git a/models/signals_api_rule_entity.go b/models/signals_api_rule_entity.go index 2c35861..0df73e8 100644 --- a/models/signals_api_rule_entity.go +++ b/models/signals_api_rule_entity.go @@ -7,6 +7,7 @@ package models import ( "context" + "encoding/json" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -38,6 +39,10 @@ type SignalsAPIRuleEntity struct { // name Name string `json:"name,omitempty"` + // notification priority override + // Enum: [HIGH MEDIUM LOW] + NotificationPriorityOverride string `json:"notification_priority_override,omitempty"` + // target Target *SignalsAPITargetEntity `json:"target,omitempty"` @@ -65,6 +70,10 @@ func (m *SignalsAPIRuleEntity) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateNotificationPriorityOverride(formats); err != nil { + res = append(res, err) + } + if err := m.validateTarget(formats); err != nil { res = append(res, err) } @@ -129,6 +138,51 @@ func (m *SignalsAPIRuleEntity) validateIncidentType(formats strfmt.Registry) err return nil } +var signalsApiRuleEntityTypeNotificationPriorityOverridePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["HIGH","MEDIUM","LOW"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + signalsApiRuleEntityTypeNotificationPriorityOverridePropEnum = append(signalsApiRuleEntityTypeNotificationPriorityOverridePropEnum, v) + } +} + +const ( + + // SignalsAPIRuleEntityNotificationPriorityOverrideHIGH captures enum value "HIGH" + SignalsAPIRuleEntityNotificationPriorityOverrideHIGH string = "HIGH" + + // SignalsAPIRuleEntityNotificationPriorityOverrideMEDIUM captures enum value "MEDIUM" + SignalsAPIRuleEntityNotificationPriorityOverrideMEDIUM string = "MEDIUM" + + // SignalsAPIRuleEntityNotificationPriorityOverrideLOW captures enum value "LOW" + SignalsAPIRuleEntityNotificationPriorityOverrideLOW string = "LOW" +) + +// prop value enum +func (m *SignalsAPIRuleEntity) validateNotificationPriorityOverrideEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, signalsApiRuleEntityTypeNotificationPriorityOverridePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *SignalsAPIRuleEntity) validateNotificationPriorityOverride(formats strfmt.Registry) error { + if swag.IsZero(m.NotificationPriorityOverride) { // not required + return nil + } + + // value enum + if err := m.validateNotificationPriorityOverrideEnum("notification_priority_override", "body", m.NotificationPriorityOverride); err != nil { + return err + } + + return nil +} + func (m *SignalsAPIRuleEntity) validateTarget(formats strfmt.Registry) error { if swag.IsZero(m.Target) { // not required return nil diff --git a/models/task_entity.go b/models/task_entity.go index a20be4d..6eef93e 100644 --- a/models/task_entity.go +++ b/models/task_entity.go @@ -32,6 +32,10 @@ type TaskEntity struct { // description Description string `json:"description,omitempty"` + // due at + // Format: date-time + DueAt strfmt.DateTime `json:"due_at,omitempty"` + // id ID string `json:"id,omitempty"` @@ -62,6 +66,10 @@ func (m *TaskEntity) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateDueAt(formats); err != nil { + res = append(res, err) + } + if err := m.validateUpdatedAt(formats); err != nil { res = append(res, err) } @@ -122,6 +130,18 @@ func (m *TaskEntity) validateCreatedBy(formats strfmt.Registry) error { return nil } +func (m *TaskEntity) validateDueAt(formats strfmt.Registry) error { + if swag.IsZero(m.DueAt) { // not required + return nil + } + + if err := validate.FormatOf("due_at", "body", "date-time", m.DueAt.String(), formats); err != nil { + return err + } + + return nil +} + func (m *TaskEntity) validateUpdatedAt(formats strfmt.Registry) error { if swag.IsZero(m.UpdatedAt) { // not required return nil diff --git a/models/team_entity.go b/models/team_entity.go index f274e8d..de27622 100644 --- a/models/team_entity.go +++ b/models/team_entity.go @@ -39,6 +39,9 @@ type TeamEntity struct { // memberships Memberships []*MembershipEntity `json:"memberships"` + // ms teams channel + MsTeamsChannel *IntegrationsMicrosoftTeamsV2ChannelEntity `json:"ms_teams_channel,omitempty"` + // name Name string `json:"name,omitempty"` @@ -94,6 +97,10 @@ func (m *TeamEntity) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateMsTeamsChannel(formats); err != nil { + res = append(res, err) + } + if err := m.validateOwnedChecklistTemplates(formats); err != nil { res = append(res, err) } @@ -215,6 +222,25 @@ func (m *TeamEntity) validateMemberships(formats strfmt.Registry) error { return nil } +func (m *TeamEntity) validateMsTeamsChannel(formats strfmt.Registry) error { + if swag.IsZero(m.MsTeamsChannel) { // not required + return nil + } + + if m.MsTeamsChannel != nil { + if err := m.MsTeamsChannel.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ms_teams_channel") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ms_teams_channel") + } + return err + } + } + + return nil +} + func (m *TeamEntity) validateOwnedChecklistTemplates(formats strfmt.Registry) error { if swag.IsZero(m.OwnedChecklistTemplates) { // not required return nil @@ -418,6 +444,10 @@ func (m *TeamEntity) ContextValidate(ctx context.Context, formats strfmt.Registr res = append(res, err) } + if err := m.contextValidateMsTeamsChannel(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateOwnedChecklistTemplates(ctx, formats); err != nil { res = append(res, err) } @@ -508,6 +538,22 @@ func (m *TeamEntity) contextValidateMemberships(ctx context.Context, formats str return nil } +func (m *TeamEntity) contextValidateMsTeamsChannel(ctx context.Context, formats strfmt.Registry) error { + + if m.MsTeamsChannel != nil { + if err := m.MsTeamsChannel.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ms_teams_channel") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ms_teams_channel") + } + return err + } + } + + return nil +} + func (m *TeamEntity) contextValidateOwnedChecklistTemplates(ctx context.Context, formats strfmt.Registry) error { for i := 0; i < len(m.OwnedChecklistTemplates); i++ { diff --git a/models/ticketing_ticket_entity.go b/models/ticketing_ticket_entity.go index 16fbf59..077f826 100644 --- a/models/ticketing_ticket_entity.go +++ b/models/ticketing_ticket_entity.go @@ -37,6 +37,10 @@ type TicketingTicketEntity struct { // description Description string `json:"description,omitempty"` + // due at + // Format: date-time + DueAt strfmt.DateTime `json:"due_at,omitempty"` + // id ID string `json:"id,omitempty"` @@ -93,6 +97,10 @@ func (m *TicketingTicketEntity) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateDueAt(formats); err != nil { + res = append(res, err) + } + if err := m.validateLink(formats); err != nil { res = append(res, err) } @@ -176,6 +184,18 @@ func (m *TicketingTicketEntity) validateCreatedBy(formats strfmt.Registry) error return nil } +func (m *TicketingTicketEntity) validateDueAt(formats strfmt.Registry) error { + if swag.IsZero(m.DueAt) { // not required + return nil + } + + if err := validate.FormatOf("due_at", "body", "date-time", m.DueAt.String(), formats); err != nil { + return err + } + + return nil +} + func (m *TicketingTicketEntity) validateLink(formats strfmt.Registry) error { if swag.IsZero(m.Link) { // not required return nil